You are here

function classified_menu in Classified Ads 7.3

Same name and namespace in other branches
  1. 6.3 classified.module \classified_menu()

Implements hook_menu().

File

./classified.module, line 1228
A pure D7 classified ads module inspired by the ed_classified module.

Code

function classified_menu() {
  $items = array();
  $items['admin/config/content/classified'] = array(
    'title' => 'Classified Ads',
    'description' => 'Configure ad size, lifetime, grace period, and format in lists.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'classified_admin_settings',
    ),
    'file' => 'classified.admin.inc',
    'access arguments' => array(
      'administer classified ads',
    ),
  );
  $items['classified'] = array(
    'page callback' => '_classified_page_overview',
    'title' => 'Classified Ads',
    'access arguments' => array(
      'access content',
    ),
  );
  $items['classified/%classified_term'] = array(
    'page callback' => '_classified_page_term',
    'page arguments' => array(
      1,
    ),
    'title callback' => 'filter_admin_format_title',
    'title arguments' => array(
      1,
    ),
    'access arguments' => array(
      'access content',
    ),
  );

  /* classified/scheduled/* are safe operations, which can be run anytime by
   * anyone: they will only run if the time is appropriate, and an early run
   * will reduce load on the scheduled run, so it is actually beneficial
   */
  $items['classified/scheduled'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_goto',
    'page arguments' => array(
      'classified',
    ),
    // See detailed comment above.
    'access callback' => TRUE,
  );
  $items['classified/scheduled/purge'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => '_classified_scheduled_page_purge',
    // Triggering purges by cron is simpler if allowed to any client.
    'access callback' => TRUE,
    'file' => 'classified.scheduled.inc',
  );
  $items['classified/scheduled/expire'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => '_classified_scheduled_page_expire',
    // Triggering expirations by cron is simpler if allowed to any client.
    'access callback' => TRUE,
    'file' => 'classified.scheduled.inc',
  );
  $items['classified/scheduled/notify/%classified_notify_kind'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => '_classified_scheduled_page_notify',
    'page arguments' => array(
      3,
    ),
    // Triggering notifications by cron is simpler if allowed to any client.
    'access callback' => TRUE,
    'file' => 'classified.scheduled.inc',
  );
  $items['user/%user/classified'] = array(
    'title' => 'Ads',
    'type' => MENU_LOCAL_TASK,
    'page callback' => '_classified_page_user_ads',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'user_view_access',
    'access arguments' => array(
      1,
    ),
  );
  return $items;
}