You are here

function _patterns_io_import_check_dirs in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/io/ \_patterns_io_import_check_dirs()

Helper function to be called in one of the import validation handlers.


includes/io/, line 39
Importing Patterns from a file or using an URL.


function _patterns_io_import_check_dirs($dir = NULL) {

  // Check Patterns Directory.
  if (!_patterns_io_is_patterns_dir_ready($dir, FILE_CREATE_DIRECTORY)) {
    $message = t("Destination folder does not exist or is not writable: %path<br />", array(
      '%path' => $dir,

    // TODO: move this out for performance
    $link = l(t('status report'), 'admin/reports/status');
    $message .= t('You might want to check the !link to ensure your files directory exists and is writable.', array(
      '!link' => $link,
    form_set_error('pattern_file', $message);
    return FALSE;