Attempting to make the form more compact by merging yes/no fields as an enable checkbox after another field to enable/disable the feature

This commit is contained in:
mark-nielsen 2007-07-24 08:12:12 +00:00
parent 807d0c3199
commit 862bd9cd9c
2 changed files with 33 additions and 6 deletions

View file

@ -489,6 +489,9 @@ function lesson_get_post_actions() {
function lesson_process_pre_save(&$lesson) {
$lesson->timemodified = time();
if (empty($lesson->timed)) {
$lesson->timed = 0;
}
if (empty($lesson->timespent) or !is_numeric($lesson->timespent) or $lesson->timespent < 0) {
$lesson->timespent = 0;
}