Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.4.1
-
Component/s: Blocks
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_24_STABLE
-
Fixed Branches:MOODLE_24_STABLE, MOODLE_25_STABLE
-
Pull from Repository:
-
Pull Master Branch:master_
MDL-37968 -
Pull Master Diff URL:
Description
Usually, hidden courses are displayed to teachers but are dimmed (greyed). However, in the Course overview bloc, they are outputed as available course. In the renderer.php, there is no check on the course Visible property.
I propose the following fix to the function course_overview of class block_course_overview_renderer :
Just before these (line ~105):
$attributes = array('title' => s($course->fullname));
|
if ($course->id > 0) {
|
|
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
|
$coursefullname = format_string($course->fullname, true, $course->id);
|
|
$link = html_writer::link($courseurl, $coursefullname, $attributes);
|
$html .= $this->output->heading($link, 2, 'title');
|
} else {
|
$html .= $this->output->heading(html_writer::link(
|
new moodle_url('/auth/mnet/jump.php', array('hostid' => $course->hostid, 'wantsurl' => '/course/view.php?id='.$course->remoteid)),
|
format_string($course->shortname, true), $attributes) . ' (' . format_string($course->hostname) . ')', 2, 'title');
|
}
|
add these:
|
$linkcss = $course->visible ? "" : "dimmed";
|
$attributes = array('title' => s($course->fullname), 'class' => $linkcss);
|
This way, we have the hidden course greyed out.
Attachments
Issue Links
- caused a regression
-
MDL-40260 Regression: In Course overview block, all MNET courses are dimmed
-
- Closed
-