You are here

function patterns_edit_validate in Patterns 7

Same name and namespace in other branches
  1. 5 patterns.module \patterns_edit_validate()
  2. 6.2 patterns.module \patterns_edit_validate()
  3. 6 patterns.module \patterns_edit_validate()
  4. 7.2 includes/forms/editor.inc \patterns_edit_validate()

Form validation handler for patterns_edit_form().

@todo Do this properly.

See also

patterns_edit_submit()

File

includes/forms/editor.inc, line 240
Functions, forms related to the Patterns editor.

Code

function patterns_edit_validate($form, &$form_state) {

  // must be real path
  $path = patterns_path_get_files_dir();
  if (!file_prepare_directory($path, FILE_CREATE_DIRECTORY)) {
    form_set_error('form_token', t('Path @path does not exist or is not writable.', array(
      '@path' => $path,
    )));
  }
}