You are here

function getlocations_element_distance_unit in Get Locations 7

Same name and namespace in other branches
  1. 7.2 getlocations.module \getlocations_element_distance_unit()

Parameters

string $default:

string $title:

string $description:

Return value

Returns form element

5 calls to getlocations_element_distance_unit()
getlocations_fields_handler_argument_distance::options_form in modules/getlocations_fields/handlers/getlocations_fields_handler_argument_distance.inc
Add a form elements to select options for this argument.
getlocations_fields_handler_field_distance::extra_options_form in modules/getlocations_fields/handlers/getlocations_fields_handler_field_distance.inc
Provide a form for setting options.
getlocations_fields_handler_filter_distance::value_form in modules/getlocations_fields/handlers/getlocations_fields_handler_filter_distance.inc
Options form subform for setting options.
getlocations_search_form in modules/getlocations_search/getlocations_search.module
The search form
_getlocations_search_settings_form in modules/getlocations_search/getlocations_search.admin.inc

File

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

Code

function getlocations_element_distance_unit($default, $title = '', $description = '') {
  if (empty($title)) {
    $title = t('Units');
  }
  $units = getlocations_get_unit_names();
  $element = array(
    '#type' => 'select',
    '#title' => $title,
    '#options' => $units,
    '#default_value' => $default,
  );
  if (!empty($description)) {
    $element['#description'] = $description;
  }
  return $element;
}