You are here

function apachesolr_menu in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_menu()
  2. 5 apachesolr.module \apachesolr_menu()
  3. 6.3 apachesolr.module \apachesolr_menu()
  4. 6 apachesolr.module \apachesolr_menu()
  5. 6.2 apachesolr.module \apachesolr_menu()
  6. 7 apachesolr.module \apachesolr_menu()

Implementation of hook_menu().

File

./apachesolr.module, line 21
Integration with the Apache Solr search application.

Code

function apachesolr_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/apachesolr',
      'title' => t('Apache Solr'),
      'description' => t('Administer Apache Solr.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'apachesolr_settings',
      'access' => user_access('administer search'),
    );
    $items[] = array(
      'path' => 'admin/settings/apachesolr/settings',
      'title' => t('Settings'),
      'weight' => -10,
      'access' => user_access('administer search'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/apachesolr/enabled-filters',
      'title' => t('Enabled filters'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'apachesolr_enabled_facets_form',
      'weight' => -7,
      'access' => user_access('administer search'),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/apachesolr/index',
      'title' => t('Search index'),
      'callback' => 'apachesolr_index_page',
      'access' => user_access('administer search'),
      'weight' => -8,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/apachesolr/index/clear/confirm',
      'title' => t('Confirm the re-indexing of all content'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'apachesolr_clear_index_confirm',
      'access' => user_access('administer search'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/settings/apachesolr/index/delete/confirm',
      'title' => t('Confirm index deletion'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'apachesolr_delete_index_confirm',
      'access' => user_access('administer search'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/logs/apachesolr',
      'title' => t('Apache Solr search index'),
      'callback' => 'apachesolr_index_report',
      'access' => user_access('access site reports'),
    );
    $items[] = array(
      'path' => 'admin/logs/apachesolr/index',
      'title' => t('Search index'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/apachesolr/mlt/add_block',
      'callback' => 'drupal_get_form',
      'callback arguments' => 'apachesolr_mlt_add_block_form',
      'access' => user_access('administer search'),
      'type' => MENU_CALLBACK,
    );
  }
  else {
    if (arg(0) == 'admin' && arg(1) == 'settings' && arg(2) == 'apachesolr' && arg(3) == 'mlt' && arg(4) == 'delete_block' && arg(5)) {
      $items[] = array(
        'path' => 'admin/settings/apachesolr/mlt/delete_block/' . arg(5),
        'callback' => 'drupal_get_form',
        'callback arguments' => array(
          'apachesolr_mlt_delete_block_form',
          arg(5),
        ),
        'access' => user_access('administer search'),
        'type' => MENU_CALLBACK,
      );
    }
  }
  return $items;
}