You are here

function spaces_preset_form_validate in Spaces 6.2

Same name and namespace in other branches
  1. 5.2 spaces_admin.inc \spaces_preset_form_validate()
  2. 6 spaces_admin.inc \spaces_preset_form_validate()

Validation for the preset form.

File

./spaces_admin.inc, line 218

Code

function spaces_preset_form_validate($form, &$form_state) {
  $space = $form_state['values']['space'];

  // Validate preset info
  if ($form_state['values']['preset']['id'] && !preg_match('!^[a-z0-9_-]+$!', $form_state['values']['preset']['id'])) {
    form_set_error('preset][id', t('The preset name may only contain lowercase letters, numbers, underscores or dashes.'));
  }

  // Validate the features form
  spaces_features_form_validate($form, $form_state);

  // Allow the space type to run its own validations
  $space
    ->validate($form_state['values']);
}