You are here

function notifications_ui_menu in Notifications 6

Same name and namespace in other branches
  1. 5 notifications_ui/notifications_ui.module \notifications_ui_menu()
  2. 6.4 notifications_ui/notifications_ui.module \notifications_ui_menu()
  3. 6.2 notifications_ui/notifications_ui.module \notifications_ui_menu()
  4. 6.3 notifications_ui/notifications_ui.module \notifications_ui_menu()
  5. 7 notifications_ui/notifications_ui.module \notifications_ui_menu()

Implementation of hook_menu()

File

notifications_ui/notifications_ui.module, line 26
User Interface for subscriptions modules

Code

function notifications_ui_menu() {
  $items['admin/messaging/notifications/ui'] = array(
    'title' => 'User interface',
    'description' => 'Enables site settings for user subscriptions.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_ui_settings_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'notifications_ui.pages.inc',
  );

  // Add single subscription page
  $items['user/%user/notifications/add'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Add subscription',
    'page callback' => 'notifications_ui_page_user_add',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'notifications_ui_access_user_add',
    'access arguments' => array(
      1,
      4,
    ),
    'file' => 'notifications_ui.pages.inc',
    'weight' => 100,
  );

  // Enabled pages for user account and subscription types

  /*
  foreach (notifications_subscription_types() as $type => $info) {
    $info = notifications_subscription_types($type);
    if (!empty($info['page callback'])) {
      $items['user/%user/notifications/' . $type] = array(
        'type' => MENU_LOCAL_TASK,
        'access callback' => 'notifications_ui_access_page',
        'access arguments' => array($type, 1),
        'title' => $info['title'],
        'page callback' => $info['page callback'],
        'page arguments' => array(1),
        'weight' => 10,
      );
    }
  }
  */
  return $items;
}