/** * Implemements hook_process_page * @param array $variables */ function fs_core_preprocess_page(&$variables) { //Search form $search_form = drupal_get_form('search_form'); $search_form_box = drupal_render($search_form); $variables['search_box'] = $search_form_box; if ($views_page = views_get_page_view()) { $variables['theme_hook_suggestions'][] = 'page__views__' . $views_page->name; $variables['theme_hook_suggestions'][] = 'page__views__' . $views_page->name . '_' . $views_page->current_display; } if (isset($variables['node']->type)) { $variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type; } // changes the links tree for the main menu, since by // default Drupal just provides first level ones $menu_tree = menu_tree_all_data('main-menu'); $menu_tree = menu_tree_output($menu_tree); foreach ($menu_tree as $k => $v) { if (is_numeric($k) && count($v['#below'])) { $menu_tree[$k]['#below']['#theme_wrappers'][0] = 'menu_tree__submenu'; } } $variables['main_menu'] = $menu_tree; if (arg(0) == 'taxonomy' && arg(1) == 'term') { $tid = (int) arg(2); $term = taxonomy_term_load($tid); if (is_object($term)) { $variables['theme_hook_suggestions'][] = 'page__taxonomy__' . $term->vocabulary_machine_name; } } }
public function navigation() { $primary_nav = $this->rebuildTree(menu_tree_all_data('main-menu')); $secondary_nav = $this->rebuildTree(menu_tree_all_data('user-menu')); echo '<div id="navbar" class="navbar navbar-default">'; echo '<div class="navbar-header">'; echo '<a class="logo navbar-btn pull-left" href="/">'; echo '<img src="/images/vleermuis-logo.png" alt="Vleermuiskasten.nl" />'; echo '</a>'; echo '<div class="search hidden-xs">'; echo '<form id="search">'; echo '<input type="text" name="search" placeholder="Zoeken">'; echo '<button type="submit"><i class="glyphicon glyphicon-search"></i></button>'; echo '</form>'; echo '</div>'; echo '<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">'; echo '<span class="sr-only">Navigatie openen</span>'; echo '<span class="icon-bar"></span>'; echo '<span class="icon-bar"></span>'; echo '<span class="icon-bar"></span>'; echo '</button>'; echo '</div>'; echo '<div class="navbar-collapse collapse">'; echo '<nav role="navigation">'; echo Nav::widget(['items' => $primary_nav, 'options' => ['class' => 'menu nav navbar-nav']]); echo Nav::widget(['items' => $secondary_nav, 'options' => ['class' => 'menu nav navbar-nav']]); echo '</nav>'; echo '</div>'; echo '</div>'; }
/** * Implements theme_links() targeting the secondary menu topbar. */ function mdl_links__topbar_secondary_menu($variables) { // We need to fetch the links ourselves because we need the entire tree. $links = menu_tree_output(menu_tree_all_data(variable_get('menu_secondary_links_source', 'user-menu'))); $output = _mdl_links($links); return '<nav' . drupal_attributes($variables['attributes']) . '>' . $output . '</nav>'; }
/** * Implements theme_links() targeting the main menu topbar. * Override base template, which would add the class of "left",which we don't need */ function qualiceutics__topbar_main_menu($variables) { // We need to fetch the links ourselves because we need the entire tree. $links = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu'))); $output = _zurb_foundation_links($links); return '<ul' . drupal_attributes($variables['attributes']) . '>' . $output . '</ul>'; }
/** * Preprocessor for page.tpl.php template file. */ function msd15_preprocess_page(&$vars, $hook) { // Get the entire main menu tree $main_menu_tree = menu_tree_all_data('main-menu'); $vars['menu_tree_all_data'] = $main_menu_tree; // Add the rendered output to the $main_menu_expanded variable $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree); if (isset($vars['node']->type)) { // We don't want to apply this on taxonomy or view pages // Splice (2) is based on existing default suggestions. Change it if you need to. array_splice($vars['theme_hook_suggestions'], -1, 0, 'page__' . $vars['node']->type); // Get the url_alias and make each item part of an array $url_alias = drupal_get_path_alias($_GET['q']); $split_url = explode('/', $url_alias); // Add the full path template pages // Insert 2nd to last to allow page--node--[nid] to be last $cumulative_path = ''; foreach ($split_url as $path) { $cumulative_path .= '__' . $path; $path_name = 'page' . $cumulative_path; array_splice($vars['theme_hook_suggestions'], -1, 0, str_replace('-', '_', $path_name)); } // This does just the page name on its own & is considered more specific than the longest path // (because sometimes those get too long) // Also we don't want to do this if there were no paths on the URL // Again, add 2nd to last to preserve page--node--[nid] if we do add it in if (count($split_url) > 1) { $page_name = end($split_url); array_splice($vars['theme_hook_suggestions'], -1, 0, 'page__' . str_replace('-', '_', $page_name)); } } }
/** * Implements theme_links() targeting the secondary menu topbar. */ function drupalcampbelgium_links__topbar_secondary_menu($variables) { // We need to fetch the links ourselves because we need the entire tree. $links = menu_tree_output(menu_tree_all_data(variable_get('menu_secondary_links_source', 'user-menu'))); $output = _zurb_foundation_links($links); $variables['attributes']['class'][] = 'center-buttons'; return '<ul' . drupal_attributes($variables['attributes']) . '>' . $output . '</ul>'; }
function fever_preprocess_page(&$vars) { // .... // Get the entire main menu tree $main_menu_tree = menu_tree_all_data('main-menu'); // Add the rendered output to the $main_menu_expanded variable $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree); }
/** * Display submenu on menu items. */ function carpediem_process_page(&$variables) { // Array with the names of the menus $menu_names = array('menu-logopedie', 'menu-kinesitherapie'); foreach ($menu_names as $menu_name) { $menu_tree = menu_tree_all_data($menu_name); $variables[$menu_name] = menu_tree_output($menu_tree); } }
function courage_admin_preprocess_page(&$variables) { $main_menu_tree = menu_tree_all_data('management'); $link = array('#theme' => 'item_list', '#items' => array(l('Home', url('<front>')))); $link['home'] = array('#theme' => 'link', '#text' => t('Home'), '#path' => '<front>', '#options' => array('attributes' => array(), 'html' => TRUE)); $main_menu_output = menu_tree_output($main_menu_tree); array_unshift($main_menu_output, $link); $variables['primary_main_menu'] = render($main_menu_output); }
/** * theme override of link auxiliary_menu * TODO: create automatically an auxiliary_menu machine_name: menu-auxiliary-menu */ function gwt_drupal_links__menu_auxiliary_menu($variables) { $links = menu_tree_all_data('menu-auxiliary-menu', null, 4); // print_r($links); // heading not needed in main menu $heading = $variables['heading']; // global $language_url; $output = ''; $output .= _gwt_drupal_link_render($links, 0, $variables); return $output; }
/** * Implements theme_preprocess_page(). */ function townsquare_bootstrap_preprocess_page(&$vars) { global $user; $vars['primary_local_tasks'] = menu_primary_local_tasks(); $vars['secondary_local_tasks'] = menu_secondary_local_tasks(); // The following menu stuff is lame foreach ($vars['main_menu'] as $item => $options) { $vars['main_menu'][$item]['html'] = TRUE; $vars['main_menu'][$item]['attributes']['id'] = 'menu-link-' . drupal_clean_css_identifier($options['href']); } $admin_menu = menu_tree_all_data('management'); $children = array_pop($admin_menu); if ($children) { foreach ($children['below'] as $key => $value) { $children['below'][$key]['below'] = array(); } $vars['admin_menu'] = menu_tree_output($children['below']); } // Add user picture if logged in if ($user->uid) { $vars['user_name'] = check_plain($user->name); if (!empty($user->picture)) { if (is_numeric($user->picture)) { $user->picture = file_load($user->picture); } if (!empty($user->picture->uri)) { $filepath = $user->picture->uri; } } elseif (variable_get('user_picture_default', '')) { $filepath = variable_get('user_picture_default', ''); } if (isset($filepath)) { $alt = t("@user's picture", array('@user' => format_username($user))); if (module_exists('image') && file_valid_uri($filepath) && ($style = variable_get('user_picture_style', ''))) { $vars['user_picture'] = theme('image_style', array('style_name' => $style, 'path' => $filepath, 'alt' => $alt, 'title' => $alt)); } else { $vars['user_picture'] = theme('image', array('path' => $filepath, 'alt' => $alt, 'title' => $alt)); } } else { $vars['user_picture'] = '<i class="icon-user"></i>'; } } else { unset($vars['secondary_menu']); $vars['login'] = drupal_get_form('user_login_block'); } // Add Bootstrap $path = libraries_get_path('bootstrap'); drupal_add_css($path . '/css/bootstrap.css'); drupal_add_css($path . '/css/bootstrap-responsive.css'); drupal_add_js($path . '/js/bootstrap.js'); $path = libraries_get_path('font-awesome'); drupal_add_css($path . '/css/font-awesome.css'); }
/** * Preprocess variables for page template. */ function spacelab_preprocess_page(&$vars) { // Get the entire main menu tree. $main_menu_tree = array(); $main_menu_tree = menu_tree_all_data('main-menu', NULL, 2); // Add the rendered output to the $main_menu_expanded variable. $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree); // Always print the site name and slogan, but if they are toggled off, we'll // just hide them visually. $vars['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE; $vars['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE; if ($vars['hide_site_name']) { // If toggle_name is FALSE, the site_name will be empty, so we rebuild it. $vars['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal')); } if ($vars['hide_site_slogan']) { // If toggle_site_slogan is FALSE, the site_slogan will be empty, // so we rebuild it. $vars['site_slogan'] = filter_xss_admin(variable_get('site_slogan', '')); } // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($vars['title_suffix']['add_or_remove_shortcut']) && $vars['title']) { // Add a wrapper div using title_prefix and title_suffix render elements. $vars['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100); $vars['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99); // Make sure the shortcut link is the first item in title_suffix. $vars['title_suffix']['add_or_remove_shortcut']['#weight'] = -100; } // If panels arent being used at all. $vars['no_panels'] = !(module_exists('page_manager') && page_manager_get_current_page()); // Check if we're to always print the page title, even on panelized pages. $vars['always_show_page_title'] = theme_get_setting('always_show_page_title') ? TRUE : FALSE; /** * insert variables into page template. */ if ($vars['page']['sidebar_first'] && $vars['page']['sidebar_second']) { $vars['sidebar_grid_class'] = 'col-md-3'; $vars['main_grid_class'] = 'col-md-6'; } elseif ($vars['page']['sidebar_first'] || $vars['page']['sidebar_second']) { $vars['sidebar_grid_class'] = 'col-md-3'; $vars['main_grid_class'] = 'col-md-9'; } else { $vars['main_grid_class'] = 'col-md-12'; } if ($vars['page']['header_top_left'] && $vars['page']['header_top_right']) { $vars['header_top_left_grid_class'] = 'col-md-8'; $vars['header_top_right_grid_class'] = 'col-md-4'; } elseif ($vars['page']['header_top_right'] || $vars['page']['header_top_left']) { $vars['header_top_left_grid_class'] = 'col-md-12'; $vars['header_top_right_grid_class'] = 'col-md-12'; } }
function corporato_preprocess_page(&$variables) { $main_menu_tree = menu_tree_all_data('main-menu'); //$expanded = menu_tree_output($main_menu_tree); //krumo($main_menu_tree); //krumo($expanded); $menuParent = array_slice(menu_get_active_trail(), 1); //krumo($menuParent); $output = '<ul>' . _process_menu_node($main_menu_tree, $menuParent) . '</ul>'; //krumo($output); //krumo($expanded); $variables['corporato_main_menu'] = $output; }
/** * Override or insert variables into the page template. * * Implements template_process_block(). */ function innovation_preprocess_block(&$variables) { $block = $variables['block']; if ($block->delta == 'main-menu' && $block->module == 'system' && $block->status == 1 && ($block->theme = 'innovation')) { // Get the entire main menu tree. $main_menu_tree = array(); $main_menu_tree = menu_tree_all_data('main-menu', NULL, 2); // Add the rendered output to the $main_menu_expanded variable. // $main_menu_asu = menu_tree_output($main_menu_tree); $pri_attributes = array('class' => array('nav', 'navbar-nav', 'links', 'clearfix')); $variables['content'] = theme('links__system_main_menu', array('links' => $main_menu_asu, 'attributes' => $pri_attributes, 'heading' => array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible')))); $block->subject = ''; } }
/** * Implements theme_links() targeting the main menu specifically. * Formats links for Top Bar http://foundation.zurb.com/docs/components/top-bar.html */ function metroblocks_links__topbar_main_menu($variables) { // We need to fetch the links ourselves because we need the entire tree. $links = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu'))); $i = 1; foreach ($links as $key => $value) { if (is_numeric($key)) { $links[$key]['#attributes']['class'][] = 'color-' . $i; $i++; } } $output = _metroblocks_links($links); //$variables['attributes']['class'][] = 'right'; return '<ul' . drupal_attributes($variables['attributes']) . '>' . $output . '</ul>'; }
function bunsen_preprocess_page(&$variables) { drupal_add_library('system', 'ui.accordion'); // Primary nav. $variables['primary_nav'] = FALSE; if ($variables['main_menu']) { // Build links. $variables['primary_nav'] = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu'))); // Provide default theme wrapper function. $variables['primary_nav']['#theme_wrappers'] = array('menu_tree__primary'); } if (drupal_is_front_page()) { $variables['content_column_class'] = 'col-lg-12 text-center'; } else { $variables['content_column_class'] = 'col-lg-12 content-page'; } }
/** * Override or insert variables into the page template. */ function nbcu_preprocess_page(&$vars) { /* Modify the output for the menu selected to be the top menu (main menu) */ $top_menu = theme_get_setting('top_menu'); $top_menu_data = menu_tree_all_data($top_menu); $vars['responsive_main_menu'] = theme('responsive_menu', array('menu' => $top_menu_data)); /* Add required js by bootstrap */ /* The CSS files are loaded from the .info file * The js files are loaded here as opposed to the .info file bacause the js files meed to be added at the bottom * of the document. */ drupal_add_js(path_to_theme() . '/bootstrap/js/bootstrap.min.js', array('scope' => 'footer', 'weight' => 10)); drupal_add_js(path_to_theme() . '/bootstrap/js/docs.min.js', array('scope' => 'footer', 'weight' => 11)); drupal_add_js(path_to_theme() . '/bootstrap/js/ie10-viewport-bug-workaround.js', array('scope' => 'footer', 'weight' => 12)); drupal_add_js(path_to_theme() . '/skrollr/skrollr.js', array('scope' => 'footer', 'weight' => 13)); drupal_add_js(path_to_theme() . '/skrollr/skrollr-init.js', array('scope' => 'footer', 'weight' => 13)); }
function open_framework_preprocess_page(&$vars) { // Add page template suggestions based on the aliased path. For instance, if the current page has an alias of about/history/early, we'll have templates of: // page-about-history-early.tpl.php, page-about-history.tpl.php, page-about.tpl.php // Whichever is found first is the one that will be used. if (module_exists('path')) { $alias = drupal_get_path_alias(str_replace('/edit', '', $_GET['q'])); if ($alias != $_GET['q']) { $template_filename = 'page'; foreach (explode('/', $alias) as $path_part) { $template_filename = $template_filename . '-' . $path_part; $vars['template_files'][] = $template_filename; } } } // Get the entire main menu tree $main_menu_tree = menu_tree_all_data('main-menu'); // Add the rendered output to the $main_menu_expanded variables $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree); // Primary nav $vars['primary_nav'] = FALSE; if ($vars['main_menu']) { // Build links $vars['primary_nav'] = menu_tree(variable_get('menu_main_links_source', 'main-menu')); // Provide default theme wrapper function $vars['primary_nav']['#theme_wrappers'] = array('menu_tree__primary'); } // Secondary nav $vars['secondary_nav'] = FALSE; if ($vars['secondary_menu']) { // Build links $vars['secondary_nav'] = menu_tree(variable_get('menu_secondary_links_source', 'user-menu')); // Provide default theme wrapper function $vars['secondary_nav']['#theme_wrappers'] = array('menu_tree__secondary'); } // Checks if tabs are set if (!isset($vars['tabs']['#primary'])) { $vars['tabs']['#primary'] = FALSE; } // Replace tabs with drop down version $vars['tabs']['#primary'] = _bootstrap_local_tasks($vars['tabs']['#primary']); // Add variable for site title $vars['my_site_title'] = variable_get('site_name'); }
/** * Implements hook_preprocess_maintenance_page(). */ function photography_preprocess_maintenance_page(&$variables) { global $base_path; $variables['front'] = $base_path; $variables['404_image'] = drupal_get_path('theme', 'photography') . '/assets/img/skadi-404.png'; // The logo. $logo = file_load(variable_get('photo_config_logo', '')); $logo_url = file_create_url($logo->uri); $variables['logo'] = $logo_url; // Load the main menu. $menu_links = menu_tree_all_data('main-menu'); // Initialize links string. $links = ''; // Loop through links. foreach ($menu_links as $link) { $links .= '<li class="menu-item">' . l($link['link']['title'], $link['link']['href']) . '</li>'; } // Preprocess menu links. $variables['main_menu'] = $variables['mobile_menu'] = $links; }
/** * @file * Contains theme override functions and preprocess functions for the theme. */ function subbluez_preprocess_page(&$vars) { $vars['main_menu_tree'] = menu_tree_output(menu_tree_all_data('main-menu')); $vars['slideshow_display'] = theme_get_setting('slideshow_display', 'subbluez'); $vars['footer_developed'] = theme_get_setting('footer_developed', 'subbluez'); //Columns $vars['col1'] = filter_xss_admin(theme_get_setting('colone', 'subbluez')); $vars['col1title'] = filter_xss_admin(theme_get_setting('colonetitle', 'subbluez')); $vars['col2'] = filter_xss_admin(theme_get_setting('coltwo', 'subbluez')); $vars['col2title'] = filter_xss_admin(theme_get_setting('coltwotitle', 'subbluez')); $vars['col3'] = filter_xss_admin(theme_get_setting('colthree', 'subbluez')); $vars['col3title'] = filter_xss_admin(theme_get_setting('colthreetitle', 'subbluez')); //Welcome $vars['wtitle'] = filter_xss_admin(theme_get_setting('welcome_title', 'subbluez')); $vars['wtext'] = filter_xss_admin(theme_get_setting('welcome_text', 'subbluez')); //Social $vars['twitter'] = theme_get_setting('twitter', 'subbluez'); $vars['facebook'] = theme_get_setting('facebook', 'subbluez'); $vars['linkedin'] = theme_get_setting('linkedin', 'subbluez'); $vars['theme_path_social'] = base_path() . drupal_get_path('theme', 'subbluez'); $vars['display'] = theme_get_setting('display', 'subbluez'); }
/** * Preprocessor for theme('page'). */ function apigee_devconnect_preprocess_page(&$variables) { $variables['user_reg_setting'] = variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL); $menu_tree = menu_tree_output(menu_tree_all_data('main-menu', NULL, 2)); $variables['primary_nav'] = drupal_render($menu_tree); // Custom Search $variables['search'] = FALSE; if (theme_get_setting('toggle_search') && module_exists('search')) { $variables['search'] = drupal_get_form('search_form'); } if (!user_is_anonymous()) { # Fix for long user names global $user; $user_email = $user->mail; if (strlen($user_email) > 22) { $tmp = str_split($user_email, 16); $user_email = $tmp[0] . '…'; } $variables['truncated_user_email'] = $user_email; } else { $variables['truncated_user_email'] = ''; } }
</p> <?php } ?> <?php /*print render($page['header']);*/ ?> <nav id="mainnav" > <div id="menu"> <?php $menu = menu_tree_all_data("menu-principal"); // Création du tableau que l'on enverra au moteur de template echo '<ul class="level1">'; foreach ($menu as $item) { $path = $item["link"]["link_path"]; $parent = menu_link_get_preferred($path); $parameters = array('active_trail' => array($parent['plid']), 'only_active_trail' => FALSE, 'min_depth' => $parent['depth'] + 1, 'max_depth' => $parent['depth'] + 1, 'conditions' => array('plid' => $parent['mlid'])); $childrens = menu_build_tree($parent['menu_name'], $parameters); echo '<li class="nb' . $item["link"]["mlid"] . '">'; $nbChildrens = count($childrens); if ($nbChildrens > 0) { echo '<a href="#r' . $item["link"]["mlid"] . '">' . $item["link"]["title"] . '</a>'; echo '<div class="menu row" id="r' . $item["link"]["mlid"] . '">'; echo '<ul class="level2">'; foreach ($childrens as $children) { $path = $children["link"]["link_path"];
function negd_preprocess_page(&$variables, $hook) { if (isset($variables['node'])) { $type = $variables['node']->type; if ($type == 't_owner_assignments') { $title = $variables['node']->field_task_title ? $variables['node']->field_task_title['und'][0]['value'] : ''; $variables['title'] = $title; $variables['theme_hook_suggestions'][] = 'page__t_owner_assignments'; // Added by akv $variables['interested_link'] = _is_interested(arg(1)); // akv $variables['node_content'] =& $variables['page']['content']['system_main']['nodes'][arg(1)]; // akv } } $main_menu_tree = menu_tree_all_data('menu-left-menu'); if (($views_page = views_get_page_view()) && $views_page->name === "calendar") { $variables['theme_hook_suggestions'][] = 'page__views__calendar'; } negd_removetab($variables); }
</div> </div> </div> <div class="overlay-preloader overlay-preloader-hide overlay-preloader-destroy"> <div class="cell-preloader"> <img class="preloader" src="<?php echo $base_url; ?> /sites/all/themes/maxhealthcare/images/preloader.gif"> </div> </div> <ul class="wrapper-specialty ps-container ps-active-y ps-active-x" id="specialtiesPanel" data-ps-id="2f85ffbe-e4b6-508f-f65e-a68d625ddfc8"> <?php $main_menu = menu_tree_all_data('menu-our-specialities', $link = NULL, $max_depth = NULL); foreach ($main_menu as $menu_item) { ?> <a class="part part-contact dynamic" href="<?php $path = drupal_get_path_alias($path = $menu_item['link']['link_path']); echo $base_url . '/' . $path; ?> "> <li class="container-specialty specialty-Bone"> <div class="specialty-icon"> <div class="table-icon"> <div class="cell-icon"> <img class="icon" src="<?php echo $menu_item['link']['localized_options']['menu_icon']['path']; ?> ">
/** * Override or insert variables into the page template. * * Implements template_process_page(). */ function kalatheme_process_page(&$variables) { // Hook into color.module. if (module_exists('color')) { _color_page_alter($variables); } // Define variables to theme local actions as a dropdown. $dropdown_attributes = array('container' => array('class' => array('dropdown', 'actions', 'pull-right')), 'toggle' => array('class' => array('dropdown-toggle', 'enabled'), 'data-toggle' => array('dropdown'), 'href' => array('#')), 'content' => array('class' => array('dropdown-menu'))); // Add local actions as the last item in the local tasks. if (!empty($variables['action_links'])) { $variables['tabs']['#primary'][]['#markup'] = theme('menu_local_actions', array('menu_actions' => $variables['action_links'], 'attributes' => $dropdown_attributes)); $variables['action_links'] = FALSE; } // Get the entire main menu tree. $main_menu_tree = array(); $main_menu_tree = menu_tree_all_data('main-menu', NULL, 2); // Add the rendered output to the $main_menu_expanded variable. $variables['main_menu_expanded'] = menu_tree_output($main_menu_tree); // Always print the site name and slogan, but if they are toggled off, we'll // just hide them visually. $variables['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE; $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE; if ($variables['hide_site_name']) { // If toggle_name is FALSE, the site_name will be empty, so we rebuild it. $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal')); } if ($variables['hide_site_slogan']) { // If toggle_site_slogan is FALSE, the site_slogan will be empty, // so we rebuild it. $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', '')); } // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) { // Add a wrapper div using title_prefix and title_suffix render elements. $variables['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100); $variables['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99); // Make sure the shortcut link is the first item in title_suffix. $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100; } // If panels arent being used at all. $variables['no_panels'] = !(module_exists('page_manager') && page_manager_get_current_page()); // Check if we're to always print the page title, even on panelized pages. $variables['always_show_page_title'] = theme_get_setting('always_show_page_title') ? TRUE : FALSE; }
function getMy_Title($menu_name, $level = 0) { // Don't even bother querying the menu table if no menu is specified. if (empty($menu_name)) { return array(); } // Get the menu hierarchy for the current page. //$tree = menu_tree_page_data($menu_name); $tree = menu_tree_all_data($menu_name); // Go down the active trail until the right level is reached. while ($level-- > 0 && $tree) { // Loop through the current level's items until we find one that is in trail. while ($item = array_shift($tree)) { if ($item['link']['in_active_trail']) { // If the item is in the active trail, we continue in the subtree. $tree = empty($item['below']) ? array() : $item['below']; break; } } } // Create a single level of links. $links = array(); $my_arr = array(); foreach ($tree as $item) { if (!$item['link']['hidden']) { $class = ''; $l = $item['link']['localized_options']; $l['href'] = $item['link']['href']; $l['title'] = $item['link']['title']; if ($item['link']['in_active_trail']) { $class = ' active-trail'; } // Keyed with the unique mlid to generate classes in theme_links(). //$links['menu-'. $item['link']['mlid'] . $class] = $l; //$links['title'] = $l; $my_arr[] = $l['title']; } } return $my_arr; }
?> " /> </div> </div> </form> </div> </div> </header> <!-- Blog inner yellow section --> <div class="main_yellow_inner main_h blog_top-yellow"> <div class="container"> <!-- Top links start here --> <ul class="y_inner-topul text-center mobile_hidden"> <?php $tree = menu_tree_all_data('menu-secondary-menu'); // echo "testing"; foreach ($tree as $key => $value) { if ($value['link']['language'] == $language->language) { ?> <li><h3><a href="<?php echo url($value['link']['link_path'], array('absolute' => true)); ?> "><?php echo $value['link']['link_title']; ?> </a></h3></li> <?php } } ?>
print l($m['link']['title'], $m['link']['link_path'], array("attributes" => array("class" => array("aside-menu__link")))); ?> </li> <?php } ?> <?php } ?> <?php } ?> </div> <div class="aside-menu__shortcuts"> <?php $shortcuts = menu_tree_all_data("menu-shortcatmenu"); ?> <?php foreach ($shortcuts as $m) { ?> <?php if (!$m['link']['hidden']) { ?> <?php $active = ''; if (isset($m['link']['link_path']) && $m['link']['link_path'] == $_GET['q']) { $active = "current"; } ?> <?php print l($m['link']['title'], $m['link']['link_path'], array("attributes" => array("class" => array("aside-menu__shortcut", $active))));
?> <?php $block = module_invoke('BRM_millerlite', 'block_view', 'social_icons'); print render($block['content']); ?> <!--/-dashboard--> </div> <!--/Menu--> </div> </div> <div class="row bg-men-3 visible-lg visible-sm"> <div class="col-lg-offset-3 col-lg-6 col-md-10 col-sm-10 col-xs-12"> <!--Sub-Menu--> <ul class="nav nav-pills visible-lg"> <?php $varMenu = menu_tree_all_data('main-menu'); foreach ($varMenu as $key => $value) { $conSubMenu = count($value['below']); $tit = strtolower($value['link']['link_title']); $alias = drupal_get_path_alias($value['link']['link_path']); $alias2 = drupal_get_path_alias(arg(0) . "/" . arg(1)); if ($tit == 'home' && $alias2 == 'node/') { ?> <li class="active"> <?php } else { ?> <li class=""> <?php } ?>
function hook_preprocess_page(&$variables) { $links_left = menu_tree_output(menu_tree_all_data(theme_plugin_get_setting('foundation_topbar', 'menu_left', 'main-menu'))); $links_right = menu_tree_output(menu_tree_all_data(theme_plugin_get_setting('foundation_topbar', 'menu_right', 'user-menu'))); $variables['foundation_topbar'] = theme('foundation_topbar', array('links_left' => $links_left, 'links_right' => $links_right)); }