Adaptable - Need to remove a User menu item

Adaptable - Need to remove a User menu item

by Jocelyn Garner -
Number of replies: 5

Hi everyone, I need to remove the Grades menu option from the User menu in the individual course and sidebar menus. 

  • Moodle Version: 3.10.3
  • Theme Version: theme_adaptable_moodle310_2021022302

Identifies menu option to be removed  Grades menu in the sidebar

I found this older post on the same subject, and tried following those instructions but they didn't seem to work. 

https://moodle.org/mod/forum/discuss.php?d=411684 

I found a reference to the Grades menu in these files within the current theme:

List of files where grades are mentioned

I disabled these lines in all 3 files, but the menu option still appears. 

How can I remove the Grades menu in the Header menu for Students, and in the Sidebar menu for Admins? 

Thanks, 
Toolie®

Average of ratings: -
In reply to Jocelyn Garner

Re: Adaptable - Need to remove a User menu item

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ok the 'enablegrades' setting is for the user's menu, there is another setting 'displaygrades' which is for the 'This course' menu - but I'm confused as you said 'User menu' which is the one on the user name and icon, but the screen shot is the 'This course' menu which is not the 'User menu'.

The 'Grades' in the navigation block could possibly be done by altering how 'theme_adaptable_extend_navigation_course' works in Adaptable's lib.php file as that's called by code in /lib/navigationlib.php - all a bit complex, but I suspect possible - that will take me time and skill to work out, thus I'd want to be compensated for my time on that one, of course, others are free to answer if they choose to do so.
In reply to Gareth J Barnard

Re: Adaptable - Need to remove a User menu item

by Jocelyn Garner -
Apologies for not using the correct terminology; what I need is to hide the "Grades" menu option on the This Course menu. I can live without removing the "Grades" menu option in the Administrator menu. You pointed me in the right direction: commenting out the "displaygrades" items in these files:

List of disabled lines in these files

I read and can program in PHP, so I know how many lines to disable, but these are the main ones. Now the Grades menu option has disappeared from the This Course menu, and that's all I needed.

Thanks for your prompt assistance. 
Toolie®

In reply to Jocelyn Garner

Re: Adaptable - Need to remove a User menu item

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

Umm, ok, 'displaygrades' is a setting in the theme, so you can just change the box from 'Show' to 'Hide' in the theme settings in the UI. I don't know why you've gone to the bother of commenting out the code as you didn't need to do that.

G
Attachment Screenshot 2021-04-16 184533.png
In reply to Gareth J Barnard

Re: Adaptable - Need to remove a User menu item

by Jocelyn Garner -

It's very simple: when I unchecked the box and saved the settings, the menu option was still visible. So changing it from Show to Hide did NOT work. I would not have sought an alternate solution if the obvious one worked.

In reply to Jocelyn Garner

Re: Adaptable - Need to remove a User menu item

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

Odd as 'displaygrades' disables 'Grades' in the 'This course' menu and 'enablegrades' disables 'Grades' in the user menu for me.