You are here

function path_redirect_menu in Path redirect 5

Same name and namespace in other branches
  1. 6 path_redirect.module \path_redirect_menu()

Implementation of hook_menu

File

./path_redirect.module, line 72

Code

function path_redirect_menu($may_cache) {
  $access = user_access('administer redirects');
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/build/path-redirect',
      'title' => t('URL redirects'),
      'description' => t('Redirect users from one URL to another'),
      'callback' => 'path_redirect_admin',
      'access' => $access,
    );
    $items[] = array(
      'path' => 'admin/build/path-redirect/list',
      'title' => t('List'),
      'description' => t('List all URL redirects'),
      'access' => $access,
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -3,
    );
    $items[] = array(
      'path' => 'admin/build/path-redirect/add',
      'title' => t('Add redirect'),
      'description' => t('Add a new URL redirect'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'path_redirect_edit',
      ),
      'access' => $access,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/build/path-redirect/edit',
      'title' => t('Edit'),
      'description' => t('Edit an existing URL redirect'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'path_redirect_edit',
      ),
      'access' => $access,
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/build/path-redirect/delete',
      'title' => t('Delete'),
      'description' => t('Delete an existing URL redirect'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'path_redirect_delete_confirm',
      ),
      'access' => $access,
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/build/path-redirect/settings',
      'title' => t('Settings'),
      'description' => t('Configure behavior for URL redirects'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'path_redirect_settings',
      'access' => $access,
      'type' => MENU_LOCAL_TASK,
    );
  }
  else {
    path_redirect_check();
  }
  return $items;
}