Views: 14374
Last Modified: 20.07.2021

Module files are located in the module ID folder. Folder structure:

  • /bitrix/modules/module ID/ - module root catalogue
  • /admin/ - catalogue with administrative scripts of the module;
    • menu.php - file containing administrative menu of the module;
  • /classes/ - scripts with module classes;
    • /general/ - module classes that do not depend on the database used;
    • /mysql/ - module classes intended for work only with MySQL;
    • /mssql/ - module classes intended for work only with MS SQL;
    • oracle/ - module class intended to work only with Oracle;
  • /lang/language ID/ - catalogue with language files of module scripts;
  • lib/ - catalogue with files (API: classes, logic) for the new core D7 (may not be available when module does not have its own methods);
  • /install/ - catalog with files used for module installation and deinstallation;
    • /admin/ - catalog with scripts connecting administrative scripts of the module (access scripts);
    • /js/ - catalog with js scripts of the module; these are copied to /bitrix/js/module_ID/;
    • /db/ - catalogue with SQL scripts for installation/deinstallation of database;
      • /mysql/ - SQL scripts for installation/deinstallation of tables in MySQL;
      • /mssql/ - SQL scripts for installation/deinstallation of tables in MS SQL;
      • oracle/ - SQL scripts for installation/deinstallation of tables in Oracle;
    • /images/ - catalog with images used by the module; after the module is installed they must be copied into the catalog /bitrix/images/module ID/;
    • /templates/ - catalog with components 1.0 of the module. (The catalog is saved only to ensure version compatibility);
      • /module ID/ - catalog containing main files of the component;
      • /lang/language ID/module ID/ - language files of the module components are located in this catalog;
    • /components/namespace/component name/ - catalog containing components 2.0 of the module;
    • /themes/module_name/ - contains css and images for the styles of the administrative panel, if the module needs them (outdated, used before version 12.0);
    • /panel/module_name/ - contains css and images for the styles of the administrative panel, if the module needs them.
    • index.php - file containing module description;
    • version.php - file with module version. Version cannot be null.
  • include.php - this file is connected when the module is connected in a code; all files containing libraries of functions and module classes must be located here;
  • default_option.php - contains an array named $ID module_default_option where default values are set for module parameters.

    Note: If the module name contains a dot (e.g., mycompany.forum) in the name of a variable, the dot will be replaced with the underscore character.

  • options.php - this file is connected on the setup page of module parameters in the administrative menu Settings;
  • prolog.php - this file can be connected in all administrative scripts of the module. Normally the constant ADMIN_MODULE_NAME (module identifier) which is used in the control panel is determined here.
  • .settings.php - module settings file, describing module settings that can be read via \Bitrix\Main\Config\Configuration::getInstance($module).


Courses developed by Bitrix24