You are here

function scanner_menu in Search and Replace Scanner 5.2

Same name and namespace in other branches
  1. 6 scanner.module \scanner_menu()
  2. 7 scanner.module \scanner_menu()

Implementation of hook_menu().

File

./scanner.module, line 59
Search and Replace Scanner - works on all nodes text content.

Code

function scanner_menu($may_cache) {
  global $user;
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/content/scanner',
      'title' => t('Search and Replace Scanner'),
      'callback' => 'scanner_view',
      'access' => user_access('perform search and replace'),
    );
    $items[] = array(
      'path' => 'admin/content/scanner/scan',
      'title' => t('Search'),
      'access' => user_access('perform search and replace'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/scanner/scan/confirm',
      'title' => t('Confirm Replace'),
      'access' => user_access('perform search and replace'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'scanner_confirm_form',
      ),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/scanner/undo/confirm',
      'title' => t('Confirm Undo'),
      'access' => user_access('perform search and replace'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'scanner_undo_confirm_form',
      ),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      // Shows up on scanner page as tab.
      'path' => 'admin/content/scanner/settings',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'scanner_admin_form',
      ),
      'access' => user_access('administer scanner settings'),
      'type' => MENU_LOCAL_TASK,
      'title' => t('Settings'),
      'weight' => 1,
    );
    $items[] = array(
      // Shows up on scanner page as tab.
      'path' => 'admin/content/scanner/undo',
      'callback' => 'scanner_undo_page',
      'access' => user_access('perform search and replace'),
      'type' => MENU_LOCAL_TASK,
      'title' => t('Undo'),
    );
    $items[] = array(
      // Shows up on admin page.
      'path' => 'admin/settings/scanner',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'scanner_admin_form',
      ),
      'access' => user_access('administer scanner settings'),
      'title' => t('Search and Replace Scanner'),
    );
  }
  return $items;
}