You are here

function custom_pub_edit_validate in Custom Publishing Options 6

Same name and namespace in other branches
  1. 7 custom_pub.admin.inc \custom_pub_edit_validate()

Form validate function for edit form.

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

File

./custom_pub.module, line 246
Adds the ability to add Custom publishing options to the node Add/Edit form.

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 (check_plain($type['name']) == $check['name'] && $type['type'] != $check['type']) {
      form_set_error('state', t("Invalid Label. That Publishing Label is already taken. Please enter a label other than %invalid.", array(
        '%invalid' => $type['name'],
      )));
    }
  }
}