You are here

function weather_main_page_form in Weather 6.5

Same name and namespace in other branches
  1. 5.6 weather.module \weather_main_page_form()

Construct a form for general settings of the Weather module

1 string reference to 'weather_main_page_form'
weather_admin_main_page in ./weather.module
Show an overview of configured locations and the default location

File

./weather.module, line 660
Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world

Code

function weather_main_page_form() {
  $form['use_cron'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use cron to clear the cache once per hour'),
    '#description' => t('If you use Drupal\'s cache, the system weather blocks will not be updated for anonymous users unless the cache is cleared. This happens e.g. when new nodes are created. If you want the system weather blocks to be updated when new weather data is available, you can clear the cache once per hour. Please note that this might slow down your site.'),
    '#default_value' => variable_get('weather_use_cron', FALSE),
  );
  $form['weather_image_directory'] = array(
    '#type' => 'textfield',
    '#title' => t('Directory for custom images'),
    '#description' => t('Override the default image directory. This directory must be a subdirectory of the Drupal \'files\' path.'),
    '#default_value' => variable_get('weather_image_directory', ''),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}