You are here

function notifications_menu in Notifications 7

Same name and namespace in other branches
  1. 5 notifications.module \notifications_menu()
  2. 6.4 notifications.module \notifications_menu()
  3. 6 notifications.module \notifications_menu()
  4. 6.2 notifications.module \notifications_menu()
  5. 6.3 notifications.module \notifications_menu()

Implementation of hook_menu().

File

./notifications.module, line 95
Notifications module

Code

function notifications_menu() {
  $items['admin/config/messaging/notifications'] = array(
    'title' => 'Notifications settings',
    'description' => 'Configure notifications.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_settings_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'notifications.admin.inc',
  );
  $items['admin/config/messaging/notifications/settings'] = array(
    'title' => 'Options',
    'description' => 'Configure notifications',
    'weight' => -10,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/messaging/notifications/events'] = array(
    'title' => 'Events',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_admin_events_form',
    ),
    'type' => MENU_LOCAL_TASK,
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'notifications.admin.inc',
  );
  $items['admin/config/messaging/subscriptions'] = array(
    'title' => 'Subscriptions settings',
    'description' => 'Configure subscription types and options.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_admin_subscriptions_settings',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'notifications.admin.inc',
  );
  $items['admin/config/messaging/subscriptions/types'] = array(
    'title' => 'Options',
    'description' => 'Subscription options.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );

  // Manage existing subscriptions
  $items['admin/notifications'] = array(
    'title' => 'Subscriptions',
    'description' => 'Manage existing subscriptions.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_admin_manage_subscriptions',
    ),
    'access arguments' => array(
      'administer notifications',
    ),
    'file' => 'notifications.admin.inc',
  );
  $items['admin/notifications/admin'] = array(
    'title' => 'Administer subscriptions',
    'description' => 'Administer subscriptions.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'access arguments' => array(
      'administer notifications',
    ),
  );

  /* @todo d7update
    $items['admin/notifications/status'] = array(
      'title' => 'Status',
      'description' => 'Summary of existing subscriptions.',
      'page callback' => 'notifications_admin_status_page',
      'access arguments' => array('administer notifications'),
      'file' => 'notifications.admin.inc',
      'type' => MENU_LOCAL_TASK,
    );
    */

  // Subscribe links. For this items access will be checked later in the page
  $items['notifications/subscribe/%notifications_subscription_type'] = array(
    'title' => 'Subscribe',
    'type' => MENU_CALLBACK,
    'page callback' => 'notifications_page_subscribe',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'notifications_access_subscribe',
    'access arguments' => array(
      2,
    ),
    'file' => 'notifications.pages.inc',
  );

  // Unsubscribe links This page will need to work with anonymous users
  // The parameter will be a list of sids, separated by commas
  $items['notifications/unsubscribe'] = array(
    'title' => 'Unsubscribe',
    'type' => MENU_CALLBACK,
    'page callback' => 'notifications_page_unsubscribe_overview',
    'access callback' => 'notifications_access_unsubscribe',
    'file' => 'notifications.pages.inc',
  );

  // Unsubscribe links This page will need to work with anonymous users
  // The parameter will be a list of sids, separated by commas
  $items['notifications/unsubscribe/%notifications_subscription'] = array(
    'title' => 'Unsubscribe',
    'type' => MENU_CALLBACK,
    'page callback' => 'notifications_page_unsubscribe_subscription',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'notifications_access_unsubscribe',
    'access arguments' => array(
      2,
    ),
    'file' => 'notifications.pages.inc',
  );

  // Delete all subscriptions for user
  $items['notifications/unsubscribe/user/%user'] = array(
    'title' => 'Unsubscribe',
    'type' => MENU_CALLBACK,
    'page callback' => 'notifications_page_unsubscribe_user',
    'page arguments' => array(
      3,
    ),
    'access callback' => 'notifications_access_unsubscribe',
    'access arguments' => array(
      NULL,
      3,
    ),
    'file' => 'notifications.pages.inc',
  );

  // Edit subscription, stand alone page
  $items['notifications/subscription/%notifications_subscription'] = array(
    'type' => MENU_CALLBACK,
    'title' => 'Subscription',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_subscription_form',
      'view',
      2,
    ),
    'access callback' => 'notifications_access_subscription',
    'access arguments' => array(
      2,
      'view',
    ),
    'file' => 'notifications.pages.inc',
  );
  $items['notifications/subscription/%notifications_subscription/view'] = array(
    'title' => 'Subscription',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );

  // Edit subscription, stand alone page
  $items['notifications/subscription/%notifications_subscription/edit'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Edit',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_subscription_form',
      'edit',
      2,
    ),
    'access callback' => 'notifications_access_subscription',
    'access arguments' => array(
      2,
      'edit',
    ),
    'file' => 'notifications.pages.inc',
  );
  $items['notifications/subscription/%notifications_subscription/delete'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Delete',
    'weight' => 100,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_subscription_form',
      'delete',
      2,
    ),
    'access callback' => 'notifications_access_subscription',
    'access arguments' => array(
      2,
      'delete',
    ),
    'file' => 'notifications.pages.inc',
  );

  // Some autocomplete callbacks
  $items['notifications/autocomplete/node/title'] = array(
    'title' => 'Node title autocomplete',
    'page callback' => 'notifications_node_autocomplete_title',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/node.inc',
  );

  // Some autocomplete callbacks
  $items['notifications/autocomplete/node/type'] = array(
    'title' => 'Node title autocomplete',
    'page callback' => 'notifications_node_autocomplete_type',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/node.inc',
  );
  return $items;
}