You are here

function simplenews_menu in Simplenews 7.2

Same name and namespace in other branches
  1. 5 simplenews.module \simplenews_menu()
  2. 6.2 simplenews.module \simplenews_menu()
  3. 6 simplenews.module \simplenews_menu()
  4. 7 simplenews.module \simplenews_menu()

Implements hook_menu().

File

./simplenews.module, line 110
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_menu() {
  $items['admin/content/simplenews'] = array(
    'title' => 'Newsletters',
    'description' => 'List newsletters and newsletter sent status.',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_admin_newsletter_issues',
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/simplenews.admin.inc',
  );
  $items['admin/config/services/simplenews'] = array(
    'title' => 'Newsletters',
    'description' => 'Configure your sites newsletters.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_admin_categories',
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/simplenews.admin.inc',
  );
  $items['admin/config/services/simplenews/categories'] = array(
    'title' => 'Newsletters',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/services/simplenews/categories/%simplenews_newsletter/edit'] = array(
    'title' => 'Newsletters',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_admin_newsletter_form',
      5,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/simplenews.admin.inc',
  );
  $items['admin/config/services/simplenews/categories/%simplenews_newsletter/delete'] = array(
    'title' => 'Newsletters',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_admin_newsletter_delete',
      5,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/simplenews.admin.inc',
  );
  $items['admin/config/services/simplenews/add'] = array(
    'title' => 'Add newsletter',
    'type' => MENU_LOCAL_ACTION,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_admin_newsletter_form',
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/simplenews.admin.inc',
    'weight' => -9,
  );
  $items['admin/content/simplenews/subscriptions/delete'] = array(
    'title' => 'Delete',
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_subscription_multiple_delete_confirm',
    ),
    'access arguments' => array(
      'administer simplenews subscriptions',
    ),
    'file' => 'includes/simplenews.admin.inc',
  );
  $items['admin/people/simplenews'] = array(
    'title' => 'Newsletter subscriptions',
    'description' => 'Newsletter subscription management.',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_admin_subscription',
    ),
    'access arguments' => array(
      'administer simplenews subscriptions',
    ),
    'file' => 'includes/simplenews.admin.inc',
  );
  $items['admin/people/simplenews/users/edit/%'] = array(
    'title' => 'Subscriptions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_subscriptions_admin_form',
      5,
    ),
    'access arguments' => array(
      'administer simplenews subscriptions',
    ),
    'file' => 'includes/simplenews.subscription.inc',
  );
  $items['admin/people/simplenews/import'] = array(
    'title' => 'Mass subscribe',
    'type' => MENU_LOCAL_ACTION,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_subscription_list_add',
    ),
    'access arguments' => array(
      'administer simplenews subscriptions',
    ),
    'file' => 'includes/simplenews.admin.inc',
    'weight' => 8,
  );
  $items['admin/people/simplenews/unsubscribe'] = array(
    'title' => 'Mass unsubscribe',
    'type' => MENU_LOCAL_ACTION,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_subscription_list_remove',
    ),
    'access arguments' => array(
      'administer simplenews subscriptions',
    ),
    'file' => 'includes/simplenews.admin.inc',
    'weight' => 9,
  );
  $items['admin/people/simplenews/export'] = array(
    'title' => 'Export',
    'type' => MENU_LOCAL_ACTION,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_subscription_list_export',
    ),
    'access arguments' => array(
      'administer simplenews subscriptions',
    ),
    'file' => 'includes/simplenews.admin.inc',
    'weight' => 10,
  );
  $items['admin/config/services/simplenews/settings'] = array(
    'title' => 'Settings',
    'description' => 'Simplenews settings.',
    'page callback' => 'drupal_get_form',
    'weight' => 20,
    'page arguments' => array(
      'simplenews_admin_settings_newsletter',
    ),
    'access arguments' => array(
      'administer simplenews settings',
    ),
    'file' => 'includes/simplenews.admin.inc',
    'file path' => drupal_get_path('module', 'simplenews'),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/services/simplenews/settings/newsletter'] = array(
    'title' => 'Newsletter',
    'weight' => -15,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/services/simplenews/settings/subscription'] = array(
    'title' => 'Subscription',
    'description' => 'Subscription settings, opt-in/out confirmation email text.',
    'page callback' => 'drupal_get_form',
    'weight' => -10,
    'page arguments' => array(
      'simplenews_admin_settings_subscription',
    ),
    'access arguments' => array(
      'administer simplenews settings',
    ),
    'file' => 'includes/simplenews.admin.inc',
    'file path' => drupal_get_path('module', 'simplenews'),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/services/simplenews/settings/mail'] = array(
    'title' => 'Send mail',
    'description' => 'Send mail, cron and debug options.',
    'page callback' => 'drupal_get_form',
    'weight' => -5,
    'page arguments' => array(
      'simplenews_admin_settings_mail',
    ),
    'access arguments' => array(
      'administer simplenews settings',
    ),
    'file' => 'includes/simplenews.admin.inc',
    'file path' => drupal_get_path('module', 'simplenews'),
    'type' => MENU_LOCAL_TASK,
  );

  // Explicitly define add and remove menu routers even if they are are equal
  // to avoid conflicts with the different combined arguments.
  $items['newsletter/confirm/add/%/%/%/%'] = array(
    'title' => 'Confirm newsletter subscriptions',
    'type' => MENU_CALLBACK,
    'page callback' => 'simplenews_confirm_subscription',
    'page arguments' => array(
      2,
      3,
      4,
      5,
      6,
    ),
    'access arguments' => array(
      'subscribe to newsletters',
    ),
    'file' => 'includes/simplenews.subscription.inc',
  );
  $items['newsletter/confirm/remove/%/%/%/%'] = $items['newsletter/confirm/add/%/%/%/%'];
  $items['newsletter/confirm/combined/%/%/%'] = array(
    'title' => 'Confirm newsletter subscriptions',
    'type' => MENU_CALLBACK,
    'page callback' => 'simplenews_confirm_combined',
    'page arguments' => array(
      3,
      4,
      5,
    ),
    'access arguments' => array(
      'subscribe to newsletters',
    ),
    'file' => 'includes/simplenews.subscription.inc',
  );

  // Backwards compatibility for old links.
  $items['newsletter/confirm'] = array(
    'title' => 'Confirm newsletter subscriptions',
    'type' => MENU_CALLBACK,
    'page callback' => 'simplenews_old_confirm_subscription',
    'page arguments' => array(),
    'access arguments' => array(
      'subscribe to newsletters',
    ),
    'file' => 'includes/simplenews.subscription.inc',
  );
  $items['newsletter/subscriptions'] = array(
    'title' => 'Your newsletter subscriptions',
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_subscriptions_page_form',
    ),
    'access arguments' => array(
      'subscribe to newsletters',
    ),
    'file' => 'includes/simplenews.subscription.inc',
  );
  $items['node/%node/simplenews'] = array(
    'title' => 'Newsletter',
    'type' => MENU_LOCAL_TASK,
    'access callback' => 'simplenews_node_tab_access',
    'access arguments' => array(
      1,
    ),
    'page callback' => 'simplenews_node_tab_page',
    'page arguments' => array(
      1,
    ),
    'context' => MENU_LOCAL_TASK,
    'file' => 'includes/simplenews.admin.inc',
    'weight' => 2,
  );
  return $items;
}