Commit ed30fd02 authored by Riccardo Padovani's avatar Riccardo Padovani

Added a chooser for menu theme

parent ebe427f7
......@@ -110,15 +110,25 @@ function valencia_preprocess_html( &$variables ) {
}
/**
* Add our vars to the page
* Add our hooks 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'
));
}
......
......@@ -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">
......
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