General developer forum

Adding a new menu item in Site adminitration

 
Picture of sirisha singampalli
Adding a new menu item in Site adminitration
 

I have added a menu in site administration using the below code.But it is coming at the bottom of site administration. How to change the weight of this menu???

I want this menu after Notifications as shown in the figure

 function local_nicehack_extends_settings_navigation(settings_navigation $settingsnav, context $context)

{

    global $CFG, $PAGE;

    $settingnode = $settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN);

    if( $settingnode)

    {

        $setMotdMenuLbl = get_string('course_notification', 'course_notification');

        $setMotdUrl = new moodle_url('/customlib/course_notification.php');

        $setMotdnode = navigation_node::create(

            $setMotdMenuLbl,

            $setMotdUrl,

            navigation_node::NODETYPE_LEAF);

        $settingnode->add_node($setMotdnode);

    }

}



 
Average of ratings: -