function rotor_submit in Rotor Banner 5.7
Same name and namespace in other branches
- 5 rotor.module \rotor_submit()
- 6.2 rotor.module \rotor_submit()
- 6 rotor.module \rotor_submit()
- 7 rotor.module \rotor_submit()
Node form submit function. We handle the image submition.
File
- ./
rotor.module, line 208 - A rotor banner consists in a set of images that will be changing. This module is made using jquery.
Code
function rotor_submit(&$node) {
if (!($file = file_save_upload('rotor_image', file_directory_path(), FILE_EXISTS_RENAME))) {
watchdog('rotor', 'Imaged not saved');
form_set_error('rotor_image', t('File upload failed.'));
}
else {
watchdog('rotor', 'Imaged saved:' . $file->file_path);
$node->rotor_image = $file->filepath;
}
}