General developer forum

Adding an item to Site Administration menu

 
Picture of Pete Williams
Adding an item to Site Administration menu
 

Hi, I'm trying to add a new item to the Site Administration menu, like this:

Moodle menu

I've started by setting up a "local" plugin, which will also perform various other bits of functionality. In the settings.php file I've added the following code:

if (is_null($ADMIN->locate('new_item'))) {

    $ADMIN->add( 'root', new admin_category( 'new_item', 'New menu option'));

}

if (is_null($ADMIN->locate('new_sub_item'))) {

    $ADMIN->add('new_item', new admin_externalpage('new_sub_item', 'New sub item',

        $CFG->wwwroot.'/local/newplugin/index.php'));

}

However, rather than showing at the top of the page as per my screenshot, it's being displayed at the bottom of the "Site administration" tab/page.

Can anyone tell me how to get it to display at the top of the page?

Thanks,

Pete

 
Average of ratings: -