You are here

function _getid3_admin_settings_check_path in getID3() 5

Same name and namespace in other branches
  1. 6 getid3.admin.inc \_getid3_admin_settings_check_path()
  2. 7 getid3.admin.inc \_getid3_admin_settings_check_path()

Checks the that the directory in $form_element exists and contains a file named 'getid3.php'. If validation fails, the form element is flagged with an error from within the file_check_directory function. See: system_check_directory()

Parameters

$form_element: The form element containing the name of the directory to check.

1 string reference to '_getid3_admin_settings_check_path'
getid3_admin_settings in ./getid3.module
Administration settings for getID3().

File

./getid3.module, line 153

Code

function _getid3_admin_settings_check_path($form_element) {
  $path = $form_element['#value'];
  if (!is_dir($path) || !(file_exists($path . '/getid3.php') && file_exists($path . '/write.php'))) {
    form_set_error($form_element['#parents'][0], t('The getID3 files <em>getid3.php</em> and <em>write.php</em> could not be found in the %path directory.', array(
      '%path' => $path,
    )));
  }
  return $form_element;
}