Guide Category

134

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
dlestarter
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:

  • name - contains the name of your module, which is .php file that located in folder engine/inc/, but without the file extension. For example, your file name mymod.php, then this field must be used the value mymod.
  • title - contains the title of your module.
  • descr - contains a description of your module.
  • icon - contains the name of the icon for your module, without specifying the path. Icon must be added and located in the engine/skins/images/ (required). Recommended icon sizes 70 to 70 pixels.
  • allow_groups - contains information about groups who are allowed to manage this module. This field can be: all or ID groups, separated by commas. For example: 1,2,3. if this value all the module will be accessed to all users who access the Admin Control Panel.

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.

Related Tutorials

Review/Leave Comment

comments powered by Disqus