You are here

function notifications_custom_form_validate in Notifications 6

Same name and namespace in other branches
  1. 6.4 notifications_custom/notifications_custom.admin.inc \notifications_custom_form_validate()

Validate subscription type. Just check for 'type' duplicates

File

notifications_custom/notifications_custom.admin.inc, line 129

Code

function notifications_custom_form_validate($form, &$form_state) {
  if (empty($form_state['values']['subscription']['csid'])) {
    if (notifications_custom_load($form_state['values']['subscription']['newtype'])) {
      form_set_error('newtype', t('Duplicate subscription type. You need to select a unique string for it.'));
    }
    else {
      $form_state['values']['subscription']['type'] = $form_state['values']['subscription']['newtype'];
    }
  }
}