From 5249ba7405de4b3263172312ce60706d9e5704df Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Fri, 1 Jun 2012 11:26:16 +0800 Subject: [PATCH] MDL-33369 course: Adding support for sectionid parameter for section view pages --- course/view.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/course/view.php b/course/view.php index de3798102d2..182cb3c8e12 100644 --- a/course/view.php +++ b/course/view.php @@ -14,6 +14,7 @@ $hide = optional_param('hide', 0, PARAM_INT); $show = optional_param('show', 0, PARAM_INT); $idnumber = optional_param('idnumber', '', PARAM_RAW); + $sectionid = optional_param('sectionid', 0, PARAM_INT); $section = optional_param('section', 0, PARAM_INT); $move = optional_param('move', 0, PARAM_INT); $marker = optional_param('marker',-1 , PARAM_INT); @@ -34,6 +35,11 @@ $course = $DB->get_record('course', $params, '*', MUST_EXIST); $urlparams = array('id' => $course->id); + + //Sectionid should get priority over section number + if ($sectionid) { + $section = $DB->get_field('course_sections', 'section', array('id' => $sectionid, 'course' => $course->id), MUST_EXIST); + } if ($section) { $urlparams['section'] = $section; }