You are here

function wunderground_weather_block_configure_location_fields in Wunderground weather 7

Attach location fields to the block configure forms.

Parameters

array $form: The form array.

string $type: Kind of block to make fields for.

int $block_number: Number of the block to add fields to.

Return value

array Form fields to select a location.

1 call to wunderground_weather_block_configure_location_fields()
wunderground_weather_block_configure in ./wunderground_weather.module
Implements hook_block_configure().

File

./wunderground_weather.module, line 336
Wunderground weather module to display weather forecasts and current weather conditions in blocks.

Code

function wunderground_weather_block_configure_location_fields(&$form, $type, $block_number) {
  $form['location'] = array(
    '#type' => 'fieldset',
    '#title' => t('Location'),
  );

  // Autocomplete to get location.
  $form['location']['wunderground_weather_location_' . $type . '_' . $block_number] = array(
    '#title' => t('Location path'),
    '#type' => 'textfield',
    '#description' => t('Search for your city to determine the Wunderground location path.'),
    '#maxlength' => 120,
    '#required' => TRUE,
    '#autocomplete_path' => 'wunderground-locations',
    '#default_value' => variable_get('wunderground_weather_location_' . $type . '_' . $block_number, ''),
  );
  return $form;
}