K4:Folder Structure
From In-Portal Developers Guide
Path to article:
m (1 версия) |
Current revision (23:30, 27 November 2010) (view source) (Minor change) |
||
(5 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
{{toc | category = Структура приложения | sortkey = 001.001}} | {{toc | category = Структура приложения | sortkey = 001.001}} | ||
- | + | Projects written using K4 have a module-based structure. Each module is a directory in the root directory of the site. All modules have the same sub-directory structure, as described below: | |
{| class="prettytable" | {| class="prettytable" | ||
- | ! | + | ! name || description |
|- | |- | ||
- | | <code>module/admin_templates</code> || | + | | <code>module/admin_templates</code> || Directory that contains module templates used for the administrative console. |
|- | |- | ||
- | | <code>module/admin_templates/img</code> || | + | | <code>module/admin_templates/img</code> || Directory that contains images used by the module. |
|- | |- | ||
- | | <code>module/admin_templates/img/icons</code> || | + | | <code>module/admin_templates/img/icons</code> || Directory where the icons used in the left tree menu and above grids in the administrative console are located. The specifics about how the files in this directory should be named are written [[K4:Добавление секций в дереве#icon|here]]. |
|- | |- | ||
- | | <code>module/admin_templates/img/itemicons</code> || | + | | <code>module/admin_templates/img/itemicons</code> || The directory which contains the icons that are show next to each record in the list of records (only for In-Portal). The names of the files in this directory must start with the prefix "<code>icon16_</code>" and follow [[K4:Назначение имён|naming convention]] rules. |
|- | |- | ||
- | | <code>module/admin_templates/img/toolbar</code> || | + | | <code>module/admin_templates/img/toolbar</code> || This directory contains icons for each button in the toolbar, which is unique to each module. How to name icons used in the toolbar is written [[K4:Добавление кнопки в панель инструментов#title|here]]. |
|- | |- | ||
- | | <code>module/install</code> || | + | | <code>module/install</code> || This directory contains files used for installation of the specific module. |
|- | |- | ||
- | | <code>module/units</code> || | + | | <code>module/units</code> || Directory that contains PHP code. |
|} | |} | ||
---- | ---- | ||
Line 22: | Line 22: | ||
- | + | The following abbreviations will be used below: | |
- | '''prefix''' - | + | '''prefix''' - prefix of [[K4:Unit Configs|unit config]] in '''singular form''', for example, event (singular because of rules of the English language) |
- | '''prefixx''' - | + | '''prefixx''' - prefix from the unity config, only plural |
- | '''helper''' - | + | '''helper''' - class helper (child of class kHelper) |
- | == | + | == Location of Files == |
- | * | + | * a directory is created for each prefix <code>'''prefixx'''</code> (for example <code>'''themes'''</code>) |
- | * | + | * this directory must contain, minimally, one file - <code>'''''<directory_name>''_config.php'''</code>, which is the unit config |
- | * | + | * all other files in the directory are named corresponding to file naming conventions |
- | * | + | * also, in the <code>units</code> directory of the module, it's allowed to create two independent directories <code>helpers</code> and <code>sections</code>. All the independent helpers (i.e. those with which more than one config may work) should be put in the <code>helpers</code> directory. All classes that are replacing other classes must be put in the <code>sections</code> directory. Correspondingly, unit configs must be created (or copied from another project) for both directories. |
- | * | + | * in the root directory of the module (for example, custom) a file can be created called '''constants.php''', in which all [[K4:Константы|constants]] necessary for the project can be placed. |
- | == | + | == Which files can be changed == |
- | + | Files can be changed only in the following directories: | |
- | * | + | * files in the directory of the module <code>"custom"</code> (all code specific to the project) <source lang="bash"><project_name>/custom</source> |
- | * | + | * files in the directory for the Front-End theme <source lang="bash"><project_name>/themes/theme_<project_name></source> |
- | {{InfoBox| | + | {{InfoBox|Changing and committing files in other directories is prohibited}} |
- | + | In some cases there are exceptions to the above rules, for example when | |
- | * | + | * the required functionality can't be realized without changes to K4 files |
- | * | + | * a partial [[K4:Обновление проектов|upgrade]] is being done for a project (to saved time), in which case all other files can be changed, but with care, and with permission of your management |
- | + | ||
+ | [[en:{{FULLPAGENAME}}]] | ||
+ | [[ru:K4:Структура директорий]] | ||
+ | |||
+ | Translated from: [http://guide.in-portal.org/rus/index.php?title=K4:%D0%A1%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B8%D1%80%D0%B5%D0%BA%D1%82%D0%BE%D1%80%D0%B8%D0%B9&oldid=1066 K4:Структура директорий (revision 1066)] |
Current revision
| ||
---|---|---|
Статьи в этой категории | ||
|
Projects written using K4 have a module-based structure. Each module is a directory in the root directory of the site. All modules have the same sub-directory structure, as described below:
name | description |
---|---|
module/admin_templates | Directory that contains module templates used for the administrative console. |
module/admin_templates/img | Directory that contains images used by the module. |
module/admin_templates/img/icons | Directory where the icons used in the left tree menu and above grids in the administrative console are located. The specifics about how the files in this directory should be named are written here. |
module/admin_templates/img/itemicons | The directory which contains the icons that are show next to each record in the list of records (only for In-Portal). The names of the files in this directory must start with the prefix "icon16_ " and follow naming convention rules.
|
module/admin_templates/img/toolbar | This directory contains icons for each button in the toolbar, which is unique to each module. How to name icons used in the toolbar is written here. |
module/install | This directory contains files used for installation of the specific module. |
module/units | Directory that contains PHP code. |
The following abbreviations will be used below:
prefix - prefix of unit config in singular form, for example, event (singular because of rules of the English language) prefixx - prefix from the unity config, only plural helper - class helper (child of class kHelper)
Location of Files
- a directory is created for each prefix
prefixx
(for examplethemes
) - this directory must contain, minimally, one file -
<directory_name>_config.php
, which is the unit config - all other files in the directory are named corresponding to file naming conventions
- also, in the
units
directory of the module, it's allowed to create two independent directorieshelpers
andsections
. All the independent helpers (i.e. those with which more than one config may work) should be put in thehelpers
directory. All classes that are replacing other classes must be put in thesections
directory. Correspondingly, unit configs must be created (or copied from another project) for both directories. - in the root directory of the module (for example, custom) a file can be created called constants.php, in which all constants necessary for the project can be placed.
Which files can be changed
Files can be changed only in the following directories:
- files in the directory of the module
"custom"
(all code specific to the project)<project_name>/custom
- files in the directory for the Front-End theme
<project_name>/themes/theme_<project_name>
In some cases there are exceptions to the above rules, for example when
- the required functionality can't be realized without changes to K4 files
- a partial upgrade is being done for a project (to saved time), in which case all other files can be changed, but with care, and with permission of your management
Translated from: K4:Структура директорий (revision 1066)