public function get_content() {
global $CFG;
- $calm = optional_param('cal_m', 0, PARAM_INT);
- $caly = optional_param('cal_y', 0, PARAM_INT);
- $time = optional_param('time', 0, PARAM_INT);
-
require_once($CFG->dirroot.'/calendar/lib.php');
if ($this->content !== null) {
return $this->content;
}
- // If a day, month and year were passed then convert it to a timestamp. If these were passed then we can assume
- // the day, month and year are passed as Gregorian, as no where in core should we be passing these values rather
- // than the time. This is done for BC.
- if (!empty($calm) && (!empty($caly))) {
- $time = make_timestamp($caly, $calm, 1);
- } else if (empty($time)) {
- $time = time();
- }
-
$this->content = new stdClass;
$this->content->text = '';
$this->content->footer = '';
- // [pj] To me it looks like this if would never be needed, but Penny added it
- // when committing the /my/ stuff. Reminder to discuss and learn what it's about.
- // It definitely needs SOME comment here!
$courseid = $this->page->course->id;
$issite = ($courseid == SITEID);
$renderer = $this->page->get_renderer('core_calendar');
- $calendar = new calendar_information(0, 0, 0, $time);
+ $calendar = new calendar_information();
$calendar->prepare_for_view($course, $courses);
list($data, $template) = calendar_get_view($calendar, 'mini');