Fordson icon navigation

Fordson icon navigation

by Raul Rojas -
Number of replies: 1

 I'm working on Moodle 3.6.1 -  Theme Fordson v3.6 release 1.2

there is some way to hide some navigation icons to students and only show them to teachers?

I want to hide the icon "Banco de preguntas" to students and show it to teachers only

Attachment banco.jpg
Average of ratings: -
In reply to Raul Rojas

Re: Fordson icon navigation

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

It would be not be possible or very easy to just hide the one button from students as these are almost all built from a single template which has no permission check. 

If you are comfortable enough to hack files - EACH TIME YOU UPDATE - then this might work...

Open file /fordson/classes/output/core_renderer.php  and look around line 553 for this:

&& has_capability('moodle/course:create', $context)

Copy that code and look below that line for the these settings: $hasnav1icon, $hasnav2icon, etc etc.

For whichever icon you want to hide paste in the code:

&& has_capability('moodle/course:create', $context)

So that it looks like this:

$hasnav3icon = (empty($PAGE->theme->settings->nav3icon && isloggedin() && !isguestuser() && has_capability('moodle/course:create', $context))) ? false : $PAGE->theme->settings->nav3icon;

Please keep in mind this will ONLY work if you allow your teachers to be course creators upon login when using something like the LDAP authentication module where you can tell/automate assigning this role at the system level based on groups in LDAP that distinguish teachers from students.

The Moodle homepage or dashboard cannot distinguish between a teacher or a student because it isn't a course.  That can only happen at a course level.  My solution above will only work if the "teacher" users have the permission to create new courses.   The LDAP authentication plugin automates this.