You are here

function getlocations_element_dd in Get Locations 7.2

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

Parameters

string $default:

string $title:

array $options:

string $description:

bool $multiple:

int $weight:

Return value

Returns form element

25 calls to getlocations_element_dd()
getlocations_cloudmade_settings_form in modules/getlocations_cloudmade/getlocations_cloudmade.module
getlocations_fields_display_settings_form in modules/getlocations_fields/getlocations_fields.module
display settings form for sharing
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_fields_input_settings_form in modules/getlocations_fields/getlocations_fields.module
input settings form for sharing
getlocations_fields_settings_form in modules/getlocations_fields/getlocations_fields.admin.inc
Function to display the getlocations admin settings form

... See full list

File

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

Code

function getlocations_element_dd($title, $default, $options, $description = '', $multiple = FALSE, $weight = '') {
  $element = array(
    '#type' => 'select',
    '#title' => $title,
    '#default_value' => $default,
    '#options' => $options,
  );
  if ($description) {
    $element['#description'] = $description;
  }
  if ($multiple) {
    $element['#multiple'] = TRUE;
    $element['#size'] = min(12, count($options));
  }
  if (is_numeric($weight)) {
    $element['#weight'] = $weight;
  }
  return $element;
}