You are here

function xmlsitemap_sitemap_edit_form_validate in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap.admin.inc \xmlsitemap_sitemap_edit_form_validate()

File

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

Code

function xmlsitemap_sitemap_edit_form_validate($form, &$form_state) {

  // If there are no context options, the $form_state['values']['context']
  // disappears.
  $form_state['values'] += array(
    'context' => array(),
  );
  $existing = xmlsitemap_sitemap_load_by_context($form_state['values']['context']);
  if ($existing && $existing->smid != $form_state['values']['smid']) {
    form_set_error('context', t('A sitemap with the same context already exists.'));
  }
}