From f46895698889ebe170b77a0e723addb7ca49c6c0 Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Wed, 9 May 2012 11:37:22 +0800 Subject: [PATCH 1/2] MDL-31133 calendar: Replace the deprecated function usage with core_calendar_renderer class --- calendar/delete.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/calendar/delete.php b/calendar/delete.php index 7ab989a471fa8..24edd48b71ad3 100644 --- a/calendar/delete.php +++ b/calendar/delete.php @@ -28,6 +28,7 @@ require_once($CFG->dirroot.'/calendar/event_form.php'); require_once($CFG->dirroot.'/calendar/lib.php'); require_once($CFG->dirroot.'/course/lib.php'); +require_once($CFG->dirroot.'/calendar/renderer.php'); $eventid = required_param('id', PARAM_INT); $confirm = optional_param('confirm', false, PARAM_BOOL); @@ -121,7 +122,10 @@ // Print the event so that people can visually confirm they have the correct event $event->time = calendar_format_event_time($event, time(), null, false); -calendar_print_event($event, false); +$renderer = $PAGE->get_renderer('core_calendar'); +echo $renderer->start_layout(); +echo $renderer->event($event); +echo $renderer->complete_layout(); echo $OUTPUT->box_end(); echo $OUTPUT->footer(); From 064f0c8ac331850f9e92e3c2c4b01b67f2d8946a Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Wed, 9 May 2012 14:23:13 +0800 Subject: [PATCH 2/2] MDL-31133 calendar: Deleting the deprecated function calendar_get_events() --- calendar/lib.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index 7280f14c7a85d..e0694fea8fa0f 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -620,23 +620,6 @@ function calendar_add_event_metadata($event) { return $event; } -/** - * Prints a calendar event - * - * @deprecated Moodle 2.0 - MDL-22887 please do not use this function any more. - * @todo MDL-31133 - will be removed in Moodle 2.3 - * @see core_calendar_renderer event function - */ -function calendar_print_event($event, $showactions=true) { - global $CFG, $USER, $OUTPUT, $PAGE; - debugging('calendar_print_event is deprecated please update your code', DEBUG_DEVELOPER); - $renderer = $PAGE->get_renderer('core_calendar'); - if (!($event instanceof calendar_event)) { - $event = new calendar_event($event); - } - echo $renderer->event($event); -} - /** * Get calendar events *