Merge branch 'wip-MDL-28407-m21' of git://github.com/samhemelryk/moodle into MOODLE_21_STABLE

This commit is contained in:
Eloy Lafuente (stronk7)
2011-08-10 01:11:51 +02:00
+7 -4
View File
@@ -9,7 +9,7 @@ require_once($CFG->dirroot.'/calendar/preferences_form.php');
$courseid = required_param('course', PARAM_INT);
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
$PAGE->set_url('/calendar/preferences.php', array('id' => $courseid));
$PAGE->set_url(new moodle_url('/calendar/preferences.php', array('course' => $courseid)));
$PAGE->set_pagelayout('standard');
require_login($course);
@@ -37,10 +37,13 @@ $prefs->maxevents = get_user_preferences('calendar_maxevents', $defaultmaxevent
$prefs->lookahead = get_user_preferences('calendar_lookahead', $defaultlookahead);
$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 = '';
}
@@ -68,7 +71,7 @@ if ($data = $form->get_data() && confirm_sesskey()) {
$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("$course->shortname: $strcalendar: $strpreferences");
$PAGE->set_heading($course->fullname);