You are here

function weather_admin_main_page_form_submit in Weather 7

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

Handle the submission for general settings of the Weather module

File

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

Code

function weather_admin_main_page_form_submit($form, &$form_state) {
  $directory = $form_state['values']['weather_image_directory'];

  // Remove whitespace and directory separators from the string.
  $directory = trim(trim($directory, '/\\'));

  // Replace Windows-style directory separators with Unix separators
  $directory = implode('/', explode('\\', $directory));
  variable_set('weather_image_directory', $directory);
  drupal_set_message(t('The configuration has been saved.'));
}