You are here

function getdirections_menu in Get Directions 7.3

Same name and namespace in other branches
  1. 6.2 getdirections.module \getdirections_menu()
  2. 6 getdirections.module \getdirections_menu()
  3. 7.2 getdirections.module \getdirections_menu()

Implement hook_menu().

File

./getdirections.module, line 60
Fetches google map directions.

Code

function getdirections_menu() {
  $items = array();
  $items['admin/config/services/getdirections'] = array(
    'title' => 'Get directions',
    'description' => 'Configure Get directions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'getdirections_settings_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'getdirections.admin.inc',
  );
  $items['getdirections'] = array(
    'title' => 'Get directions',
    'description' => 'Get directions on a map',
    'access arguments' => array(
      'access gmap getdirections',
    ),
    'page callback' => 'getdirections_direction',
    'type' => MENU_SUGGESTED_ITEM,
  );

  // location enabled
  $items['getdirections/location/%getdirections_fromto/%getdirections_id'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_location',
    'page callback' => 'getdirections_node_setlocation',
    'page arguments' => array(
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/locations/%getdirections_id/%getdirections_id'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_location',
    'page callback' => 'getdirections_node_setlocations',
    'page arguments' => array(
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/locations_via/%getdirections_via'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_location',
    'page callback' => 'getdirections_node_setlocations_via',
    'page arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/location_user/%getdirections_fromto/%getdirections_uid'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_user_location',
    'page callback' => 'getdirections_user_setlocation',
    'page arguments' => array(
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/locations_user/%getdirections_uid/%getdirections_uid'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_user_location',
    'page callback' => 'getdirections_user_setlocations',
    'page arguments' => array(
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/location_n2u/%getdirections_id/%getdirections_uid'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_user_location',
    'page callback' => 'getdirections_n2u_setlocation',
    'page arguments' => array(
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/location_u2n/%getdirections_uid/%getdirections_id'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_user_location',
    'page callback' => 'getdirections_u2n_setlocation',
    'page arguments' => array(
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/locations_user_via/%getdirections_via'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_location',
    'page callback' => 'getdirections_user_setlocations_via',
    'page arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/latlon/%getdirections_fromto/%getdirections_latlon/%'] = array(
    'title' => 'Get directions',
    'access arguments' => array(
      'access gmap getdirections',
    ),
    'page callback' => 'getdirections_latlon',
    'page arguments' => array(
      2,
      3,
      4,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/latlons/%'] = array(
    'title' => 'Get directions',
    'access arguments' => array(
      'access gmap getdirections',
    ),
    'page callback' => 'getdirections_latlons',
    'page arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/location_id/%getdirections_fromto/%getdirections_id'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_location',
    'page callback' => 'getdirections_setlocation_id',
    'page arguments' => array(
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  if (getdirections_get_vocabularies()) {

    // taxonomy_term
    $items['getdirections/location_term/%getdirections_fromto/%getdirections_id'] = array(
      'title' => 'Get directions',
      'access callback' => 'getdirections_access_location',
      'page callback' => 'getdirections_term_setlocation',
      'page arguments' => array(
        2,
        3,
      ),
      'type' => MENU_CALLBACK,
    );
  }
  if (getdirections_check_entity_type('comment')) {

    // comment
    $items['getdirections/location_comment/%getdirections_fromto/%getdirections_id'] = array(
      'title' => 'Get directions',
      'access callback' => 'getdirections_access_location',
      'page callback' => 'getdirections_comment_setlocation',
      'page arguments' => array(
        2,
        3,
      ),
      'type' => MENU_CALLBACK,
    );
  }
  $items['getdirections/%getdirections_entity_type/%getdirections_fromto/%getdirections_id'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_location',
    'page callback' => 'getdirections_entity_setlocation',
    'page arguments' => array(
      1,
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections/%getdirections_entity_type/%getdirections_id/%getdirections_entity_type/%getdirections_id'] = array(
    'title' => 'Get directions',
    'access callback' => 'getdirections_access_location',
    'page callback' => 'getdirections_entity_setlocations',
    'page arguments' => array(
      1,
      2,
      3,
      4,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getdirections_box'] = array(
    'title' => 'Get directions',
    'access arguments' => array(
      'access gmap getdirections',
    ),
    'page callback' => 'getdirections_direction_box',
    'type' => MENU_CALLBACK,
  );
  if (module_exists('date_popup')) {
    $items['getdirections/getdirections_get_datestamp'] = array(
      'access arguments' => array(
        'access gmap getdirections',
      ),
      'page callback' => 'getdirections_get_datestamp',
      'type' => MENU_CALLBACK,
    );
  }
  if (module_exists('smart_ip')) {
    $items['getdirections/smart_ip'] = array(
      'page callback' => 'getdirections_smart_ip',
      'access arguments' => array(
        'access content',
      ),
      'type' => MENU_CALLBACK,
    );
  }
  if (module_exists('ip_geoloc')) {
    $items['getdirections/ip_geoloc'] = array(
      'page callback' => 'getdirections_ip_geoloc',
      'access arguments' => array(
        'access content',
      ),
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}