You are here

function emfield_settings_validate in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 emfield.admin.inc \emfield_settings_validate()
  2. 6.3 deprecated/emfield-deprecated.admin.inc \emfield_settings_validate()
  3. 6.2 emfield.admin.inc \emfield_settings_validate()

Validation for emfield_settings form, callback for /admin/content/emfield. Ensure we have a valid SWFObject path.

1 string reference to 'emfield_settings_validate'
emfield_settings in ./emfield.admin.inc
Callback for admin/content/emfield.

File

./emfield.admin.inc, line 162
The administrative settings page.

Code

function emfield_settings_validate($form, $form_state) {
  if ($form_state['values']['emfield_swfobject'] && $form_state['values']['emfield_swfobject_location']) {
    if (!file_exists($form_state['values']['emfield_swfobject_location'])) {
      form_set_error('emfield_swfobject_location', t('The SWFObject %file file was not found at that location. Please specify a valid location.', array(
        '%file' => $form_state['values']['emfield_swfobject_location'],
      )));
    }
  }
}