You are here

function footermap_get_primary_menus in footermap: a footer site map 7

Same name and namespace in other branches
  1. 5.2 footermap.module \footermap_get_primary_menus()
  2. 6 footermap.module \footermap_get_primary_menus()
1 call to footermap_get_primary_menus()
footermap_settings in ./footermap.module

File

./footermap.module, line 339

Code

function footermap_get_primary_menus($top_menu) {
  $ret = array();
  if (!is_numeric($top_menu)) {
    return $ret;
  }
  $query = db_select('menu_links', 'ml');
  $query
    ->fields('ml')
    ->condition('ml.plid', $top_menu, '=')
    ->condition('ml.hidden', 0, '=');
  $query
    ->join('menu_custom', 'mc', 'ml.menu_name = mc.menu_name');
  $query
    ->fields('mc');
  $res = $query
    ->execute();
  foreach ($res as $menu) {
    $ret[$menu->menu_name] = t($menu->title);
  }
  return $ret;
}