You are here

function newsletter_menu in Newsletter 7

Same name and namespace in other branches
  1. 7.2 newsletter.module \newsletter_menu()

Implements hook_menu().

File

./newsletter.module, line 12
Defines menu items for newsletter administration, permissions and basic drupal hooks.

Code

function newsletter_menu() {
  $items = array();
  $items['admin/config/media/newsletter'] = array(
    'title' => 'Newsletters',
    'description' => 'Manage newsletters, subscribers, and settings.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_stats',
    ),
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/stats'] = array(
    'title' => 'Statistics',
    'access arguments' => array(
      'access newsletter statistics',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/media/newsletter/stats/general'] = array(
    'title' => 'General',
    'description' => 'Watch general statistics.',
    'access arguments' => array(
      'access newsletter statistics',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/media/newsletter/stats/graphic'] = array(
    'title' => 'Graphic',
    'description' => 'Watch advanced JQuery statistics.',
    'access arguments' => array(
      'access newsletter statistics',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'newsletter_stats_graphic',
    'file' => 'includes/newsletter.admin.inc',
    'weight' => 1,
  );
  $items['admin/config/media/newsletter/create-send'] = array(
    'title' => 'Create/Send',
    'description' => 'Create custom static newsletters and send non-automated ones',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'newsletter_draft_manual_list',
    'file' => 'includes/newsletter.admin.inc',
    'weight' => 1,
  );
  $items['admin/config/media/newsletter/create-send/draft/%newsletter_newsletter'] = array(
    'title' => 'Send a newsletter draft',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_form_send_draft',
      6,
    ),
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/create-send/draft/delete/%newsletter_newsletter'] = array(
    'title' => 'Delete a newsletter draft',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_form_delete_draft',
      7,
    ),
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/create-send/newsletter/delete/%newsletter_newsletter'] = array(
    'title' => 'Delete a newsletter draft',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_form_delete_newsletter',
      7,
    ),
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/create-send/new'] = array(
    'title' => 'Create and send a custom newsletter',
    'description' => 'Create a custom static newsletter',
    'access arguments' => array(
      'administer newsletters',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_create_send',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/config/media/newsletter/create-send/send/%newsletter_list'] = array(
    'title' => 'Send a manual newsletter',
    'access arguments' => array(
      'administer newsletters',
    ),
    'page callback' => 'newsletter_manual_send',
    'page arguments' => array(
      6,
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/media/newsletter/lists'] = array(
    'title' => 'Lists',
    'description' => 'Find and manage newsletter lists.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_list',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items['admin/config/media/newsletter/subscribers'] = array(
    'title' => 'Subscribers',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_subscriber_list',
    ),
    'description' => 'List subscribers.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'includes/newsletter.admin.inc',
    'weight' => 3,
  );
  $items['admin/config/media/newsletter/lists/add'] = array(
    'title' => 'Add new list',
    'page callback' => 'newsletter_list_add',
    'description' => 'Add new newsletter list.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/subscribers/add'] = array(
    'title' => 'Add new subscriber',
    'page callback' => 'newsletter_subscriber_add',
    'description' => 'Add new list subscriber.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/subscribers/add-mass'] = array(
    'title' => 'Add subscribers (Mass)',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_subscriber_add_mass',
    ),
    'description' => 'Add subscribers.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/lists/delete/%newsletter_list'] = array(
    'title' => 'Delete newsletter list',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_list_delete',
      6,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/lists/edit/%newsletter_list'] = array(
    'title' => 'Edit newsletter list',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_list_edit',
      6,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/media/newsletter/subscribers/edit/%newsletter_subscriber'] = array(
    'title' => 'Edit newsletter subscriber',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_subscriber_edit',
      6,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/media/newsletter/subscribers/delete/%newsletter_subscriber'] = array(
    'title' => 'Delete subscriber',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_subscriber_delete',
      6,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/media/newsletter/templates'] = array(
    'title' => 'Templates',
    'description' => 'Administer newsletter templates.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_template_list',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'weight' => 4,
  );
  $items['admin/config/media/newsletter/templates/mail'] = array(
    'title' => 'Mail templates',
    'description' => 'Administer mail templates.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/media/newsletter/templates/mail/add'] = array(
    'title' => 'Add new mail template',
    'description' => 'Administer mail templates.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_ACTION,
    'page callback' => 'newsletter_template_add',
    'file' => 'includes/newsletter.admin.inc',
  );
  $items['admin/config/media/newsletter/templates/delete/%newsletter_template'] = array(
    'title' => 'Delete newsletter templates',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_template_delete',
      6,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/media/newsletter/templates/edit/%newsletter_template'] = array(
    'title' => 'Edit newsletter templates',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_template_edit',
      6,
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/media/newsletter/templates/confirmation'] = array(
    'title' => 'Confirmation',
    'description' => 'Edit confirmation template.',
    'page callback' => 'newsletter_basic_template_edit',
    'page arguments' => array(
      '1',
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
  );
  $items['admin/config/media/newsletter/templates/welcome'] = array(
    'title' => 'Welcome',
    'description' => 'Edit welcome template.',
    'page callback' => 'newsletter_basic_template_edit',
    'page arguments' => array(
      '2',
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -8,
  );
  $items['admin/config/media/newsletter/templates/unsubscribe'] = array(
    'title' => 'Unsubscribe',
    'description' => 'Edit unsubscribe template.',
    'page callback' => 'newsletter_basic_template_edit',
    'page arguments' => array(
      '3',
    ),
    'access arguments' => array(
      'administer newsletters',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -7,
  );
  $items['admin/config/media/newsletter/configure'] = array(
    'title' => 'Settings',
    'description' => 'Configure newsletter lists.',
    'access arguments' => array(
      'administer newsletters',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_configure',
    ),
    'file' => 'includes/newsletter.admin.inc',
    'weight' => 5,
  );
  $items['newsletter/subscribe'] = array(
    'title' => 'Subscribe',
    'description' => 'Subscribe to our newsletters.',
    'access arguments' => array(
      'subscribe newsletters',
    ),
    'page arguments' => array(
      'newsletter_manage_subscriptions_form',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'file' => 'includes/newsletter.pages.inc',
  );
  $items['newsletter/confirm/%newsletter_subscriber_by_hash'] = array(
    'title' => 'Confirm subscription',
    'description' => 'Confirm your subscription to our newsletters.',
    'access arguments' => array(
      'subscribe newsletters',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'newsletter_confirm',
    'page arguments' => array(
      2,
    ),
    'file' => 'includes/newsletter.pages.inc',
  );
  $items['newsletter/unsubscribe/%newsletter_subscriber_by_hash'] = array(
    'title' => 'Unsubscribe',
    'description' => 'Confirm that you want to unsubscribe from our newsletters.',
    'access arguments' => array(
      'subscribe newsletters',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_unsubscribe',
      2,
    ),
    'file' => 'includes/newsletter.pages.inc',
  );
  $items['newsletter/statistics/%newsletter_subscriber_by_hash'] = array(
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'newsletter_statistics_open',
    'page arguments' => array(
      2,
    ),
    'file' => 'includes/newsletter.pages.inc',
  );
  $items['newsletter/edit/%newsletter_subscriber_by_hash'] = array(
    'title' => 'Edit newsletter subscriptions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_manage_subscriptions_form',
      2,
    ),
    'access callback' => TRUE,
    'type' => MENU_LOCAL_TASK,
    'file' => 'includes/newsletter.pages.inc',
  );
  $items['user/%user/newsletter'] = array(
    'title' => 'Newsletter subscriptions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'newsletter_manage_subscriptions_form',
      1,
    ),
    'access callback' => 'newsletter_edit_subsdcriber_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'includes/newsletter.pages.inc',
  );
  return $items;
}