You are here

function mailhandler_menu in Mailhandler 5

Same name and namespace in other branches
  1. 6.2 mailhandler.module \mailhandler_menu()
  2. 6 mailhandler.module \mailhandler_menu()
  3. 7 mailhandler.module \mailhandler_menu()

Implementation of hook_menu().

File

./mailhandler.module, line 637

Code

function mailhandler_menu($may_cache) {
  $items = array();
  $admin_access = user_access('administer mailhandler');
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/content/mailhandler',
      'title' => t('Mailhandler'),
      'callback' => 'mailhandler_admin',
      'description' => t('Manage mailboxes and retrieve messages.'),
      'access' => $admin_access,
    );
    $items[] = array(
      'path' => 'admin/content/mailhandler/retrieve',
      'title' => t('Retrieve'),
      'callback' => 'mailhandler_admin_retrieve',
      'access' => $admin_access,
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/mailhandler/edit',
      'title' => t('Edit mailbox'),
      'callback' => 'mailhandler_admin_edit',
      'access' => $admin_access,
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/mailhandler/delete',
      'title' => t('Delete mailbox'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'mailhandler_admin_delete_confirm',
      ),
      'access' => $admin_access,
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/mailhandler/list',
      'title' => t('List'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10,
      'access' => $admin_access,
    );
    $items[] = array(
      'path' => 'admin/content/mailhandler/add',
      'title' => t('Add mailbox'),
      'callback' => 'mailhandler_admin_edit',
      'access' => $admin_access,
      'type' => MENU_LOCAL_TASK,
    );
  }
  else {
    drupal_add_css(drupal_get_path('module', 'mailhandler') . '/mailhandler.css');
  }
  return $items;
}