You are here

function notifications_account_menu in Notifications 7

Implementation of hook_menu()

File

notifications_account/notifications_account.module, line 11
Notifications module - User subscriptions tabs

Code

function notifications_account_menu() {

  // User account tabs
  $items['user/%user/notifications'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Notifications',
    'page callback' => 'notifications_account_overview',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'notifications_account_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'notifications_account.pages.inc',
  );
  $items['user/%user/notifications/overview'] = array(
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'title' => 'Overview',
    'weight' => -10,
  );
  $items['user/%user/notifications/subscription'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Subscriptions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_account_manage_subscriptions_form',
      1,
    ),
    'access callback' => 'notifications_account_access',
    'access arguments' => array(
      1,
      'maintain',
    ),
    'file' => 'notifications_account.pages.inc',
  );

  // Edit subscription under subscriptions tab
  $items['user/%user/notifications/subscription/%notifications_subscription'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Edit subscription',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_subscription_edit_form',
      4,
    ),
    'access callback' => 'notifications_account_subscription_access',
    'access arguments' => array(
      'edit',
      5,
    ),
    'file' => 'notifications_account.pages.inc',
  );
  $items['user/%user/notifications/subscription/%notifications_subscription/edit'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Edit subscription',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_subscription_edit_form',
      4,
    ),
    'access callback' => 'notifications_account_subscription_access',
    'access arguments' => array(
      'edit',
      5,
    ),
    'file' => 'notifications_account.pages.inc',
  );

  // Delete subscription under subscriptions tab
  $items['user/%user/notifications/subscription/%notifications_subscription/delete'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Delete subscription',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'notifications_account_form_unsubscribe_confirm',
      4,
    ),
    'access callback' => 'notifications_account_subscription_access',
    'access arguments' => array(
      'unsubscribe',
      5,
    ),
    'file' => 'notifications.pages.inc',
  );

  /*
  $items['user/%user/notifications/update/%'] = array(
    'type' => MENU_CALLBACK,
    'title' => 'Update subscriptions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('notifications_account_update_subscriptions', 1, 4),
    'access callback' => 'notifications_account_access',
    'access arguments' => array(1, 'maintain'),
    'file' => 'notifications_account.pages.inc',
  );
  */
  return $items;
}