Permalink
Browse files

Merge branch 'wip-MDL-28407-m20' of git://github.com/samhemelryk/mood…

…le into MOODLE_20_STABLE
  • Loading branch information...
2 parents 1b8b39c + 3b7127a commit 2bdfe77686dae806514a05f7d5dba1aaec3a8c4c @stronk7 stronk7 committed Aug 9, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 calendar/preferences.php
View
@@ -30,10 +30,13 @@
$prefs->lookahead = get_user_preferences('calendar_lookahead', CALENDAR_UPCOMING_DAYS);
$prefs->persistflt = get_user_preferences('calendar_persistflt', 0);
-$form = new calendar_preferences_form();
+$form = new calendar_preferences_form($PAGE->url);
$form->set_data($prefs);
-if ($data = $form->get_data() && confirm_sesskey()) {
+if ($form->is_cancelled()) {
+ redirect($viewurl);
+} else if ($form->is_submitted() && $form->is_validated() && confirm_sesskey()) {
+ $data = $form->get_data();
if ($data->timeformat != CALENDAR_TF_12 && $data->timeformat != CALENDAR_TF_24) {
$data->timeformat = '';
}
@@ -61,7 +64,7 @@
$strcalendar = get_string('calendar', 'calendar');
$strpreferences = get_string('calendarpreferences', 'calendar');
-$PAGE->navbar->add($strpreferences, new moodle_url('/calendar/view.php'));
+$PAGE->navbar->add($strpreferences);
$PAGE->set_pagelayout('admin');
$PAGE->set_title("$site->shortname: $strcalendar: $strpreferences");
$PAGE->set_heading($COURSE->fullname);

0 comments on commit 2bdfe77

Please sign in to comment.