K4:Структура директорий
From In-Portal Developers Guide
Path to article:
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 |
- | + |
Revision as of 22:20, 28 March 2009
| ||
---|---|---|
Статьи в этой категории | ||
|
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:
название | описание |
---|---|
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