Details
-
New Feature
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
2.8
-
MOODLE_28_STABLE
-
MOODLE_28_STABLE
-
MDL-47559-master -
Description
The new user menu doesn't have much in it by default. We need to give 2.8 users a good way to add new items without having to resort to code hacks, or forcing them to wait until fancier plugins exist for this simple task.
A quick method of doing this is to emulate the example of custommenu which has been used for some time.
A. Add a new text field setting called customusermenu, on the theme settings page, directly under custommenu.
B. Use this as the default text, it will also function as an example:
editmyprofile,moodle|/user/edit.php|edit
|
messages,message|/message/index.php|message
|
myfiles,moodle|/user/files.php|addfile
|
mybadges,badges|/badges/mybadges.php|award
|
People may not want all these, but it's very easy to remove them. I also like to raise awareness of some of these things.
Three items divided by pipes |, the third one is optional:
- First item is the name of the menu item:
- if it contains a comma, then get the string from language files as specified
- otherwise, use the string exactly as it is (don't even clean it)
- Second item is a URL. If it starts with / then append it to the wwwroot, otherwise use it exactly as specified. Any %userid% in the text should be replaced with the current $USER->id.
- Third item (optional) specifies an icon. First check if the string is a file name in /pix/t and if it is then use it (I think we have some smart mechanism to choose between the png and svg, use it). If that fails then assume it's a plain URL and just use it like that. If there is no third item specified then just fall back to a default icon such as 'user'.
C. Menu code should look for this setting, parse it and add it after "My home" and before "Log out". The code needs to have good error checking, but any line that fails to parse can just be ignored.
D. The whole menu can be cached in session to avoid this being done on every page load.
E. These rules should be documented on https://docs.moodle.org/28/en/Theme_settings
Attachments
Issue Links
- caused a regression
-
MDL-48542 Possible to render a Moodle site completely inaccessible by passing '###' to customusermenuitems setting
-
- Closed
-
-
MDL-49987 Upgrade leads to no way to get to the messaging UI
-
- Closed
-
-
MDL-47960 Various behat failures cause by profile items in user menu
-
- Closed
-
- has a non-specific relationship to
-
MDL-45893 Developing a User Menu
-
- Closed
-
- will help resolve
-
MDLSITE-3464 Implement support for the 2.8 user menu in the moodle.org theme
-
- Resolved
-