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! /
In reply to Sovan Bhattacharjee
Re: How to add new menu in administration nevigation bar?
by Sovan Bhattacharjee -
any body plz help about that which I describe above. plz plz plz hlp me...
In reply to Sovan Bhattacharjee
Re: How to add new menu in administration nevigation bar?
by David Mudrák -
Have a look at how other reports do it - e.g. at the report_outline_extend_navigation_user()
callback.
In reply to Sovan Bhattacharjee
Re: How to add new menu in administration nevigation bar?
by Franco Pantoja -
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!