I am new to moodle. I have created a local plugin setmotd.
A new menu item is not getting added to Site Administration.
Using moodle 2.8.5 and genesis theme( purchased ).
In lib.php i have placed function :
function local_setmotd_extends_settings_navigation($settingsnav, $context)
{
global $CFG, $PAGE;
/*
// Only let users with the appropriate capability see this settings item.
if( ! has_capability('local_plugin/setmotd:view', $context) )
{
return;
}
*/
if($settingnode = $settingsnav->find('root', navigation_node::TYPE_SETTING))
{
$setMotdMenuLbl = get_string('menutitle', 'local_setmotd');
$setMotdUrl = new moodle_url('/local/setmotd/set_motd.php');
$setMotdnode = navigation_node::create(
$setMotdMenuLbl,
$setMotdUrl,
navigation_node::NODETYPE_LEAF);
if ($PAGE->setMotdUrl->compare($setMotdUrl, URL_MATCH_BASE)) {
$setMotdnode->make_active();
}
$settingnode->add_node($setMotdnode);
}
}