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
0ef2cdf7
Commit
0ef2cdf7
authored
May 13, 2014
by
Riccardo Padovani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started to work on footer menu function
parent
42295d27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
template.php
template.php
+48
-1
tpl/page.tpl.php
tpl/page.tpl.php
+3
-1
No files found.
template.php
View file @
0ef2cdf7
...
...
@@ -109,6 +109,53 @@ function valencia_preprocess_html( &$variables ) {
//function drupal_add_js($data, $options);
}
/**
* Add our vars 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
);
}
function
valencia_links__system_main_menu
(
$vars
)
{
$html
=
'<ul>'
;
$voice_number
=
0
;
foreach
(
$vars
[
'links'
]
as
$key
=>
$link
)
{
if
(
is_numeric
(
$key
))
{
$sub_menu
=
''
;
$link_title
=
$link
[
'#title'
];
// Check for submenu
if
(
!
empty
(
$link
[
'#below'
]))
{
// Recurse
$sub_menu
=
theme
(
'links__system_main_menu'
,
array
(
'links'
=>
$link
[
'#below'
],
));
}
if
(
$link
[
'#original_link'
][
'depth'
]
===
'1'
)
{
// First level menu is h2
$html
.=
'<li><h2>'
.
l
(
$link_title
,
$link
[
'#href'
],
array
(
'html'
=>
'true'
))
.
'</h2>'
.
$sub_menu
.
'</li>'
;
}
else
if
(
$voice_number
===
0
)
{
$html
.=
'<li class="first">'
.
l
(
$link_title
,
$link
[
'#href'
],
array
(
'html'
=>
'true'
))
.
$sub_menu
.
'</li>'
;
}
else
{
$html
.=
'<li>'
.
l
(
$link_title
,
$link
[
'#href'
],
array
(
'html'
=>
'true'
))
.
$sub_menu
.
'</li>'
;
}
$voice_number
++
;
}
}
$html
.=
'</ul>'
;
return
$html
;
}
if
(
!
function_exists
(
'region_empty'
)
)
:
/**
* Check if region is empty.
...
...
@@ -150,4 +197,4 @@ function region_empty( $region ) {
return
$empty
;
}
endif
;
\ No newline at end of file
endif
;
tpl/page.tpl.php
View file @
0ef2cdf7
...
...
@@ -136,7 +136,9 @@
<nav
role=
"navigation"
>
<div
class=
"footer-a"
>
<div
class=
"clearfix"
>
<?php
print
render
(
$page
[
'footer'
]);
?>
<?php
print
theme
(
'links__system_main_menu'
,
array
(
'links'
=>
$valencia_footer_menu
));
?>
</div>
</div>
<!-- /.clearfix, /.footer-a -->
<div
class=
"legal clearfix"
>
<p
class=
"twelve-col"
>
©
Ubuntu e Canonical sono marchi registrati da Canonical Ltd.
</p>
...
...
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