function fupload_list_images_validate in Image FUpload 6.3
Same name and namespace in other branches
- 6 includes/images.previewlist.inc \fupload_list_images_validate()
- 6.2 includes/images.previewlist.inc \fupload_list_images_validate()
1 string reference to 'fupload_list_images_validate'
- fupload_list_images in includes/
images.previewlist.inc
File
- includes/
images.previewlist.inc, line 82
Code
function fupload_list_images_validate($form, &$form_state) {
// only validate body field, rest is already validated; code partially taken from function "node_validate" (D6)
// get nids of images and start batch process (validation)
$type = node_get_types('type', str_replace("-", "_", check_plain(arg(2))));
$image_nids = explode(';', $form_state['values']['image_nodes']);
for ($i = 0; $i < count($image_nids); $i++) {
if (!empty($type->min_word_count) && isset($form_state['values']['body_' . $image_nids[$i]]) && count(explode(' ', $form_state['values']['body_' . $image_nids[$i]])) < $type->min_word_count) {
form_set_error('body_' . $image_nids[$i], t('The body of the @img_number. image is too short. You need at least %words words.', array(
'%words' => $type->min_word_count,
'@img_number' => $i + 1,
)));
}
}
}