Many of you who develop modules on SugarForge or for your own Sugar instance often find the need to add in administration functionality for it. This maybe use to control features or functionality of the module, or perhaps define some defaults that are used in the module. Fortunately, the ability to add these panels as a part of the existing admin section is a very easy and upgrade-safe task.
You can define new admin items in the custom/Extension/modules/Administration/Ext/Administration/ directory, creating a new .php file in that directory to hold the admin items. There are two parts to defining this; in the first part we will define the actual admin panels we will be adding.
$admin_options_defs=array(); $admin_options_defs['MODULENAME']['ADMINPANEL1']=array( 'MODULENAME', 'LBL_ADMINPANEL1_TITLE', 'LBL_ADMINPANEL1_DESC', './index.php?module=MODULENAME&action=ADMINPANEL1VIEW' ); $admin_options_defs['MODULENAME']['ADMINPANEL2']=array( 'MODULENAME', 'LBL_ADMINPANEL2_TITLE', 'LBL_ADMINPANEL2_DESC', './index.php?module=MODULENAME&action=ADMINPANEL2VIEW' );
Substitute MODULENAME for the name of your module above, and the various ADMINPANEL* shortcuts for the name of the panel your will be adding. Next, we will take this list of menu options an put them in a group.
$admin_group_header=array( 'LBL_ADMINPANELGROUP_TITLE', '', false, $admin_options_defs, );
After a Quick Rebuild and Repair, the new admin options will show up at the bottom of the Admin section in a new panel.