You are here

function getlocations_menu in Get Locations 7.2

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_menu()
  2. 6 getlocations.module \getlocations_menu()
  3. 7 getlocations.module \getlocations_menu()

Implements hook_menu().

File

./getlocations.module, line 82
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_menu() {
  $items = array();
  $items[GETLOCATIONS_ADMIN_PATH] = array(
    'title' => 'Getlocations',
    'description' => 'Configure Getlocations',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'getlocations_settings_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'getlocations.admin.inc',
  );
  $items[GETLOCATIONS_ADMIN_PATH . '/base'] = array(
    'title' => 'Base',
    'description' => 'Getlocations base configuration',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'getlocations_settings_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'getlocations.admin.inc',
    'weight' => 1,
  );
  if (getlocations_check_entity_type('user') || getlocations_check_entity_type('profile2')) {

    // getlocations/users    # show all locations for all users
    $items['getlocations/users'] = array(
      'title' => 'View all user locations',
      'access callback' => 'getlocations_access_user_location',
      'page callback' => 'getlocations_usersmap',
      'type' => MENU_CALLBACK,
    );
  }

  #  // getlocations/type/$type     # show all locations of nodes of content-type machine name

  #  $items['getlocations/type/%getlocations_type'] = array(

  #    'title' => 'Get locations',

  #    'access callback' => 'getlocations_access_location',

  #    'page callback' => 'getlocations_typemap',

  #    'page arguments' => array(2, 3, 4),

  #    'type' => MENU_CALLBACK,

  #  );

  // getlocations/lids/1,2,3,4    # show lids
  $items['getlocations/lids/%getlocations_cdints'] = array(
    'title' => 'Get locations',
    'access callback' => 'getlocations_access_location',
    'page callback' => 'getlocations_lids',
    'page arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );

  // getlocations/nids/1,2,3,4    # show nids locations
  $items['getlocations/nids/%getlocations_cdints'] = array(
    'title' => 'Get locations',
    'access callback' => 'getlocations_access_location',
    'page callback' => 'getlocations_nids',
    'page arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getlocations/%getlocations_entity_type/%getlocations_id'] = array(
    'title' => 'Get locations',
    'access callback' => 'getlocations_access_location',
    'page callback' => 'getlocations_entity_type_map',
    'page arguments' => array(
      1,
      2,
    ),
    'type' => MENU_CALLBACK,
  );

  // ajax callbacks
  // getlocations/info?lid     # ajax callback to fetch an address
  $items['getlocations_cb/info'] = array(
    'page callback' => 'getlocations_adinfo',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );

  // getlocations/lidinfo?lid    # ajax callback to fetch a link to the 'owner'
  $items['getlocations_cb/lidinfo'] = array(
    'page callback' => 'getlocations_lidinfo',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['getlocations_box'] = array(
    'title' => 'Get locations',
    'access arguments' => array(
      'access getlocations',
    ),
    'page callback' => 'getlocations_box',
    'type' => MENU_CALLBACK,
  );
  $items['getlocations/markerinfo'] = array(
    'access callback' => TRUE,
    'page callback' => 'getlocations_markerinfo',
    'type' => MENU_CALLBACK,
  );
  $items['getlocations/cb_w3w'] = array(
    'access callback' => TRUE,
    'page callback' => 'getlocations_cb_w3w',
    'type' => MENU_CALLBACK,
  );
  return $items;
}