You are here

function getlocations_blocks_city_form in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_blocks/getlocations_blocks.module \getlocations_blocks_city_form()

Parameters

array $form:

array $form_state:

Return value

array the form

1 string reference to 'getlocations_blocks_city_form'
getlocations_blocks_contents in modules/getlocations_blocks/getlocations_blocks.module
A module-defined block content function.

File

modules/getlocations_blocks/getlocations_blocks.module, line 561
getlocations_blocks.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_blocks_city_form($form, &$form_state) {
  $settings = getlocations_blocks_get_var();
  if ($settings['city_element'] == 'dropdown') {
    $options = getlocations_blocks_city_get();
    $form['getlocations_blocks_city'] = array(
      '#type' => 'select',
      '#title' => t('City'),
      '#options' => $options,
    );
  }
  else {
    $form['getlocations_blocks_city'] = array(
      '#type' => 'textfield',
      '#title' => t('City'),
      '#maxlength' => 255,
      '#size' => 20,
      '#autocomplete_path' => 'getlocations_blocks/city_autocomplete',
    );
  }
  $form['getlocations_blocks_city_form_submit'] = array(
    '#type' => 'submit',
    '#value' => t('Go'),
  );
  $form += getlocations_blocks_get_attached_elements();
  return $form;
}