You are here

function xmlsitemap_modal_menu_alter in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap_modal/xmlsitemap_modal.module \xmlsitemap_modal_menu_alter()

Implements hook_menu_alter().

File

xmlsitemap_modal/xmlsitemap_modal.module, line 11
Main file for XML sitemap Modal.

Code

function xmlsitemap_modal_menu_alter(&$items) {
  foreach ($items as $path => $item) {
    if (!empty($item['modal']) && strpos($path, '%ctools_js') === FALSE && $item['page callback'] === 'drupal_get_form') {
      $items["{$path}/%ctools_js"] = $item;
      $items["{$path}/%ctools_js"]['page callback'] = 'xmlsitemap_modal_get_form';
      $items["{$path}/%ctools_js"]['page arguments'][] = substr_count($path, '/') + 1;
    }
  }
}