You are here

function notifications_anonymous_menu in Notifications 6.4

Implementation of hook_menu()

File

notifications_anonymous/notifications_anonymous.module, line 21
Notifications for anonymous users

Code

function notifications_anonymous_menu() {

  // Subscribe links. For this items access will be checked later in the page
  $items['notifications/anonymous/subscribe'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'notifications_anonymous_page_subscribe',
    'access callback' => 'notifications_anonymous_subscription_access',
    'access arguments' => array(
      'create',
    ),
    'file' => 'notifications_anonymous.pages.inc',
  );

  // Present form to request subscriptions
  $items['notifications/anonymous/request'] = array(
    'title' => 'Manage subscriptions',
    'page callback' => 'notifications_anonymous_request_page',
    'access callback' => TRUE,
    'file' => 'notifications_anonymous.pages.inc',
    'type' => MENU_CALLBACK,
  );

  // Destination operations
  foreach (array(
    'edit',
    'delete',
    'manage',
  ) as $op) {
    $items['notifications/anonymous/destination/%messaging_destination/' . $op] = array(
      'title' => 'Edit destination',
      'page callback' => 'notifications_anonymous_destination_page',
      'page arguments' => array(
        3,
        4,
      ),
      'access callback' => 'notifications_anonymous_destination_access',
      'access arguments' => array(
        4,
        3,
      ),
      'file' => 'notifications_anonymous.pages.inc',
      'type' => MENU_CALLBACK,
    );
  }

  // Subscription operations
  foreach (array(
    'edit',
    'unsubscribe',
  ) as $op) {
    $items['notifications/anonymous/subscription/%notifications_subscription/' . $op] = array(
      'title' => 'Edit subscription',
      'page callback' => 'notifications_anonymous_subscription_page',
      'page arguments' => array(
        3,
        4,
      ),
      'access callback' => 'notifications_anonymous_subscription_access',
      'access arguments' => array(
        4,
        3,
      ),
      'file' => 'notifications_anonymous.pages.inc',
      'type' => MENU_CALLBACK,
    );
  }

  // Admin settings page
  $items['admin/messaging/notifications/subscriptions/anonymous'] = array(
    'title' => 'Anonymous',
    'description' => 'Settings for anonymous subscriptions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_anonymous_admin_settings_form',
    ),
    'access arguments' => array(
      'administer notifications',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'notifications_anonymous.pages.inc',
  );
  return $items;
}