You are here

function simplemenu_get_menu in SimpleMenu 6.2

Same name and namespace in other branches
  1. 5 simplemenu.module \simplemenu_get_menu()
  2. 6 simplemenu.module \simplemenu_get_menu()
  3. 7 simplemenu.module \simplemenu_get_menu()

Render an HTML list of links for a given menu.

1 call to simplemenu_get_menu()
simplemenu_footer in ./simplemenu.module
Implementation of hook_footer().

File

./simplemenu.module, line 214
Creates a simplemenu.

Code

function simplemenu_get_menu() {
  $output = '';

  // if a user turned off menu module but SimpleMenu was previously set
  // reset variable so a menu appears
  $menu_name = module_exists('menu') ? variable_get('simplemenu_menu', 'navigation:0') : 'navigation:0';
  $tree = simplemenu_menu_tree($menu_name);

  // allow other modules to alter the tree
  drupal_alter('simplemenu_tree', $tree);

  // if the tree is still empty, display a link to the settings.
  if (!$tree) {
    $tree[] = l(t('No menu items found. Try a different menu as the default.'), 'admin/settings/simplemenu');
  }

  // render for output
  $output = simplemenu_tree_output($tree, array(
    'id' => 'simplemenu',
  ));
  return $output;
}