Commit 8cbbc5b9 authored by Dave Reid's avatar Dave Reid

by Dave Reid: Moved the xmlsitemap_form_submit_flag_regenerate submit handlers...

by Dave Reid: Moved the xmlsitemap_form_submit_flag_regenerate submit handlers to more specific locations.
parent 20b01e96
......@@ -143,6 +143,7 @@ function xmlsitemap_settings_form() {
$form['#validate'][] = 'xmlsitemap_settings_form_validate';
$form['#submit'][] = 'xmlsitemap_settings_form_submit';
array_unshift($form['#submit'], 'xmlsitemap_form_submit_flag_regenerate');
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
$form = system_settings_form($form);
......
......@@ -563,21 +563,6 @@ function xmlsitemap_link_delete_multiple(array $conditions) {
return $query->execute();
}
/**
* Implements hook_form_alter().
*
* Set the regeneration needed flag if settings are changed.
*/
function xmlsitemap_form_alter(&$form, $form_state, $form_id) {
$forms = array(
'locale_languages_overview_form', // Language settings
'xmlsitemap_settings_form', // XML sitemap settings
);
if (in_array($form_id, $forms)) {
array_unshift($form['#submit'], 'xmlsitemap_form_submit_flag_regenerate');
}
}
/**
* Submit handler; Set the regenerate needed flag if variables have changed.
*
......
......@@ -119,3 +119,12 @@ function xmlsitemap_i18n_query_xmlsitemap_alter(QueryAlterableInterface $query)
break;
}
}
/**
* Implements hook_form_FORM_ID_alter().
*
* Set the regeneration needed flag if settings are changed.
*/
function xmlsitemap_form_locale_languages_overview_form_alter(&$form, $form_state) {
array_unshift($form['#submit'], 'xmlsitemap_form_submit_flag_regenerate');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment