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
Current revision (01:25, 28 November 2010) (view source)
(Side-box)
 
(2 intermediate revisions not shown.)
Line 1: Line 1:
-
{{NotFinished}}{{toc | category = Unit Configs | sortkey = 000.001}}'''Unit config''' - '''Unit config''' - 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.
+
{{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 ==
== All Standard Options ==
Line 56: Line 57:
| {{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|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 70: 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 84: 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 94: 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