function video_ffmpeg_helper_admin_settings_validate in Video 5
Same name and namespace in other branches
- 6 plugins/video_ffmpeg_helper/video_ffmpeg_helper.module \video_ffmpeg_helper_admin_settings_validate()
- 6.2 plugins/video_ffmpeg_helper/video_ffmpeg_helper.module \video_ffmpeg_helper_admin_settings_validate()
Validation for settings form
File
- plugins/
video_ffmpeg_helper/ video_ffmpeg_helper.module, line 70 - Provide some api for use ffmpeg. Simplify video nodes creation.
Code
function video_ffmpeg_helper_admin_settings_validate($form_id, &$form_values, &$form) {
if (variable_get('video_image_auto_thumbnail', 0)) {
if (!_video_ffmpeg_helper_check_exe_path($form_values['video_ffmpeg_helper_ffmpeg_path'])) {
form_set_error('video_ffmpeg_helper_ffmpeg_path', t('Set correct path for ffmpeg'));
}
if (!is_numeric($form_values['video_ffmpeg_helper_auto_thumbnail_seek'])) {
form_set_error('video_ffmpeg_helper_auto_thumbnail_seek', t('Seek time must be an integer'));
}
$options = $form_values['video_ffmpeg_helper_thumbnailer_options'];
if (!strstr($options, '%videofile') || !strstr($options, '%thumbfile')) {
form_set_error('video_ffmpeg_helper_thumbnailer_options', t('Thumbnail options must contain mandatory arguments %videofile and %thumbfile'));
}
}
}