Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
2.6
-
None
-
MOODLE_26_STABLE
Description
The goal of this operation is to hide the listing of all available courses, not just the "All Courses" link. The list can be extensive and our institution wants to limit the view.
I have accomplished this in our instance by making the following modifications. The request is to have it generalized and added into the administration GUI.
Modifications
In the administration:
Site Administration -> Plugins -> Blocks -> Courses
Check "Hide 'All courses' link
Site Administration -> Front page -> Front page settings
In "Front page items when logged in" have only "Enrolled Courses" selected
Hide Search Box
core.css (Theme)
#coursesearch, #coursesearch2
Remove "All Courses" Link
index.php (Main)
Under the case statement remove the all courses link from the html variable. I'm sure there is a better place/way for this, but I was not able to find it.
case FRONTPAGEENROLLEDCOURSELIST:
$mycourseshtml = str_replace('<div class="paging paging-morelink"><a href="https://my.moodle.edu/course/index.php">All courses</a></div>', '', $mycourseshtml);
Added break statement above the "No break" comment to prevent all available courses from being displayed.
break;
// No "break" here. If there are no enrolled courses - continue to 'Available courses'.
Remove the "Courses" link from the navigation block.
lib/navigationlib.php
$this->rootnodes['courses']->isexpandable = false;//true;