filter_admin_format_form_validate

Definition

filter_admin_format_form_validate($form_id, $form_values)
modules/filter/filter.module, line 470

Description

Validate filter format form submissions.

Code

<?php
function filter_admin_format_form_validate($form_id, $form_values) {
  if (!isset($form_values['format'])) {
    $name = trim($form_values['name']);
    $result = db_fetch_object(db_query("SELECT format FROM {filter_formats} WHERE name='%s'", $name));
    if ($result) {
      form_set_error('name', t('Filter format names need to be unique. A format named %name already exists.', array('%name' => $name)));
    }
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.