You are here

function xmlsitemap_menu_xmlsitemap_links in XML sitemap 5.2

Implementation of hook_xmlsitmap_links().

File

xmlsitemap_menu/xmlsitemap_menu.module, line 64
Adds menu items to the sitemap.

Code

function xmlsitemap_menu_xmlsitemap_links() {
  unset($GLOBALS['_menu']);
  $menu = menu_get_menu();
  $root_menus = array();
  foreach ($menu['items'][0]['children'] as $mid) {
    $root_menus[$mid] = $menu['items'][$mid]['title'];
  }
  foreach (array_filter(variable_get('xmlsitemap_menu_menus', array())) as $mid) {
    if (isset($root_menus[$mid])) {
      _xmlsitemap_menu_process_link($mid, $menu);
    }
  }
}