function weather_main_page_form_submit in Weather 6.5
Same name and namespace in other branches
- 5.6 weather.module \weather_main_page_form_submit()
Handle the submission for general settings of the Weather module
File
- ./
weather.module, line 686 - Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world
Code
function weather_main_page_form_submit($form, &$form_state) {
variable_set('weather_use_cron', $form_state['values']['use_cron']);
$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.'));
}