Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-55483

Proposal for improving the flexibility of the custom menu

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.7.15, 2.8.12, 2.9.7, 3.0.5, 3.1.1
    • None
    • Themes
    • None
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE

    Description

      Standard custom menu has a rather rigid behaviour related to roles, capabilities and reacting to the user situation.

      I experiment for a long time now a flexible addition in custom menu items renderers that gives full flexibility to this menu, allowing items to be masked for non logged in users, or depending on some capability checks. This makes the menu much more consistant and avoids unconcerned people to see entries of menus that are deadend for them.

      This technique implies enhancing a bit the actual syntax of the custom menu definition in General Theme settings :

      How it is now :

      label|url

      or

      • label|url (form some subentries)

      What i added :

      label|!url => only shown to logged in people
      label|0!url => only shown to non logged in people
      label|@!url => only shows to non anonymous (logged in AND non logged guests)
      label|0@!url => only shown to anonymous (logged out, OR guests)
      label|<capabilityname>!url => only shown to people having the capability (course or system tested)
      label|^<capabilityname>!url => only shown to people NOT having the capability (course or system tested)

      In addition, i added the following processing to URLs and labels in order to give full parametrability :

      Internationalisation : all labels are format_string() processed

      dynamic injection : the following tags are processed for replacement :

      %COURSEID%
      %USERID%
      %WWWROOT%

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vf Valery Fremaux
              Huong Nguyen, Bas Brands, Mathew May
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: