You are here

function _getid3_admin_settings_check_path in getID3() 7

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

Verifies that getid3 is in the directory specified by the form element.

Checks that the directory in $form_element exists and contains files named 'getid3.php' and 'write.php'. If validation fails, the form element is flagged with an error.

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