You are here

function patterns_edit_validate in Patterns 5

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

Validate pattern modifications (make sure proper XML)

File

./patterns.module, line 439
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_edit_validate($form_id, $form_values) {

  // Do validations....
  $path = file_create_path(variable_get('patterns_save_xml', 'patterns'));
  if (!file_check_directory($path, true)) {
    form_set_error('form_token', t('Unable to create @path to save the new pattern to.', array(
      '@path' => $path,
    )));
  }
}