You are here

function spaces_preset_form_validate in Spaces 5.2

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

Validation for the preset form.

File

./spaces_admin.inc, line 276

Code

function spaces_preset_form_validate($form_id, $form_values) {
  $space = $form_values['space'];

  // Validate preset info
  if ($form_values['preset']['id'] && !preg_match('!^[a-z0-9_-]+$!', $form_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_id, $form_values);

  // Allow the space type to run its own validations
  $space
    ->validate($form_values);
}