In-Portal Developers Guide

This is a wiki-based Developers Guide for In-Portal Open Source CMS. The purpose of this guide is to provide advanced users, web developers and programmers with documentation on how to expand, customize and improve the functionality and the code the In-Portal software. Please consider contributing to our documentation writing effort.

K4:Unit Configuration File

From In-Portal Developers Guide

(Difference between revisions)
Jump to: navigation, search
m (1 версия)
Current revision (01:25, 28 November 2010) (view source)
(Side-box)
 
(6 intermediate revisions not shown.)
Line 1: Line 1:
-
{{NotFinished}}{{toc | category = Unit Configs | sortkey = 000.001}}'''Unit config''' - это файл в котором находится информация об '''одной''' таблице в базе данных и параметры, связанные с отображением и изменением данных в ней содержащихся. Файл из себя представляет ассоциативный массив в котором каждый ключ является отдельной опцией (сам массив находиться в переменной '''<code>$config</code>'''). Значение каждой опции может быть любого, [http://php.prod.intechnic.lv/manual/en/language.types.php доступного в php], типа. Опции могут быть взаимосвязаны между собой, однако их связь не возможно проследить анализируя только сам файл с unit config. Это лучше всего делать выполнив поиск названий этих опций в php коде K4.
+
{{NotFinished}}{{toc | category = Unit Configs | sortkey = 000.001}}
 +
'''Unit configuration file''' - this is a file, which containts information about '''one''' table in the database and the parameters that are associated with displaying and changing the data that's contained in it. The file is an associative array in which each key is a separate option (the array itself is located in the variable '''<code>$config</code>'''). The value of each option can be type available [http://php.prod.intechnic.lv/manual/en/language.types.php доступного in PHP]. The options can be interconnected with one another and their connections can't be determined by analyzing just the unit config file. This is better done by searching the names of these options in the PHP code of K4.
-
== Все стандартные опции ==
+
== All Standard Options ==
{| class="prettytable"
{| class="prettytable"
-
! название опции || описание опции
+
! Option Names || Option Descriptions
|-
|-
-
| {{ConfigProperty|Prefix|string}} || Префикс этого unit config (должен быть уникальным среди всех unit configs). Содержание данной опции должно соответствовать правилу [[K4:Назначение имён|названачения имён]].
+
| {{ConfigProperty|Prefix|string}} || The prefix of this unit config (must be unique amongst all unit configs). The contents of this option must follow [[K4:Назначение имён|naming conventions]] rules.
|-
|-
-
| [[K4:Регистрация классов|{{ConfigProperty|ItemClass|Array}}]] || Регистрирует в системе связку между [[#Prefix|префиксом]] и классом, для работы с одной записью в базе.
+
| [[K4:Регистрация классов|{{ConfigProperty|ItemClass|Array}}]] || Registers in the system a connection between a [[#Prefix|prefix]] and class for working with the one record in the database.
|-
|-
-
| [[K4:Регистрация классов|{{ConfigProperty|ListClass|Array}}]] || Регистрирует в системе связку между [[#Prefix|префиксом]] и классом для отображения содержания таблицы из базы (фильтрация, per-page и т.п.).
+
| [[K4:Регистрация классов|{{ConfigProperty|ListClass|Array}}]] || Registers the connection between a [[#Prefix|prefix]] and class in the system for the purposes of displaying the contents of a table in the database (filtering, per-page, etc.).
|-
|-
-
| [[K4:Регистрация классов|{{ConfigProperty|EventHandlerClass|Array}}]] || Регистрирует в системе связку между [[#Prefix|префиксом]] и классом для обработки стандартных событий из grid и форм редактирования.
+
| [[K4:Регистрация классов|{{ConfigProperty|EventHandlerClass|Array}}]] || Registers in the system the connection between a [[#Prefix|prefix]] and class for the purpose of processing standard events from grids and edit forms.
 +
 
 +
|-
 +
| [[K4:Регистрация классов|{{ConfigProperty|TagProcessorClass|Array}}]] || Registers a connection in the system between a [[#Prefix|prefix]] and class for processing standard tags, used for displaying information.
|-
|-
-
| [[K4:Регистрация классов|{{ConfigProperty|TagProcessorClass|Array}}]] || Регистрирует в системе связку между [[#Prefix|префиксом]] и классом для обработки стандартных тэгов, использующихся для вывода информации.
+
| [[K4:Регистрация классов|{{ConfigProperty|RegisterClasses|Array}}]] || Registers any user classes in the system.
|-
|-
-
| [[K4:Регистрация классов|{{ConfigProperty|RegisterClasses|Array}}]] || Регистрирует в системе любые пользовательские классы.
+
| {{ConfigProperty|AutoLoad|boolean}} || Automatically loads an <code>item</code> object by ID, which is found in <code>$_REQUEST</code>.
|-
|-
-
| {{ConfigProperty|AutoLoad|boolean}} || Обеспечивает автоматическую загрузку (load) <code>item</code> объекта по ID, найденному в <code>$_REQUEST</code>.
+
| {{ConfigProperty|CheckSimulatniousEdit|boolean}} || Indicates that there must be a check for dual editing for the table that's declared in the configuration file. The check works in the following way:<br />If one user opens a record for edit, which is already being edited by another user, then the user will be shown a warning that the record he or she has opened is already being edited by another user. The warning will show the user's name and IP address. Available since [[K4:Core v 5.0.0|Core v 5.0.0]].
|-
|-
| {{ConfigProperty|QueryString|array}} ||
| {{ConfigProperty|QueryString|array}} ||
|-
|-
-
| [[K4:Regular Events|{{ConfigProperty|RegularEvents|array}}]] || Выполняет указанные события с требуемым интервалом.
+
| [[K4:Regular Events|{{ConfigProperty|RegularEvents|array}}]] || Executes the indicated events at the required interval.
|-
|-
-
| {{ConfigProperty|PortalStyleEnv|bool}} || Влияет на то, как переменные данного префикса будут выглядеть в [[K4:Переменная окружения|переменной окружения]]. Если задать в "<code>true</code>", то не будет дефиса между префиксом и значением его первой переменной, т.е. будет "<code>m5</code>", вместо "<code>m-5</code>" как обычно.
+
| {{ConfigProperty|PortalStyleEnv|bool}} || Controls how a prefix's variable will look in an [[K4:Переменная окружения|environment variable]]. If set to "<code>true</code>", then there won't be a hyphen between the prefix and the value of its first variable, i.e. it will be "<code>m5</code>", instead of "<code>m-5</code>" as usual.
|-
|-
| {{ConfigProperty|CatalogItem|bool}} ||
| {{ConfigProperty|CatalogItem|bool}} ||
Line 35: Line 39:
| {{ConfigProperty|ConfigPriority|int}} ||
| {{ConfigProperty|ConfigPriority|int}} ||
|-
|-
-
| [[K4:Hooks|{{ConfigProperty|Hooks|array}}]] || Позволяет добавлять новые hooks в систему.
+
| {{ConfigProperty|PassPriority|int}} || Allows setting the order in which a prefix will be shown amongst other prefixes in putting together the value of an [[K4:Переменная окружения|environment variable]]. Available since [[K4:Core v 5.0.0|Core v 5.0.0]].
 +
|-
 +
| [[K4:Hooks|{{ConfigProperty|Hooks|array}}]] || Allows adding new hooks to the system.
|-
|-
| {{ConfigProperty|ItemType|int}} ||
| {{ConfigProperty|ItemType|int}} ||
Line 45: Line 51:
| {{ConfigProperty|TitlePhrase|string}} ||
| {{ConfigProperty|TitlePhrase|string}} ||
|-
|-
-
| {{ConfigProperty|IDField|string}} || Название колонки в таблице, содержащей первичный ключ (primary key). Обычно это числовая колонка с опцией autoincrement.
+
| {{ConfigProperty|IDField|string}} || Name of the column in the table that holds the primary key. This is usually an integer column using autoincrement.
|-
|-
-
| {{ConfigProperty|StatusField|array}} || Список колонок в таблице (обычно одна, напр. '''<code>Array ('Status')</code>''' или '''<code>Array ('Enabled')</code>'''), которые влияют на пиктограмму в каждой строке grid в In-Portal. Так же значение этой опции используется в событиях [[EventHandler:OnMassApprove|OnMassApprove]] и [[EventHandler:OnMassDecline|OnMassDecline]].
+
| {{ConfigProperty|StatusField|array}} || List of columns in a table (usually there's only one, for example '''<code>Array ('Status')</code>''' or '''<code>Array ('Enabled')</code>''') that affect the icon in each record in an In-Portal grid. The value of this option is also used in Events [[EventHandler:OnMassApprove|OnMassApprove]] and [[EventHandler:OnMassDecline|OnMassDecline]].
|-
|-
-
| {{ConfigProperty|OrderField|string}} || Название поля, использующегося в событиях [[EventHandler:OnMassMoveUp|OnMassMoveUp]] и [[EventHandler:OnMassMoveDown|OnMassMoveDown]] для изменения порядка отображения записей в списке. Если опция не задана, то её значение будет равно "<code>Priority</code>".
+
| {{ConfigProperty|OrderField|string}} || The name of the field that's used in Events [[EventHandler:OnMassMoveUp|OnMassMoveUp]] and [[EventHandler:OnMassMoveDown|OnMassMoveDown]] to change the order in which records are displayed in a grid. If the option isn't set, by default its value will be "<code>Priority</code>".
|-
|-
-
| {{ConfigProperty|TitleField|string}} || Название колонки в таблице, содержание которой будет использовано в заголовке формы редактирования этого item. Используется в опции [[#TitlePresets|TitlePresets]].
+
| {{ConfigProperty|TitleField|string}} || The name of the column in the table that will be used as the header of the edit form for that item. Used in option [[#TitlePresets|TitlePresets]].
|-
|-
-
| {{ConfigProperty|TableName|string}} || Название таблицы в базе данных для которой будет использоваться данный unit config, напр. '''<code>TABLE_PREFIX.'Tests'</code>'''.
+
| {{ConfigProperty|TableName|string}} || The name of the table in the database for which this unit config will be used. For example, '''<code>TABLE_PREFIX.'Tests'</code>'''.
|-
|-
| {{ConfigProperty|SubItems|array}} ||
| {{ConfigProperty|SubItems|array}} ||
|-
|-
-
| {{ConfigProperty|TitlePresets|array}} || Набор заголовков над grid и формами редактирования (текст на синем фоне), напр. "'''Editing Order 000554-002 - General'''", "'''Orders (5 of 17)'''".
+
| {{ConfigProperty|TitlePresets|array}} || The set of grid headers and edit window headers (text that's on a blue background). For example, "'''Editing Order 000554-002 - General'''", "'''Orders (5 of 17)'''".
|-
|-
| {{ConfigProperty|EditTabPresets|array}} ||
| {{ConfigProperty|EditTabPresets|array}} ||
Line 65: Line 71:
| {{ConfigProperty|PermTabText|string}} ||
| {{ConfigProperty|PermTabText|string}} ||
|-
|-
-
| {{ConfigProperty|PermSection|array}} || Название [[K4:Добавление секций в дереве|секции]] (в дереве секций в левом frame), которая отвечает за проверку прав доступа к этому unit config, напр. '''<code>Array('main' => 'custom:tests')</code>'''.
+
| {{ConfigProperty|PermSection|array}} || [[K4:Добавление секций в дереве|Section]] name (in the section tree that's in the left frame) that checks access permissions for this unit config. For example, '''<code>Array('main' => 'custom:tests')</code>'''.
|-
|-
-
| [[K4:Добавление секций в дереве|{{ConfigProperty|Sections|array}}]] || Набор [[K4:Добавление секций в дереве|секций]] в дереве из левого frame в административной консоли.
+
| [[K4:Добавление секций в дереве|{{ConfigProperty|Sections|array}}]] || Set of [[K4:Добавление секций в дереве|sections]] in the section tree in the left frame of the Administrative Console.
|-
|-
| {{ConfigProperty|FilterMenu|array}} ||
| {{ConfigProperty|FilterMenu|array}} ||
Line 79: Line 85:
| {{ConfigProperty|ItemSQLs|array}} ||
| {{ConfigProperty|ItemSQLs|array}} ||
|-
|-
-
| {{ConfigProperty|CalculatedFields|array}} || Вычисляемые поля в grid/item.
+
| {{ConfigProperty|CalculatedFields|array}} || Calculated fields in the grid/item.
|-
|-
-
| [[K4:Описание полей таблицы|{{ConfigProperty|Fields|array}}]] || Описание полей из [[#TableName|таблицы]] в базе данных (тип данных, [[K4:Formatters|форматер]] и т. п.).
+
| [[K4:Описание полей таблицы|{{ConfigProperty|Fields|array}}]] || Description of the fields in the database [[#TableName|table]] (data type, [[K4:Formatters|formatter]], etc.).
|-
|-
-
| [[K4:Описание полей таблицы|{{ConfigProperty|VirtualFields|array}}]] || По структуре это такой же массив, как и в опции [[#Fields|Fields]]. Единственное отличие в том, что значения этих полей не будут сохранены в базе данных.
+
| [[K4:Описание полей таблицы|{{ConfigProperty|VirtualFields|array}}]] || The structure of this array is the same as the [[#Fields|Fields]] option. The only difference is that the values of these fields won't be stored in the database.
|-
|-
| {{ConfigProperty|Grids|array}} ||
| {{ConfigProperty|Grids|array}} ||
Line 89: Line 95:
| {{ConfigProperty|ConfigMapping|array}} ||
| {{ConfigProperty|ConfigMapping|array}} ||
|}
|}
 +
 +
[[en:{{FULLPAGENAME}}]]
 +
[[ru:K4:Конфигурационные файлы]]
 +
 +
Translated from: [http://guide.in-portal.org/rus/index.php?title=K4:%D0%9A%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D0%B5_%D1%84%D0%B0%D0%B9%D0%BB%D1%8B&oldid=1069 revision 1069]

Current revision


Unit Configs Unit Configs
Статьи в этой категории

Unit configuration file - this is a file, which containts information about one table in the database and the parameters that are associated with displaying and changing the data that's contained in it. The file is an associative array in which each key is a separate option (the array itself is located in the variable $config). The value of each option can be type available доступного in PHP. The options can be interconnected with one another and their connections can't be determined by analyzing just the unit config file. This is better done by searching the names of these options in the PHP code of K4.

All Standard Options

Option Names Option Descriptions
Prefix (string) The prefix of this unit config (must be unique amongst all unit configs). The contents of this option must follow naming conventions rules.
ItemClass (Array) Registers in the system a connection between a prefix and class for working with the one record in the database.
ListClass (Array) Registers the connection between a prefix and class in the system for the purposes of displaying the contents of a table in the database (filtering, per-page, etc.).
EventHandlerClass (Array) Registers in the system the connection between a prefix and class for the purpose of processing standard events from grids and edit forms.
TagProcessorClass (Array) Registers a connection in the system between a prefix and class for processing standard tags, used for displaying information.
RegisterClasses (Array) Registers any user classes in the system.
AutoLoad (boolean) Automatically loads an item object by ID, which is found in $_REQUEST.
CheckSimulatniousEdit (boolean) Indicates that there must be a check for dual editing for the table that's declared in the configuration file. The check works in the following way:
If one user opens a record for edit, which is already being edited by another user, then the user will be shown a warning that the record he or she has opened is already being edited by another user. The warning will show the user's name and IP address. Available since Core v 5.0.0.
QueryString (array)
RegularEvents (array) Executes the indicated events at the required interval.
PortalStyleEnv (bool) Controls how a prefix's variable will look in an environment variable. If set to "true", then there won't be a hyphen between the prefix and the value of its first variable, i.e. it will be "m5", instead of "m-5" as usual.
CatalogItem (bool)
AdminTemplatePath (string)
AdminTemplatePrefix (string)
SearchConfigPostfix (string)
ConfigPriority (int)
PassPriority (int) Allows setting the order in which a prefix will be shown amongst other prefixes in putting together the value of an environment variable. Available since Core v 5.0.0.
Hooks (array) Allows adding new hooks to the system.
ItemType (int)
ViewMenuPhrase (string)
ItemPropertyMappings (array)
TitlePhrase (string)
IDField (string) Name of the column in the table that holds the primary key. This is usually an integer column using autoincrement.
StatusField (array) List of columns in a table (usually there's only one, for example Array ('Status') or Array ('Enabled')) that affect the icon in each record in an In-Portal grid. The value of this option is also used in Events OnMassApprove and OnMassDecline.
OrderField (string) The name of the field that's used in Events OnMassMoveUp and OnMassMoveDown to change the order in which records are displayed in a grid. If the option isn't set, by default its value will be "Priority".
TitleField (string) The name of the column in the table that will be used as the header of the edit form for that item. Used in option TitlePresets.
TableName (string) The name of the table in the database for which this unit config will be used. For example, TABLE_PREFIX.'Tests'.
SubItems (array)
TitlePresets (array) The set of grid headers and edit window headers (text that's on a blue background). For example, "Editing Order 000554-002 - General", "Orders (5 of 17)".
EditTabPresets (array)
PermItemPrefix (string)
PermTabText (string)
PermSection (array) Section name (in the section tree that's in the left frame) that checks access permissions for this unit config. For example, Array('main' => 'custom:tests').
Sections (array) Set of sections in the section tree in the left frame of the Administrative Console.
FilterMenu (array)
PopulateMlFields (boolean) Указывает на то, должны ли сохраняться значения переводимых полей (напр. пришедших с формы) на языках, отличных от текущего.
ListSQLs (array)
ListSortings (array)
ItemSQLs (array)
CalculatedFields (array) Calculated fields in the grid/item.
Fields (array) Description of the fields in the database table (data type, formatter, etc.).
VirtualFields (array) The structure of this array is the same as the Fields option. The only difference is that the values of these fields won't be stored in the database.
Grids (array)
ConfigMapping (array)

Translated from: revision 1069