You are here

function notifications_ui_menu in Notifications 7

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 notifications_ui/notifications_ui.module \notifications_ui_menu()
  4. 6.2 notifications_ui/notifications_ui.module \notifications_ui_menu()
  5. 6.3 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/config/messaging/subscriptions/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.admin.inc',
  );

  // Add single subscription page
  $items['notifications/subscription/add'] = array(
    'title' => 'Add subscription',
    'page callback' => 'system_admin_menu_block_page',
    'access callback' => 'notifications_ui_access_user_add',
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
  );

  // Add link for each  subscription type
  foreach (notifications_subscription_enabled_types() as $type => $subs) {
    $items['notifications/subscription/add/' . $type] = array(
      'title' => $subs
        ->get_title(),
      'title callback' => 'check_plain',
      'description' => $subs
        ->get_description(),
      'page callback' => 'notifications_ui_page_add_subscription',
      'page arguments' => array(
        $type,
      ),
      'access callback' => 'notifications_ui_access_user_add',
      'access arguments' => array(
        $type,
      ),
      'file' => 'notifications_ui.pages.inc',
    );
  }
  return $items;
}