function menu_secondary_menu

Returns an array of links to be rendered as the Secondary links.

Related topics

1 call to menu_secondary_menu()
template_preprocess_page in drupal/core/includes/theme.inc
Preprocess variables for page.tpl.php

File

drupal/core/includes/menu.inc, line 1774
API for the Drupal menu system.

Code

function menu_secondary_menu() {
  $config = config('menu.settings');
  $menu_enabled = module_exists('menu');

  // When menu module is not enabled, we need a hardcoded default value.
  $main_links_source = $menu_enabled ? $config
    ->get('main_links') : 'main';
  $secondary_links_source = $menu_enabled ? $config
    ->get('secondary_links') : 'account';

  // If the secondary menu source is set as the primary menu, we display the
  // second level of the primary menu.
  if ($secondary_links_source == $main_links_source) {
    return menu_navigation_links($main_links_source, 1);
  }
  else {
    return menu_navigation_links($secondary_links_source, 0);
  }
}