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

Jump to: navigation, search

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