You are here

function xmlsitemap_sitemap_delete_form in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap.admin.inc \xmlsitemap_sitemap_delete_form()

Delete form.

1 string reference to 'xmlsitemap_sitemap_delete_form'
xmlsitemap_menu in ./xmlsitemap.module
Implements hook_menu().

File

./xmlsitemap.admin.inc, line 245
Administrative page callbacks for the xmlsitemap module.

Code

function xmlsitemap_sitemap_delete_form(array $form, array &$form_state, stdClass $sitemap) {
  _xmlsitemap_set_breadcrumb();
  $count = (int) db_query("SELECT COUNT(smid) FROM {xmlsitemap_sitemap}")
    ->fetchField();
  if ($count === 1 && empty($_POST)) {
    drupal_set_message(t('It is not recommended to delete the only XML sitemap.'), 'error');
  }
  $form['#sitemap'] = $sitemap;
  $form['smid'] = array(
    '#type' => 'value',
    '#value' => $sitemap->smid,
  );
  return confirm_form($form, t('Are you sure you want to delete the XML sitemap?'), 'admin/config/search/xmlsitemap', '', t('Delete'), t('Cancel'));
}