function video_settings_form_validate in Video 5
Same name and namespace in other branches
- 6 video.module \video_settings_form_validate()
- 6.2 video.module \video_settings_form_validate()
Form API callback to validate the upload settings form.
Keeps the use from showing the play tab or the play link if they have chosen to display the video in the node body.
Parameters
$form_id: The identifier of the form
$form_values: form values from the settings page
File
- ./
video.module, line 400 - Display video in Quicktime MOV, Realmedia RM, Flash FLV & SWF, or Windows Media WMV formats.
Code
function video_settings_form_validate($form_id, $form_values) {
//print_r($form_values); die;
// if admin set a name for a resolution he also have to set its value
while ($i <= 4) {
if ($form_values["video_resolution_{$i}_name"] != '' && $form_values["video_resolution_{$i}_value"] == '') {
form_set_error("video_resolution_{$i}_value", t('You have to set a value for resolution %res_num if you want to enable it.', array(
'%res_num' => $i,
)));
}
if ($form_values["video_resolution_{$i}_value"] != '' && !preg_match('/^[0-9]{2,4}x[0-9]{2,4}$/', $form_values["video_resolution_{$i}_value"])) {
// check valid resolution value
form_set_error("video_resolution_{$i}_value", t('You have to set valid value for resolution %res_num if you want to enable it. A valid value is 400x300', array(
'%res_num' => $i,
)));
}
$i++;
}
// for future use
}