You are here

function xmlsitemap_menu_xmlsitemap_process_menu_links in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap_menu/xmlsitemap_menu.module \xmlsitemap_menu_xmlsitemap_process_menu_links()

Process menu sitemap links.

Parameters

$mlids: An array of menu link IDs.

2 calls to xmlsitemap_menu_xmlsitemap_process_menu_links()
xmlsitemap_menu_menu_edit_item_submit in xmlsitemap_menu/xmlsitemap_menu.module
Form submit callback; update the sitemap link when a menu item is updated.
xmlsitemap_menu_xmlsitemap_index_links in xmlsitemap_menu/xmlsitemap_menu.module
Implements hook_xmlsitemap_index_links().
1 string reference to 'xmlsitemap_menu_xmlsitemap_process_menu_links'
xmlsitemap_menu_xmlsitemap_link_info in xmlsitemap_menu/xmlsitemap_menu.module
Implements hook_xmlsitemap_link_info().

File

xmlsitemap_menu/xmlsitemap_menu.module, line 68

Code

function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids, array $xmlsitemap = array()) {

  // Set the global user variable to the anonymous user.
  xmlsitemap_switch_user(0);
  foreach ($mlids as $mlid) {
    $menu_item = menu_link_load($mlid);
    if (empty($menu_item)) {
      continue;
    }
    if (!empty($xmlsitemap)) {
      $menu_item['xmlsitemap'] = $xmlsitemap;
    }
    $link = xmlsitemap_menu_create_link($menu_item);
    xmlsitemap_link_save($link);
  }

  // Set the global user variable back to the original user.
  xmlsitemap_restore_user();
}