You are here

function akamai_settings_form_validate_file_exists in Akamai 7.3

Sets an error if the form element's value is not a path to an existing file.

1 string reference to 'akamai_settings_form_validate_file_exists'
akamai_settings_form in ./akamai.admin.inc
Form builder to manage Akamai settings.

File

./akamai.admin.inc, line 274
Administrative pages for the Akamai module.

Code

function akamai_settings_form_validate_file_exists($element, &$form_state, $form) {
  $path = $form_state['values'][$element['#name']];
  if (!empty($path) && !file_exists($path)) {
    form_error($element, t('Could not find the .edgerc file at %path. Please verify that it exists.', array(
      '%path' => $path,
    )));
  }
}