$data->timeformat = ''; } set_user_preference('calendar_timeformat', $data->timeformat); $data->startwday = intval($data->startwday); if ($data->startwday < 0 || $data->startwday > 6) { $data->startwday = abs($data->startwday % 7); } set_user_preference('calendar_startwday', $data->startwday); if (intval($data->maxevents) >= 1) { set_user_preference('calendar_maxevents', $data->maxevents); } if (intval($data->lookahead) >= 1) { set_user_preference('calendar_lookahead', $data->lookahead); } set_user_preference('calendar_persistflt', intval($data->persistflt)); redirect($viewurl, get_string('changessaved'), 1); exit; } } $strcalendar = get_string('calendar', 'calendar'); $strpreferences = get_string('calendarpreferences', 'calendar'); $PAGE->navbar->add($strpreferences); $PAGE->set_pagelayout('admin'); $PAGE->set_title("{$course->shortname}: {$strcalendar}: {$strpreferences}"); $PAGE->set_heading($course->fullname); echo $OUTPUT->header(); echo $OUTPUT->heading($strpreferences); echo $OUTPUT->box_start('generalbox boxaligncenter'); $form->display(); echo $OUTPUT->box_end(); echo $OUTPUT->footer();