You are here

function mass_contact_menu in Mass Contact 5

Same name and namespace in other branches
  1. 5.2 mass_contact.module \mass_contact_menu()
  2. 6 mass_contact.module \mass_contact_menu()
  3. 7 mass_contact.module \mass_contact_menu()

Implementation of hook_menu().

File

./mass_contact.module, line 42
Enables mass contact form to selected roles.

Code

function mass_contact_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/build/mass_contact',
      'title' => t('Mass Contact form'),
      'description' => t('Create a mass contact form and set up categories for the form to use.'),
      'callback' => 'mass_contact_admin_categories',
      'access' => user_access('administer site configuration'),
    );
    $items[] = array(
      'path' => 'admin/build/mass_contact/list',
      'title' => t('List'),
      'callback' => 'mass_contact_admin_categories',
      'access' => user_access('administer site configuration'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/build/mass_contact/add',
      'title' => t('Add category'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'mass_contact_admin_edit',
      ),
      'access' => user_access('administer site configuration'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 1,
    );
    $items[] = array(
      'path' => 'admin/build/mass_contact/edit',
      'title' => t('Edit Mass Contact category'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'mass_contact_admin_edit',
      ),
      'access' => user_access('administer site configuration'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/build/mass_contact/delete',
      'title' => t('Delete Mass Contact category'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'mass_contact_admin_delete',
      ),
      'access' => user_access('administer site configuration'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/build/mass_contact/settings',
      'title' => t('Settings'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'mass_contact_admin_settings',
      ),
      'access' => user_access('administer site configuration'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 2,
    );
    $items[] = array(
      'path' => 'mass_contact',
      'title' => t('Mass Contact'),
      'callback' => 'mass_contact_site_page',
      'access' => user_access('access mass contact form'),
      'type' => MENU_SUGGESTED_ITEM,
    );
    $items[] = array(
      'path' => 'node/add/mass_contact',
      'title' => t('Mass Contact'),
      'access' => user_access('create mass_contact content'),
      'type' => MENU_SUGGESTED_ITEM,
    );
  }
  return $items;
}