How to add new menu in administration nevigation bar?

How to add new menu in administration nevigation bar?

על ידי Sovan Bhattacharjee בתאריך
מספר תגובות: 3

Hyy guys I am begineer in moodle plz any body can help me how to add a plugin link as a menu under My profile setting -> activity report in left administration navigation bar. Is it possible? if possible plz plz plz help me...

Thank you! / 

צרופה Screenshot from 2015-05-21 141354.png
ממוצע דרוגים: -
בתגובה ל: Sovan Bhattacharjee

Re: How to add new menu in administration nevigation bar?

על ידי Sovan Bhattacharjee בתאריך
any body plz help about that which I describe above. plz plz plz hlp me...
בתגובה ל: Sovan Bhattacharjee

Re: How to add new menu in administration nevigation bar?

על ידי David Mudrák בתאריך
תמונה של Core developers תמונה של Documentation writers תמונה של Moodle HQ תמונה של Particularly helpful Moodlers תמונה של Peer reviewers תמונה של Plugin developers תמונה של Plugins guardians תמונה של Testers תמונה של Translators

Have a look at how other reports do it - e.g. at the report_outline_extend_navigation_user() callback.

בתגובה ל: Sovan Bhattacharjee

Re: How to add new menu in administration nevigation bar?

על ידי Franco Pantoja בתאריך
תמונה של Particularly helpful Moodlers

HI Sovan

as David tells us, you could use this function, located in report/youreport/lib.php

/**
 * This function extends the course navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $course The course to object for the report
 * @param stdClass $context The context of the course
 */
function report_myreport_extend_navigation_course($navigation, $course, $context) {
    if (has_capability('report/myreport:view', $context)) {
        $url = new moodle_url('/report/myreport/index.php', array('id'=>$course->id));
        $navigation->add(get_string('pluginname', 'report_myreport'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
    }
}

I hope It can be helpful


Regards!