You are here

function current_search_menu_alter in Facet API 7

Same name and namespace in other branches
  1. 6.3 contrib/current_search/current_search.module \current_search_menu_alter()
  2. 7.2 contrib/current_search/current_search.module \current_search_menu_alter()

Implements hook_menu_alter().

File

contrib/current_search/current_search.module, line 54
Provides an interface for creating blocks containing information about the current search.

Code

function current_search_menu_alter(&$items) {

  // Use same access callback as Facet API. We can't define access callbacks in
  // CTools plugins, so we have to alter the menu and define them here.
  $base_path = 'admin/config/search/current_search';
  foreach ($items as $path => $item) {
    if ($base_path == $path || 0 === strpos($path, "{$base_path}/")) {
      $items[$path]['access callback'] = 'facetapi_access_callback';
      $items[$path]['access arguments'] = array();
    }
  }

  // Ensures that the edit link shows up in contextual links.
  $item =& $items['admin/config/search/current_search/list/%ctools_export_ui/edit'];
  $item['title'] = 'Configure current search items';
  $item['type'] = MENU_LOCAL_ACTION;
  $item['context'] = MENU_CONTEXT_INLINE;
}