You are here

function simplenews_statistics_menu in Simplenews Statistics 7

Same name and namespace in other branches
  1. 6.3 simplenews_statistics.module \simplenews_statistics_menu()
  2. 6 simplenews_statistics.module \simplenews_statistics_menu()
  3. 6.2 simplenews_statistics.module \simplenews_statistics_menu()
  4. 7.2 simplenews_statistics.module \simplenews_statistics_menu()

Implements hook_menu().

File

./simplenews_statistics.module, line 15
Main simplenews statistics file.

Code

function simplenews_statistics_menu() {

  // Admin.
  $items['admin/config/services/simplenews/statistics'] = array(
    'title' => 'Statistics',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'simplenews_statistics_admin_settings_form',
    ),
    'access arguments' => array(
      'administer newsletter statistics',
    ),
    'file' => 'includes/simplenews_statistics.admin.inc',
  );
  $items['admin/config/services/simplenews/statistics/settings'] = array(
    'title' => 'Settings',
    'weight' => -15,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

  // Statistics.
  $items['admin/content/simplenews/newsletters'] = array(
    'title' => 'Newsletters',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    // Default tab for content overview.
    'weight' => -1,
  );
  $items['node/%node/simplenews_statistics'] = array(
    'title' => 'Statistics',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'simplenews_statistics_embed_view',
    'page arguments' => array(
      'simplenews_statistics_overview',
      'page',
    ),
    'access arguments' => array(
      'view newsletter statistics',
      1,
    ),
    'access callback' => 'simplenews_statistics_node_tab_access',
    'file' => 'includes/simplenews_statistics.pages.inc',
    'weight' => 1,
  );

  // Tracking.
  $items['track/open/%/%'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'simplenews_statistics_open_page',
    'page arguments' => array(
      2,
      3,
    ),
    'access arguments' => array(
      'access content',
    ),
    'file' => 'includes/simplenews_statistics.pages.inc',
  );
  $items['track/click/%/%'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'simplenews_statistics_click_page',
    'page arguments' => array(
      2,
      3,
    ),
    'access arguments' => array(
      'access content',
    ),
    'file' => 'includes/simplenews_statistics.pages.inc',
  );
  return $items;
}