function _google_image_sitemap_create_form_submit in Google Image Sitemap 7
Same name and namespace in other branches
- 6 google_image_sitemap.module \_google_image_sitemap_create_form_submit()
Form submission handler for _google_image_sitemap_create_form().
File
- ./
google_image_sitemap.module, line 236 - A module gives to Google information about images on your site.
Code
function _google_image_sitemap_create_form_submit($form, &$form_state) {
$sitemap_obj = (object) $form_state['values'];
// Check for sitemap_id sign.
if (isset($form_state['storage']['sitemap_id']) && is_numeric($form_state['storage']['sitemap_id'])) {
// Update if set.
$sitemap_obj->sid = $form_state['storage']['sitemap_id'];
drupal_write_record('google_image_sitemap', $sitemap_obj, 'sid');
}
else {
// Insert if not set.
$sitemap_obj->created = REQUEST_TIME;
drupal_write_record('google_image_sitemap', $sitemap_obj);
}
// Redirect to main page of sitemap.
$form_state['redirect'] = isset($_GET['destination']) ? $_GET['destination'] : GOOGLE_IMAGE_SITEMAP_ADMIN_PATH;
}