You are here

function custom_pub_edit_validate in Custom Publishing Options 7

Same name and namespace in other branches
  1. 6 custom_pub.module \custom_pub_edit_validate()

Validate handler

_state

Parameters

$form:

1 string reference to 'custom_pub_edit_validate'
custom_pub_edit in ./custom_pub.admin.inc
Form callback function for the edit form.

File

./custom_pub.admin.inc, line 228
Admin functions.

Code

function custom_pub_edit_validate($form, &$form_state) {
  $types = variable_get('custom_pub_types', array());
  $type = $form_state['values']['type'];
  $name = trim($form_state['values']['state']);
  foreach ($types as $check) {
    if ($type['name'] == $check['name'] && $type['type'] != $check['type']) {
      form_set_error('state', t("Invalid Label. The publishing label is already taken. Please enter a label other than %invalid.", array(
        '%invalid' => $type['name'],
      )));
    }
  }
}