You are here

function getlocations_element_dd in Get Locations 6

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_element_dd()
  2. 7.2 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

1 call to getlocations_element_dd()
getlocations_map_display_options_form in ./getlocations.module

File

./getlocations.module, line 1480
Displays locations on a map. for Drupal 6 using version 3 googlemaps API

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;
}