function _google_image_sitemap_delete_form in Google Image Sitemap 6
Same name and namespace in other branches
- 7 google_image_sitemap.module \_google_image_sitemap_delete_form()
This will delete a sitemap of user.
1 string reference to '_google_image_sitemap_delete_form'
- google_image_sitemap_menu in ./
google_image_sitemap.module - Implements hook_menu().
File
- ./
google_image_sitemap.module, line 247 - A module gives to Google information about images on your site.
Code
function _google_image_sitemap_delete_form($sitemap_id) {
// Validate sitemap_id string.
if (!empty($sitemap_id) && ($sitemap_obj = _google_image_sitemap_valid_sitemap_id($sitemap_id))) {
$uri = variable_get('file_directory_path', conf_path() . '/files') . '/google_image_sitemap/sitemap_' . $sitemap_obj->created . '.xml';
if (file_exists($uri)) {
file_delete($uri);
}
db_query('DELETE FROM {google_image_sitemap} WHERE sid = %d', $sitemap_id);
drupal_set_message(t("Sitemap deleted successfully!"));
}
drupal_goto(isset($_GET['destination']) ? $_GET['destination'] : GOOGLE_IMAGE_SITEMAP_ADMIN_PATH);
}