You are here

function simplemenu_get_menu in SimpleMenu 5

Same name and namespace in other branches
  1. 6.2 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 161
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
  if (module_exists('menu')) {
    $menu = simplemenu_menu_tree(variable_get('simplemenu_menu', 1));
  }
  else {
    $menu = simplemenu_menu_tree(1);
  }
  if (!$menu) {
    $menu = '<li><a href="' . url('admin/settings/simplemenu') . '">' . t('No menu items found. Try a different menu as the default.') . '</a></li>';
  }
  $output .= simplemenu_get_devel();
  $output .= $menu;
  return $output;
}