K4:Unit Configuration File
From In-Portal Developers Guide
Path to article:
(дополнение) |
Current revision (01:25, 28 November 2010) (view source) (Side-box) |
||
(5 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
- | {{NotFinished}}{{toc | category = Unit Configs | sortkey = 000.001}}'''Unit | + | {{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}} || | + | | {{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}}]] || | + | | [[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}}]] || | + | | [[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}}]] || | + | | [[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}}]] || | + | | [[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|RegisterClasses|Array}}]] || | + | | [[K4:Регистрация классов|{{ConfigProperty|RegisterClasses|Array}}]] || Registers any user classes in the system. |
|- | |- | ||
- | | {{ConfigProperty|AutoLoad|boolean}} || | + | | {{ConfigProperty|AutoLoad|boolean}} || Automatically loads an <code>item</code> object by ID, which is found in <code>$_REQUEST</code>. |
|- | |- | ||
- | | {{ConfigProperty|CheckSimulatniousEdit|boolean}} || | + | | {{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}} || | + | | {{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 37: | Line 39: | ||
| {{ConfigProperty|ConfigPriority|int}} || | | {{ConfigProperty|ConfigPriority|int}} || | ||
|- | |- | ||
- | | {{ConfigProperty|PassPriority|int}} || | + | | {{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}}]] || | + | | [[K4:Hooks|{{ConfigProperty|Hooks|array}}]] || Allows adding new hooks to the system. |
|- | |- | ||
| {{ConfigProperty|ItemType|int}} || | | {{ConfigProperty|ItemType|int}} || | ||
Line 49: | Line 51: | ||
| {{ConfigProperty|TitlePhrase|string}} || | | {{ConfigProperty|TitlePhrase|string}} || | ||
|- | |- | ||
- | | {{ConfigProperty|IDField|string}} || | + | | {{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}} || | + | | {{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}} || | + | | {{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}} || | + | | {{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}} || | + | | {{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}} || | + | | {{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 69: | Line 71: | ||
| {{ConfigProperty|PermTabText|string}} || | | {{ConfigProperty|PermTabText|string}} || | ||
|- | |- | ||
- | | {{ConfigProperty|PermSection|array}} || | + | | {{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:Добавление секций в дереве|{{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 83: | Line 85: | ||
| {{ConfigProperty|ItemSQLs|array}} || | | {{ConfigProperty|ItemSQLs|array}} || | ||
|- | |- | ||
- | | {{ConfigProperty|CalculatedFields|array}} || | + | | {{ConfigProperty|CalculatedFields|array}} || Calculated fields in the grid/item. |
|- | |- | ||
- | | [[K4:Описание полей таблицы|{{ConfigProperty|Fields|array}}]] || | + | | [[K4:Описание полей таблицы|{{ConfigProperty|Fields|array}}]] || Description of the fields in the database [[#TableName|table]] (data type, [[K4:Formatters|formatter]], etc.). |
|- | |- | ||
- | | [[K4:Описание полей таблицы|{{ConfigProperty|VirtualFields|array}}]] || | + | | [[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 93: | 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
This article is not finished yet! You see this message because current Article is finished yet or contains unverified information. How to write an Article. |
| ||
---|---|---|
Статьи в этой категории | ||
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