You are here

function _patterns_io_import_validate_content in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/io/import.inc \_patterns_io_import_validate_content()
1 call to _patterns_io_import_validate_content()
patterns_io_import_file in includes/io/import.inc

File

includes/io/import.inc, line 27
Importing Patterns from a file or using an URL.

Code

function _patterns_io_import_validate_content($pattern, $level) {
  $patternscan = patterns_scan_pattern($pattern);
  if (!_patterns_scan_validate_patternscan($patternscan, false, $level)) {
    $errors_on_scan = _patterns_scan_analyze_patternscan($patternscan, false, $level);
    drupal_set_message(t('Error parsing the YAML file: ' . implode(', ', $errors_on_scan)), 'error');
    return FALSE;
  }
  return TRUE;
}