Hide some course from "My Modules" list

Hide some course from "My Modules" list

by Mohammad Yaseen -
Number of replies: 2

Hi

We're using the essential theme, and Moodle 3.6. Our lecturers, due to our policies, need access to all courses in our LMS. Usually, we add lecturers who are not directly teaching the course as "managers", so their names don't appear under the course's name. However, the problem with that is, they have a very long list of courses in "My Modules" list (as you can see in the following pic)

Is there any way that allows us to hide the unnecessary courses in this list for non-lecturer roles? without using the "Guest" because we don't want to allow anyone to access these courses.


Thank you.

Average of ratings: -
In reply to Mohammad Yaseen

Re: Hide some course from "My Modules" list

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mohammad,

This: github.com/gjb2048/moodle-theme_essential/blob/master/classes/output/core_renderer.php#L969-L1174 is the code that creates that menu with a list of '$courses' fetched by a 'enrol_get_my_courses()' core APU call.  Therefore look at what that does and returns to see how you may modify the code to solve your specific problem.

G