Add module to Admin CP

24-07-2014, 16:28. Author: dlestarter
Home » DLE Extra » Add module to Admin CP

DataLife Engine provides a convenient mechanism (or sub-system) for the developers to script developments and modifications. These mechanisms (or sub-system) allow for performance after the script upgrade on the new version, because These mechanisms (or sub-system) allow you to include without editing the script files.

In order to activate your third-party plug-in Admin Control Panel, you should place the file in the module folder engine/inc/ which is required. Only the files in that folder can be connected and included to Admin CP. For example the file name of your module mymod.php you put it in a folder engine/inc/ Then you can call and ask the Admin Control Panel of your module at: http://site.com/admin.php?mod=mymod where mymod is the name of your module without the extension .php The connection is created automatically, changes in the script file is not required.

In order to prevent users enter the address of your module in the browser manually and it appears in the list of all users who have access to the Admin Control Panel, for this it will add to a special table section in a MySQL database. name of the table: PREFIX_admin_sections. PREFIX is the database prefix of your installed script which will automatically read from a file engine/inc/dbconfig.php. This table contains the following field names:

Example access to information about the module mymod:

INSERT INTO `prefix_admin_sections` (`name`, `title`, `descr`, `icon`, `allow_groups`) VALUES
('mymod', 'The test module', 'Here is a description of the test module', 'mymod.png', '1');

After executing this module query to the Admin Control Panel will be registered in the Admin Control Panel for administrations and configurations.

ATTENTION: indication of the groups in the database does not and Prevents the module to be run by users from other groups. So restricting access to your plug-ins required to specific user group and only give the access URL to only authorized groups.


Go back