You are here

asset_import.routies.inc in Asset 6

File

asset_import/inc/asset_import.routies.inc
View source
<?php

/**
 * Checks the existence of the directory specified in $form_element.
 *
 * @param $form_element
 *   The form element containing the name of the directory to check.
 * @see system_check_directory()
 */
function _asset_import_settings_check_directory($form_element) {
  $import_dir = $form_element['#value'];
  file_check_directory($import_dir, 0, $form_element['#parents'][0]);
  $image_dir = file_create_path(variable_get('image_default_path', 'images'));
  if (realpath($import_dir) == realpath($image_dir)) {
    form_set_error($form_element['#parents'][0], t("You can't import from the image module's directory. The import deletes the original files so you would just be asking for trouble."));
  }
  return $form_element;
}

Functions

Namesort descending Description
_asset_import_settings_check_directory Checks the existence of the directory specified in $form_element.