You are here

function access_unpublished_url_param_form_validate in Access unpublished 7

Form validation handler for access_unpublished_url_param_form().

Pass only ASCII characters. At least one display option must be checked.

File

./access_unpublished.admin.inc, line 52
Admin page callbacks for Access unpublished.

Code

function access_unpublished_url_param_form_validate($form, &$form_state) {
  $access_unpublished_url_key = $form_state['values']['access_unpublished_url_key'];
  if (preg_match('/^[a-zA-Z0-9]+$/', $access_unpublished_url_key) != 1) {
    form_set_error('access_unpublished_url_key', t('Only ASCII characters can be used as URL key'));
  }
  if (!$form_state['values']['access_unpublished_display_link_in_drupal_message'] && !$form_state['values']['access_unpublished_display_link_in_node_content']) {
    form_set_error('access_unpublished_display_link', t('At least one display option must be checked.'));
  }
}