Commit 8e3dc772 authored by Riccardo Padovani's avatar Riccardo Padovani

Added function to manage header menu

parent ed30fd02
......@@ -126,11 +126,34 @@ function valencia_preprocess_page( &$vars ) {
*/
function valencia_links__system_main_menu($vars) {
switch ($vars['id']) {
case 'header':
return valencia_header_menu($vars);
case 'footer':
return valencia_footer_menu($vars);
}
}
/**
* Custom links for header menu
* Follows http://design.ubuntu.com/web-style-guide/scaffolding#navigation
*/
function valencia_header_menu($vars) {
// Var with all HTML of the menu
$html = '<ul>';
foreach ($vars['links'] as $key => $link) {
// To print every menu voice only one, see Drupal API
if (is_numeric($key)) {
$link_title = $link['#title'];
$link_href = $link['#href'];
$html .= '<li>' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
}
}
$html .= '</ul>';
return $html;
}
/**
* Custom links for footer menu
* Follows http://design.ubuntu.com/web-style-guide/scaffolding#footer
......
......@@ -85,9 +85,10 @@
<?php endif; ?>
<header class="banner global" role="banner">
<nav class="nav-primary" role="navigation">
<ul>
<li><a href="#">Something</a></li>
</ul>
<?php print theme('links__system_main_menu', array(
'links' => $valencia_menu,
'id' => 'header'
));?>
<div class="site-name">
<a class="logo-ubuntuit" href="<?php print $front_page; ?>">
<span>ubuntu-it</span>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment