You are here

public function video_localcommand::admin_settings_validate in Video 6.5

Overrides video_plugin::admin_settings_validate

File

transcoders/video_localcommand.inc, line 547

Class

video_localcommand

Code

public function admin_settings_validate($form, &$form_state) {
  $v =& $form_state['values'];
  if (!empty($v['video_transcoder_path'])) {
    if (!is_file($v['video_transcoder_path'])) {
      form_error($form['video_transcoder_path'], t('The file %file does not exist.', array(
        '%file' => $v['video_transcoder_path'],
      )));
    }
  }
  elseif ($v['vid_convertor'] == 'video_localcommand') {
    form_error($form['video_transcoder_path'], t('!name field is required.', array(
      '!name' => $form['video_transcoder_path']['#title'],
    )));
  }
  if (!empty($v['video_localcommand_qtfaststart_cmd'])) {
    if (!is_file($v['video_localcommand_qtfaststart_cmd'])) {
      form_error($form['helpers']['video_localcommand_qtfaststart_cmd'], t('The file %file does not exist.', array(
        '%file' => $v['video_localcommand_qtfaststart_cmd'],
      )));
    }
  }
  if (!empty($v['video_flvtool2_path'])) {
    if (!is_file($v['video_flvtool2_path'])) {
      form_error($form['helpers']['video_flvtool2_path'], t('The file %file does not exist.', array(
        '%file' => $v['video_flvtool2_path'],
      )));
    }
  }
}