Administration Links
Overview
Administration links are the shortcut URLs found on the Administration page in the Sugar application. Developers can create additional administration links using the extension framework.
The global links extension directory is located at ./custom/Extension/modules/Administration/Ext/Administration/
. After a Quick Repair and Rebuild, the PHP files in this directory are compiled into ./custom/modules/Administration/Ext/Administration/administration.ext.php
. Additional information on this can be found in the extensions Administration section of the Extension Framework documentation. The current links defined in the administration section can be found in ./modules/Administration/metadata/adminpaneldefs.php
.
Example
The following example will create a new panel on the Admin page:
./custom/Extension/modules/Administration/Ext/Administration/<file>.php
<?php
$admin_option_defs = array();
$admin_option_defs['Administration']['<section key>'] = array(
//Icon name. Available icons are located in ./themes/default/images
'Administration',
//Link name label
'LBL_LINK_NAME',
//Link description label
'LBL_LINK_DESCRIPTION',
//Link URL - For Sidecar modules
'javascript:void(parent.SUGAR.App.router.navigate("<module>/<path>", {trigger: true}));',
//Alternatively, if you are linking to BWC modules
//'./index.php?module=<module>&action=<action>',
);
$admin_group_header[] = array(
//Section header label
'LBL_SECTION_HEADER',
//$other_text parameter for get_form_header()
'',
//$show_help parameter for get_form_header()
false,
//Section links
$admin_option_defs,
//Section description label
'LBL_SECTION_DESCRIPTION'
);
To define labels for administration links in the new panel:
./custom/Extension/modules/Administration/Ext/Language/en_us.<name>.php
<?php
$mod_strings['LBL_LINK_NAME'] = 'Link Name';
$mod_strings['LBL_LINK_DESCRIPTION'] = 'Link Description';
$mod_strings['LBL_SECTION_HEADER'] = 'Section Header';
$mod_strings['LBL_SECTION_DESCRIPTION'] = 'Section Description';
Finally, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and the panel will appear on the Admin page.