Bitrix Site Manager

Administrative scripts

Administartive scripts are the scripts used by a module in the administrative section of the system. They are to be stored in the directory /bitrix/modules/module ID/admin/.

It should be considered that administrative scripts cannot be directly called in browser (as well as other scripts of the directory /bitrix/modules/). Thus, additional scripts (with the same name; hereinafter referred to as calling scripts) found in the directory /bitrix/admin/ are used to call the administrative scripts. Usually, they just include the administrative script having the same name:

require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/module ID/admin/script name");

When a module is being installed, the calling scripts must be copied from the directory /bitrix/modules/module ID/install/admin/ to the directory /bitrix/admin/.

When a module is being uninstalled, the calling scripts must be removed from the directory /bitrix/admin/.

Account must be taken of the fact that the calling scripts of all the installed modules are located in the directory /bitrix/admin/. Thus, to avoid file duplicates, they should be given names beginning with a prefix peculiar to the corresponding module.

Each administrative script must define the following two constants, before the administrative prlogue visual section is included:

These are required to form the icon above the page title.

The following example shows how to define these constants:

define("ADMIN_MODULE_NAME", "statistic");
define("ADMIN_MODULE_ICON", "<a href=\"stat_list.php?lang=".language_id."\">
<img src=\"/bitrix/images/statistic/statistic.gif\" 
width=\"48\" height=\"48\" border=\"0\" alt=\"".GetMessage("STAT_MODULE_TITLE")."\"