Permalink
Browse files

Merge branch 'MDL-60422_master' of git://github.com/markn86/moodle

  • Loading branch information...
dmonllao committed Oct 23, 2017
2 parents fc4e788 + 72c4cac commit bd3824519bd3627768bd8a196a3fa43cab6ef8be
@@ -239,7 +239,7 @@ protected function get_default_add_context() {
*/
protected function get_course_filter_selector(renderer_base $output) {
$langstr = get_string('upcomingeventsfor', 'calendar');
return $output->course_filter_selector($this->url, $langstr);
return $output->course_filter_selector($this->url, $langstr, $this->calendar->course->id);
}
/**
@@ -151,7 +151,7 @@ protected function get_default_add_context() {
*/
protected function get_course_filter_selector(renderer_base $output) {
$langstr = get_string('upcomingeventsfor', 'calendar');
return $output->course_filter_selector($this->url, $langstr);
return $output->course_filter_selector($this->url, $langstr, $this->calendar->course->id);
}
/**
@@ -231,7 +231,8 @@ protected function get_other_values(renderer_base $output) {
*/
protected function get_course_filter_selector(renderer_base $output) {
$content = '';
$content .= $output->course_filter_selector($this->url, get_string('detailedmonthviewfor', 'calendar'));
$content .= $output->course_filter_selector($this->url, get_string('detailedmonthviewfor', 'calendar'),
$this->calendar->course->id);
return $content;
}
@@ -237,10 +237,11 @@ public function event(calendar_event $event, $showactions=true) {
*
* @param moodle_url $returnurl The URL that the user should be taken too upon selecting a course.
* @param string $label The label to use for the course select.
* @param int $courseid The id of the course to be selected.
* @return string
*/
public function course_filter_selector(moodle_url $returnurl, $label=null) {
global $USER, $SESSION, $CFG;
public function course_filter_selector(moodle_url $returnurl, $label = null, $courseid = null) {
global $CFG;
if (!isloggedin() or isguestuser()) {
return '';
@@ -261,7 +262,9 @@ public function course_filter_selector(moodle_url $returnurl, $label=null) {
$courseoptions[$course->id] = format_string($course->shortname, true, array('context' => $coursecontext));
}
if ($this->page->course->id !== SITEID) {
if ($courseid) {
$selected = $courseid;
} else if ($this->page->course->id !== SITEID) {
$selected = $this->page->course->id;
} else {
$selected = '';

0 comments on commit bd38245

Please sign in to comment.