You are here

function _getid3_admin_settings_check_path in getID3() 6

Same name and namespace in other branches
  1. 5 getid3.module \_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_form in ./getid3.admin.inc
Administration settings for getID3().

File

./getid3.admin.inc, line 53
Admin pages.

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;
}