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

Add support for local plugins to add or reorder secondary navigation menu items in course navigation using hooks API

XMLWordPrintable

    • MOODLE_403_STABLE, MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • Hide

      Steps:

      • Make a test course
      • Go to the course and click 'More' and you will see the standards options like the attached image more_menu_before.png
      • Install the attached plugin local_emptyplugin
        • See that the plugin is using \core\hook\navigation\secondary_extend to add a custom link above 'Badges' option
      • Refresh the page and click on on 'More' menu
      • Verify that you will see a new link 'The empty plugin' above 'Badges' option like the attached image more_menu_after.png

       

      Show
      Steps: Make a test course Go to the course and click 'More' and you will see the standards options like the attached image more_menu_before.png Install the attached plugin local_emptyplugin See that the plugin is using \core\hook\navigation\secondary_extend to add a custom link above 'Badges' option Refresh the page and click on on 'More' menu Verify that you will see a new link 'The empty plugin' above 'Badges' option like the attached image more_menu_after.png  

      Add the ability for a third party plugin to add or reorder nodes in the course navigation menu.
      This will allow secondary navigation to be overridden by using Hooks API.
      In other words, you can use this approach over using extend_navigation_course() to add a custom link to secondary navigation at any location in the more menu. 

       

        1. (1) Passed -- (Main)MDL-80797.png
          (1) Passed -- (Main)MDL-80797.png
          75 kB
        2. emptyplugin.tar.xz
          2 kB
        3. more_menu_after.png
          more_menu_after.png
          43 kB
        4. more_menu_before.png
          more_menu_before.png
          41 kB

            sumaiyajaved Sumaiya Javed
            sumaiyajaved Sumaiya Javed
            Meirza Meirza
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            3 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 16 minutes
                3h 16m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.