Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
valencia
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
valencia
Commits
ed30fd02
Commit
ed30fd02
authored
Jun 01, 2014
by
Riccardo Padovani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a chooser for menu theme
parent
ebe427f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
template.php
template.php
+15
-4
tpl/page.tpl.php
tpl/page.tpl.php
+2
-1
No files found.
template.php
View file @
ed30fd02
...
...
@@ -110,15 +110,25 @@ function valencia_preprocess_html( &$variables ) {
}
/**
* Add our
var
s to the page
* Add our
hook
s to the page
*
*/
function
valencia_preprocess_page
(
&
$vars
)
{
// Get the entire main menu tree
$main_menu_tree
=
menu_tree_all_data
(
'main-menu'
);
// Add the rendered output to footer menu
$vars
[
'valencia_footer_menu'
]
=
menu_tree_output
(
$main_menu_tree
);
// Add the rendered output to menu
$vars
[
'valencia_menu'
]
=
menu_tree_output
(
$main_menu_tree
);
}
/**
* Choose which menu create basing on the id
*/
function
valencia_links__system_main_menu
(
$vars
)
{
switch
(
$vars
[
'id'
])
{
case
'footer'
:
return
valencia_footer_menu
(
$vars
);
}
}
/**
...
...
@@ -134,7 +144,7 @@ function valencia_preprocess_page( &$vars ) {
* categories after the 7th
* https://gitlab.com/ubuntu-it-web/valencia/issues/6
*/
function
valencia_
links__system_main
_menu
(
$vars
)
{
function
valencia_
footer
_menu
(
$vars
)
{
// Var with all HTML of the menu
$html
=
'<ul>'
;
// Counter to select first element of every submenu to add class .first
...
...
@@ -151,6 +161,7 @@ function valencia_links__system_main_menu($vars) {
// If there is a submenu create it using the same function
$sub_menu
=
theme
(
'links__system_main_menu'
,
array
(
'links'
=>
$link
[
'#below'
],
'id'
=>
'footer'
));
}
...
...
tpl/page.tpl.php
View file @
ed30fd02
...
...
@@ -139,7 +139,8 @@
<div
class=
"footer-a"
>
<div
class=
"clearfix"
>
<?php
print
theme
(
'links__system_main_menu'
,
array
(
'links'
=>
$valencia_footer_menu
'links'
=>
$valencia_menu
,
'id'
=>
'footer'
));
?>
</div>
</div>
<!-- /.clearfix, /.footer-a -->
<div
class=
"legal clearfix"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment