What is proper way to add a link to navigation [Administration block -developer]

What is proper way to add a link to navigation [Administration block -developer]

by Kristina Ban -
Number of replies: 2

Hi,

I would like to add a link to navigation in Administration block without modifications.

The link should be visible in the menu Administration->Quiz Administration->Mylink only when user enter the quiz and has abillity to edit quiz preferences.

What is the proper way to do that?

I created local plugin with usage of local_plugin_settings_extends_navigation (global_navigation $navigation)

Greetings Kristina

Average of ratings: -
In reply to Kristina Ban

Re: What is proper way to add a link to navigation [Administration block -developer]

by Kristina Ban -

I can`t find any usage of that solution. Anybody know some plugin with usage of hook extends_navigation?

https://tracker.moodle.org/browse/MDL-30506

<?php
function local_nicehack_extends_navigation(global_navigation $nav) {
    // $nav is the global navigation instance.
    // Here you can add to and manipulate the navigation structure as you like.
    // This callback was introduced in 2.0 as nicehack_extends_navigation(global_navigation $nav)
    // In 2.3 support was added for the now preferred local_nicehack_extends_navigation(global_navigation $nav).
}
function local_nicehack_extends_settings_navigation(settings_navigation $nav, context $context) {
    // $nav is the settings navigation instance.
    // $context is the context the settings have been loaded for (settings is context specific)
    // Here you can add to and manipulate the settings structure as you like.
    // This callback was introduced in 2.3
}