You are here

function video_preset_import_validate in Video 7.2

Same name and namespace in other branches
  1. 7 modules/video_ui/video.preset.inc \video_preset_import_validate()

Validation for the preset import form.

1 string reference to 'video_preset_import_validate'
video_preset_import_form in modules/video_ui/video.preset.inc
Imports a preset.

File

modules/video_ui/video.preset.inc, line 768
Administrative interface for maintaining video presets.

Code

function video_preset_import_validate($form, &$form_state) {
  $preset = '';

  // Get the preset that they declared in the text field.
  ob_start();
  eval($form_state['values']['preset']);
  ob_end_clean();
  if (is_array($preset)) {
    $name = isset($preset['name']) ? $preset['name'] : '';
    if ($error = video_validate_preset_name($name)) {
      form_set_error('name', $error);
    }
  }
  else {
    form_set_error('name', 'Invalid preset import.');
  }
  $form_state['preset'] =& $preset;
}