You are here

function weather_admin_main_page_form in Weather 7.3

Same name and namespace in other branches
  1. 7 weather.forms.inc \weather_admin_main_page_form()
  2. 7.2 weather.forms.inc \weather_admin_main_page_form()

Construct a form for general settings of the Weather module.

1 string reference to 'weather_admin_main_page_form'
weather_admin_main_page in ./weather.forms.inc
Show an overview of configured displays and the default display.

File

./weather.forms.inc, line 70
Provide forms for configuration of weather displays.

Code

function weather_admin_main_page_form() {

  // Determine the active theme path.
  $theme_path = drupal_get_path('theme', variable_get('theme_default', NULL));
  $form['weather_use_webfont'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use Meteocons webfont instead of images'),
    '#description' => t('You can download and replace the Meteocons font in the "/assets/meteocons" folder with newer version from https://www.alessioatzeni.com/meteocons/'),
    '#default_value' => variable_get('weather_use_webfont', FALSE),
  );
  $form['weather_image_directory'] = array(
    '#type' => 'textfield',
    '#title' => t('Directory for custom images'),
    '#description' => t('Use custom images for displaying weather conditions. The name of this directory can be chosen freely. It will be searched in your active theme (currently %theme_path).', array(
      '%theme_path' => $theme_path,
    )),
    '#default_value' => variable_get('weather_image_directory', ''),
  );
  $form['weather_forecast_days'] = array(
    '#type' => 'select',
    '#title' => t('Number of forecast days'),
    '#description' => t('You can configure the number of days for the forecast displays in blocks.'),
    '#default_value' => variable_get('weather_forecast_days', '2'),
    '#options' => drupal_map_assoc(array(
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12,
      13,
      14,
    )),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}