Last active
October 25, 2022 16:36
-
-
Save nadavkav/e704d784e696dd14ff3f2b5ae015c9cc to your computer and use it in GitHub Desktop.
Add MEDIAL "Dashboard" link to course menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function can be added to the end of local/helixmedia/lib.php | |
// Add MEDIAL "Dashboard" link to course menu | |
function local_helixmedia_extend_navigation_course($parentnode, $course, $context) { | |
//if ($settingnode = $parentnode->find('courseadmin', navigation_node::TYPE_COURSE)) { | |
global $CFG; | |
require_once($CFG->dirroot.'/mod/helixmedia/lib.php'); | |
$preid = helixmedia_preallocate_id(); | |
$name = get_string('pluginname', 'helixmedia'); | |
$url = new moodle_url('/mod/helixmedia/launch.php', | |
array('type' => '3', 'l' => $preid, 'course' => $PAGE->course->id, | |
'ret' => base64_encode(curpageurl()) )); | |
$navnode = navigation_node::create( | |
$name, | |
$url, | |
navigation_node::NODETYPE_LEAF, | |
'medial', | |
'medial', | |
new pix_icon('i/edit', $name) | |
); | |
if ($PAGE->url->compare($url, URL_MATCH_BASE)) { | |
$navnode->make_active(); | |
} | |
//$settingnode->add_node($navnode); | |
$parentnode->add_node($navnode); | |
//} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment