You are here

function antispam_menu in AntiSpam 6

Same name and namespace in other branches
  1. 7 antispam.module \antispam_menu()

Implementation of hook_menu().

File

./antispam.module, line 435

Code

function antispam_menu() {
  $items = array();
  $items['admin/settings/antispam'] = array(
    'title' => t('AntiSpam'),
    'description' => t('Use the anti-spam service to protect your site from spam.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'antispam_settings',
    ),
    'access arguments' => array(
      'administer antispam settings',
    ),
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam'] = array(
    'title' => t('AntiSpam moderation queue'),
    'description' => t('Manage the AntiSpam spam queue, appropving or deleting content in need of moderation.'),
    'page callback' => 'antispam_callback_queue',
    'access callback' => '_antispam_is_moderator',
    'access arguments' => array(
      $moderator_types,
    ),
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/overview'] = array(
    'title' => t('Overview'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/nodes'] = array(
    'title' => t('Nodes'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'nodes',
    ),
    'access callback' => '_antispam_is_node_moderator',
    'access arguments' => array(
      $moderator_types,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/nodes/spam'] = array(
    'title' => t('Spam'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'nodes',
    ),
    'access callback' => '_antispam_is_node_moderator',
    'access arguments' => array(
      $moderator_types,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/nodes/unpublished'] = array(
    'title' => t('Unpublished nodes'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'nodes',
      'unpublished',
    ),
    'access callback' => '_antispam_is_node_moderator',
    'access arguments' => array(
      $moderator_types,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/nodes/published'] = array(
    'title' => t('Published nodes'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'nodes',
      'published',
    ),
    'access callback' => '_antispam_is_node_moderator',
    'access arguments' => array(
      $moderator_types,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/comments'] = array(
    'title' => t('Comments'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'comments',
    ),
    'access callback' => '_antispam_is_moderator',
    'access arguments' => array(
      $moderator_types,
      'comments',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/comments/spam'] = array(
    'title' => t('Spam'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'comments',
    ),
    'access callback' => '_antispam_is_moderator',
    'access arguments' => array(
      $moderator_types,
      'comments',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/comments/unpublished'] = array(
    'title' => t('Unpublished comments'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'comments',
      'unpublished',
    ),
    'access callback' => '_antispam_is_moderator',
    'access arguments' => array(
      $moderator_types,
      'comments',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/comments/published'] = array(
    'title' => t('Published comments'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'comments',
      'published',
    ),
    'access callback' => '_antispam_is_moderator',
    'access arguments' => array(
      $moderator_types,
      'comments',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
    'file' => 'antispam.admin.inc',
  );
  $items['admin/content/antispam/statistics'] = array(
    'title' => t('Statistics'),
    'page callback' => 'antispam_callback_queue',
    'page arguments' => array(
      'statistics',
    ),
    'access callback' => '_antispam_is_moderator',
    'access arguments' => array(
      $moderator_types,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
    'file' => 'antispam.admin.inc',
  );
  $item = array(
    'title' => 'switch content status',
    'page callback' => 'antispam_page',
    'page arguments' => array(
      0,
      1,
      2,
      3,
    ),
    'load arguments' => array(
      '%map',
      '%index',
    ),
    'access callback' => 'antispam_access_callback',
    'access arguments' => array(
      0,
      1,
      2,
      3,
    ),
  );
  foreach (array(
    'publish',
    'unpublish',
    'submit-spam',
    'submit-ham',
  ) as $op) {
    $items['antispam/%antispam/%/' . $op] = $item;
  }
  return $items;
}