You are here

function location_handler_argument_location_proximity::options_form in Location 6.3

Same name and namespace in other branches
  1. 7.5 handlers/location_handler_argument_location_proximity.inc \location_handler_argument_location_proximity::options_form()
  2. 7.3 handlers/location_handler_argument_location_proximity.inc \location_handler_argument_location_proximity::options_form()
  3. 7.4 handlers/location_handler_argument_location_proximity.inc \location_handler_argument_location_proximity::options_form()

Add a form elements to select options for this argument.

File

handlers/location_handler_argument_location_proximity.inc, line 25
Location proximity argument handler.

Class

location_handler_argument_location_proximity
Argument handler to accept proximity

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['type'] = array(
    '#title' => t('Coordinate Type'),
    '#type' => 'select',
    '#options' => array(
      'postal' => t('Postal Code (Zipcode)'),
      'latlon' => t('Decimal Latitude and Longitude coordinates, comma delimited'),
    ),
    '#default_value' => $this->options['type'],
    '#description' => t('Type of center point.') . '<br />' . t('Postal code argument format: country_postcode_distance or postcode_distance') . '<br />' . t('Lat/Lon argument format: lat,lon_distance') . '<br />' . t('where distance is either a number or a comma delimited pair of decimal degrees'),
  );

  // Units used.
  $form['search_units'] = array(
    '#type' => 'select',
    '#title' => t('Distance unit'),
    '#options' => array(
      'km' => t('Kilometers'),
      'm' => t('Meters'),
      'mile' => t('Miles'),
      'dd' => t('Decimal degrees'),
    ),
    '#default_value' => $this->options['search_units'],
    '#description' => t('Select the unit of distance. Decimal degrees should be comma delimited.'),
  );
  $form['search_method'] = array(
    '#title' => t('Method'),
    '#type' => 'select',
    '#options' => array(
      'dist' => t('Circular Proximity'),
      'mbr' => t('Rectangular Proximity'),
    ),
    '#default_value' => $this->options['search_method'],
    '#description' => t('Method of determining proximity. Please note that Circular Proximity does not work with Decimal degrees.'),
  );
}