function revisioning_publish_confirm_validate in Revisioning 6.3
Same name and namespace in other branches
- 8 revisioning_scheduler/revisioning_scheduler.module \revisioning_publish_confirm_validate()
- 7 revisioning_scheduler/revisioning_scheduler.module \revisioning_publish_confirm_validate()
Implementation of hook_validate()
@author Adam Bramley <adam@catalyst.net.nz>
File
- revisioning_scheduler/
revisioning_scheduler.module, line 119 - Allows for revisions to be published at a specified time and date.
Code
function revisioning_publish_confirm_validate($node, &$form) {
$date = $_POST['revisioning_scheduler_date'];
$time = $_POST['revisioning_scheduler_time'];
$setdate = strtotime($date);
$timeofday = strtotime($date . $time);
if ($setdate < strtotime(date('d-m-Y'))) {
form_set_error('revisioning_scheduler_date', t('The publication date you set is in the past.'));
}
elseif ($timeofday < time() - 60) {
form_set_error('revisioning_scheduler_time', t('The publication time you set is in the past.'));
}
}