function xmlsitemap_sitemap_list_form_submit in XML sitemap 6.2
Same name and namespace in other branches
- 7.2 xmlsitemap.admin.inc \xmlsitemap_sitemap_list_form_submit()
Process xmlsitemap_sitemap_list_form submissions.
Execute the chosen 'Update option' on the selected sitemaps.
File
- ./
xmlsitemap.admin.inc, line 149 - Administrative page callbacks for the xmlsitemap module.
Code
function xmlsitemap_sitemap_list_form_submit($form, &$form_state) {
$operation = $form['#operations'][$form_state['values']['operation']];
// Filter out unchecked sitemaps.
$sitemaps = array_filter($form_state['values']['sitemaps']);
if (!empty($operation['confirm']) && empty($form_state['values']['confirm'])) {
// We need to rebuild the form to go to a second step. For example, to
// show the confirmation form for the deletion of redirects.
$form_state['rebuild'] = TRUE;
}
else {
$function = $operation['callback'];
// Add in callback arguments if present.
if (isset($operation['callback arguments'])) {
$args = array_merge(array(
$sitemaps,
), $operation['callback arguments']);
}
else {
$args = array(
$sitemaps,
);
}
call_user_func_array($function, $args);
$count = count($form_state['values']['sitemaps']);
//watchdog('xmlsitemap', '@action @count XML sitemaps.', array('@action' => $operation['action past'], '@count' => $count));
drupal_set_message(format_plural(count($sitemaps), '@action @count XML sitemap.', '@action @count XML sitemaps.', array(
'@action' => $operation['action past'],
'@count' => $count,
)));
//$form_state['redirect'] = 'admin/settings/xmlsitemap';
}
}