You are here

function search_files_menu in Search Files 5

Same name and namespace in other branches
  1. 6.2 search_files.module \search_files_menu()
  2. 7.2 search_files.module \search_files_menu()

Implementation of hook_menu()

Return value

$items = array of menu items

File

./search_files.module, line 14
Used to index all files in directory(s) on the server

Code

function search_files_menu() {
  $items = array();
  $items[] = array(
    'path' => 'admin/settings/search_files',
    'title' => t('Search Files'),
    'description' => t('Manage files search'),
    //'page callback' => 'drupal_get_form',
    'callback' => 'drupal_get_form',
    //'page arguments' => array('search_files_settings'),
    'callback arguments' => array(
      'search_files_settings',
    ),
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_NORMAL_ITEM,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/settings',
    'title' => t('Settings'),
    'description' => t('Change settings for Search Files Module'),
    //'page callback' => 'drupal_get_form',
    'callback' => 'drupal_get_form',
    //'page arguments' => array('search_files_settings'),
    'callback arguments' => array(
      'search_files_settings',
    ),
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/helpers',
    'title' => t('Helpers'),
    'description' => t('List Helper Apps for Search Files'),
    //'page callback' => 'search_files_helper_list',
    'callback' => 'search_files_helper_list',
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_LOCAL_TASK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/helpers/list',
    'title' => t('List'),
    'description' => t('List Helper Apps for Search Files'),
    //'page callback' => 'search_files_helper_list',
    'callback' => 'search_files_helper_list',
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/helpers/add',
    'title' => t('Add'),
    'description' => t('Add Helper Apps for Search Files'),
    //'page callback' => 'drupal_get_form',
    'callback' => 'drupal_get_form',
    //'page arguments' => array('search_files_helper_add'),
    'callback arguments' => array(
      'search_files_helper_add',
    ),
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_LOCAL_TASK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/directories',
    'title' => t('Directories'),
    'description' => t('list directories that will be searched'),
    //'page callback' => 'search_files_directories_list',
    'callback' => 'search_files_directories_list',
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_LOCAL_TASK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/directories/list',
    'title' => t('List'),
    'description' => t('list directories that will be searched'),
    //'page callback' => 'search_files_directories_list',
    'callback' => 'search_files_directories_list',
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/directories/add',
    'title' => t('Add'),
    'description' => t('Add a directory that will be searched'),
    //'page callback' => 'drupal_get_form',
    'callback' => 'drupal_get_form',
    //'page arguments' => array('search_files_directories_add'),
    'callback arguments' => array(
      'search_files_directories_add',
    ),
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_LOCAL_TASK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/directory/delete',
    'title' => t('Delete Directory'),
    'description' => t('Delete Searchable Driectory'),
    //'page callback' => 'search_files_directory_confirm_delete',
    'callback' => 'search_files_directory_confirm_delete',
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_CALLBACK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/directory/edit',
    'title' => t('Edit Directory'),
    'description' => t('Edit directory path'),
    //'page callback' => 'drupal_get_form',
    'callback' => 'drupal_get_form',
    //'page arguments' => array('search_files_directory_edit'),
    'callback arguments' => array(
      'search_files_directory_edit',
    ),
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_CALLBACK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/helpers/edit',
    'title' => t('Edit Helper'),
    'description' => t('Edit a Helper App'),
    //'page callback' => 'drupal_get_form',
    'callback' => 'drupal_get_form',
    //'page arguments' => array('search_files_helper_edit'),
    'callback arguments' => array(
      'search_files_helper_edit',
    ),
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_CALLBACK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/helpers/delete',
    'title' => t('Delete Helper'),
    'description' => t('Delete a Helper App'),
    //'page callback' => 'search_files_helper_confirm_delete',
    'callback' => 'search_files_helper_confirm_delete',
    //'access arguments' => array('administer search_files configuration'),
    'access' => user_access('administer search_files configuration'),
    'type' => MENU_CALLBACK,
  );
  $items[] = array(
    'path' => 'admin/settings/search_files/update_index',
    'title' => t('Up date the index'),
    'description' => t('manually run hook_upate_index'),
    //'page callback' => 'search_files_update_index',
    'callback' => 'search_files_update_index',
    //'access arguments' => array('administer search_files configuration'),
    'access' => array(
      'administer search_files configuration',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}