Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

Event List

Event name Module id Description
Parameters
typevariabledescription
Callers
after_list_columns $modId Allows to modify async list columns.
array &columns Reference to array of columns
AMI_ModListView_JSON::get()
dispatch_mod_action $modId Fires to dispatch module controller action.
string action Action
AMI_Response oResponse Response object
AMI_Request oRequest Request object
string tableModelId Table model resource id
AMI_Mod|null oController Module controller object
string modId Module id
AMI_Mod::dispatch()
dispatch_mod_action_form_edit $modId Processing controller actions of the AMI_Mod module.
string action Action Name
AMI_Response oResponse Response object
AMI_Request oRequest Request object
string tableModelId Table Model Id
AMI_Mod oController Module controller object
string modId Module id
dispatch_mod_action_list_view $modId List view module controller action.
string action Action
AMI_Response oResponse Response object
AMI_Request oRequest Request object
string tableModelId Table model resource id
AMI_Mod|null oController Module controller object
string modId Module id
AMI_ModListActions::refreshView()
dispatch_mod_action_{type} $modId Processing controller actions of the AMI_Mod module.
AMI_Response oResponse Response object
AMI_Request oRequest Request object
string tableModelId Table model resource id
AMI_Mod|null oController Module controller object
string modId Module id
dispatch_request $modId Request processing controller module.
on_add_field_mapping $modId Allows extensions to add mapping database fields.
array aFields Array of fields
AMI_ModTable oTable Table model object (since 6.0.2)
AMI_ModTable::addFieldsRemap()
on_add_status_message AMI_Event::MOD_ANY Called when status message added.
array aParams Status message scope
string type Status message type, AMI_Response constants: STATUS_MESSAGE | STATUS_MESSAGE_WARNING | STATUS_MESSAGE_ERROR
string key Status message key from locales
string modId Module id
AMI_Response::addStatusMessage()
on_after_delete_model_item $modId Called after model item deletion.
array aData Table item raw data
AMI_ModTableItem oItem Table item model
AMI_ModTable oTable Table model
AMI_ModTableItemModifier::delete()
on_after_init_componets
since 5.14.8
$modId Called before module controller components initialization.
&array aOptions Array with components options structure
&array aComponents Array with components structure
AMI_Mod oController Module controller object
string componentId Current component id
AMI_Mod::initComponents()
on_after_save_model_item $modId Allows perform actions after creating / updating item
bool success TRUE on success
array aData Table item raw data
AMI_ModTableItem oItem Table item model
AMI_ModTable oTable Table model
bool nCreate TRUE on new item creation, FALSE on existing item saving
AMI_ModTableItemModifier::save()
on_before_add_{$ruleName}_rule $modId Fires before adding a module rule
CMS_ModuleRules oRuleMod Module rules object
AMI_Module oMod Module object
mixed defaultValue Default rule value
mixed aOptions Rule options
string type Rule type
string name Rule name
AMI_Module::addRule()
on_before_delete_model_item
since 6.0.6
$modId Called before model item deletion.

Set $aEvent['_discard'] to TRUE to discard action.

bool _discard Set to TRUE to discard action
mixed id Table item Id to delete
AMI_ModTableItem oItem Table item model
AMI_ModTableItem::delete()
on_before_form_field_{fieldName} $modId Allows change field at displaying form.
AMI_iFormModTableItem oItem Table item object
AMI_Template oTpl Template object
array aScope Scope
array aField Form field structure
AMI_ModFormView::getFieldHTML()
on_before_init_componets
since 5.14.8
$modId Called before module controller components initialization.
&array aOptions Array with components options structure
&array aComponents Array with components structure
AMI_Mod oController Module controller object
string componentId Current component id
AMI_Mod::initComponents()
on_before_save_model_item $modId Allows change data model before create / update item.
array aData Table item raw data
AMI_ModTableItem oItem Table item model
AMI_ModTable oTable Table model
bool onCreate TRUE on new item creation, FALSE on existing item saving
AMI_ModTableItemModifier::save()
on_before_seo_process $modId Called before SEO processing.
AMI_Mod oController Module controller object
string modId Module Id
AMI_Module_Frn::processSEO()
on_before_set_data_model_item $modId Fires before setting new table item values.
AMI_ModTable oTable Table model
bool &doAppend Do append values or clear values before setting
AMI_ModTableItem oItem Table item model
array aData New values
AMI_ModTableItem::setData()
on_before_set_values_model_item $modId Fires before setting new table item values.
AMI_ModTableItem oItem Table item model
array aData New values
AMI_ModTableItem::setValues()
on_before_view_* $modId Allows to modify view scope.
array aLocale Locales
AMI_View oView View object
string modId Module id
array aScope Scope
string block Block name
string type View type
AMI_View::getScope()
on_data_exchange_export_item
since 5.14.8
AMI_Event::MOD_ANY Allows to modify item data on export, forbid to export item setting $aEvent['_break'], interrupt export setting $aEvent['_result'] as FALSE.
array &aItem Module item data
int itemId Module item id
string modId Module id
string driver Driver name
on_data_import_driver_before_save_item
since 6.0.2
----- Fires before saving item during working of data import driver.
AMI_ModTableItem oItem Table item model
on_dataexchange_export_sql
since 6.0.6
AMI_Event::MOD_ANY Allows to customize SQL query to export products.

function cstHandleDataExchangeExportSQL($name, array $aEvent, $handlerModId, $srcModId){
    $pfx = $aEvent['aSQL]['default_prefix'];
    // select extra field `id_owner`
    $aEvent['aSQL]['select'] .= ', ' . $pfx . 'id_owner';
    // select products having `price` > 1000 only
    $aEvent['aSQL]['where'] .= ' AND ' . $pfx . 'price > 1000';
    // limit selection to 100 products
    $aEvent['aSQL]['limit'] = 'LIMIT 100';
    // JOIN query part
    // $aEvent['aSQL]['join']

    return $aEvent;
}

AMI_Event::addHandler('on_dataexchange_export_sql', 'cstHandleDataExchangeExportSQL', AMI_Event::MOD_ANY);

&array aSQL Array of SQL query parts
string modId Module id
on_dataexchange_get_tpl_set_name
since 6.0.6
AMI_Event::MOD_ANY Allows to change name of template set for next exchange drivers: Yandex.Market, Rambler, IRR.

function cstHandleDataExchangeGetTplSetName($name, array $aEvent, $handlerModId, $srcModId){
    if(
        in_array($aEvent['driverName'], array('YandexEshopDriver', 'RapidYandexEshopDriver') AND
        'export' === $aEvent['exchangeType'] AND
        'eshop_item' === $aEvent['modId'] AND
        'product' === $aEvent['type']
    ){
        $aEvent['setName'] = 'item_row_my_custom';
    }

    return $aEvent;
}

AMI_Event::addHandler('on_dataexchange_get_tpl_set_name', 'cstHandleDataExchangeGetTplSetName', AMI_Event::MOD_ANY);

&string setName Name of template set
string type Type of template set
string modId Module id
string exchangeType Exchange type
string driverName Driver name
on_file_download
since 6.0.4
AMI_Event::MOD_ANY Fires when file is downloading using "ftpgetfile.php" script.

Setting "errorCode" will return appropriate error and deny downloading.
Possible values / HTTP code: * wrong_request - "Wrong request" (400); * not_logged_in - "You are not registered" (401); * access_denied - "Access denied" (403); * no_attempts - "The quantity of loadings is exhausted" (403); * order_expired - "The time for loadings has expired" (403); * not_found - "File not found" (404); * unknown_file - "Unknown file" (404); * not_installed - "This functionality is inaccessible" (404).

string errorCode Error code, empty string by default
int itemId Module item id
string modId Module id
on_file_move $modId Called before file move.
string newName New filename
string targetPath Target dir path
AMI_iFile oFile File Object
AMI_ModTableItem oItem Item Object
on_filter_init $modId Called when the controller is initialized filter components that can handle the filter component.
AMI_Filter oFilter Filter object
AMI_ModFilter::init()
on_form_field_{fieldName} $modId Allows to modify form fields before displaying.
AMI_iFormModTableItem oItem Table item model
AMI_Template oTpl Tamplate object
array aScope Scope
array aField Form field structure
AMI_ModFormView::getFieldHTML()
on_form_fields_{viewType} $modId Allows modify list of form fields.
AMI_iFormModTableItem oItem Table item model
AMI_ModFormView oFormView Form view object
array aScope Scope
AMI_ModFormView::get()
on_get_available_fields $modId Allows modify list of fields available from AMI_ModTable::getAvailableFields(true), AMI_ModTableList::getAvailableFields(true).
array aFields Array of fields
AMI_ModTable::getAvailableFields()
on_get_date_format AMI_Event::MOD_ANY Called before the return date / time format.
array date_format Array of date formats for all possible locales
string ret_locale Target locale
string locale Current locale
AMI::getDateFormat()
on_get_id_page $modId Call when receive page ID.
AMI_ModTableItem oItem Table item model
int/null pageId Page id
AMI_ModTableItem::getFrontLink()
on_get_nav_data $modId Called when received the data to generate a reference to the element.
AMI_ModTableItem oItem Table item model
array aNavData Internal navigation data
array aNavModNames Internal navigation structure
AMI_ModTableItem::getURL()
on_get_status_messages AMI_Event::MOD_ANY Called when received an array of status messages.
array aStatusMessages Array of status messages
AMI_Response::getJSONResponse()
on_get_validators $modId Allows to modify table item model validators.
AMI_ModTable oTable Table model
string modId Module id
AMI_ModTable::getValidators()
on_item_details ----- Allows to modify item details data.
string block Template block name
AMI_ModTableItem oItem Table item model
array &aData Item data
array &aScope Scope
AMI_ModDetailsView::get()
on_item_sublink_generation $modId Called when generating a table item model sublink.
string link New link
array aData Data array
AMI_ModTable oTable Table model
bool onCreate TRUE on new item creation, FALSE on existing item saving
AMI_ModTableItemMeta::processSublink()
on_list_add_columns $modId Event, called to add columns to a list.
array aColumns Array of columns
AMI_ModTableList oList Table l;ist model
AMI_ModTable oTable Table model
AMI_ModListView::get()
on_list_body_row $modId Allows modify the data line of the list.
AMI_ModTableItem oItem Table item model
array aScope Scope
AMI_ModListView::get()
on_list_body_{item} $modId Allows modify the value of a cell in the list.
AMI_ModTableItem oItem Table item model
array aScope Scope
AMI_ModListView::get()
on_list_columns $modId Allows modify list of columns in list of elements.
array aColumns Array of columns
AMI_ModListView::get()
on_list_group_actions $modId Allows to modify group actions list.
array &aGroupActions Group actions
AMI_ModListAdm oView View object
AMI_ModListAdm::getGroupActions()
on_list_header $modId Allows modify list's header.
array aScope Scope
AMI_ModListView::get()
on_list_init $modId Called when list initialization.
DB_Query oQuery DBQuery object
AMI_ArrayIterator oTable Iterator
AMI_ArrayIteratorList oList List Iterator
string modId Module Id
AMI_ArrayIteratorList::__construct()
on_list_locate_pos $modId Calls before location of item position in list.
array aColumns Columns
string orderDirection Order direction
string orderColumn Order column name
string apliedId Applied item id
AMI_ModTable oTable Table item model
AMI_ModListView_JSON::get()
on_list_recordset $modId Allows to manipulate with elements list's request (object of class DB_Query).
AMI_FileIteratorList oList Table list model
string modId Module Id
on_list_recordset_loaded $modId Called after recordset initialization, if included counting the number of entries. Allows obtain a number of records..
AMI_ModTableList oList List object (since 5.14.8)
int numberOfFoundRows Number of found rows
string modId Module Id
AMI_ModTableList::load()
on_list_sort_columns $modId Event, called to sort columns in a list.
array aColumns Array of Columns
AMI_ModListView oView View Model
AMI_ModListView::getSortColumns()
on_list_view $modId Allows modify the value of header, body and footer of list.
array aScope Contents header, body, footer
AMI_ModListView::get()
on_mod_post_init $modId Called after initialization module component.
AMI_Response oResponse Response object
AMI_Request oRequest Request object
string tableModelId Table model resource id
AMI_Mod|null oController Module controller object
string modId Module id
AMI_Mod::init()
on_mod_pre_init $modId Called before initialization module component.
AMI_Response oResponse Response object
AMI_Request oRequest Request object
string tableModelId Table model resource id
AMI_Mod|null oController Module controller object
string modId Module id
AMI_Mod::init()
on_module_{$type}_response_type $modId Allows to alternate specified response type data before module output.
bool skip Skip this response type (default: true)
string type Response type
array aData Module data
AMI_ModCommonViewFrn::outType()
on_order_after_status_change
since 6.0.4
AMI_Event::MOD_ANY Allows to do some action afetr E-shop order status changed.
array aParams Order parameters
AmiClean_EshopOrder_TableItem oItem Order table item model
string status New status of order
on_order_before_create
since 6.0.6
AMI_Event::MOD_ANY Allows to modify E-shop some order data before order creation.
float &total Total order cost
float &shipping Shipping cost
string &comments Order comments
string &company Buyer company name
string &lastname Buyer last name
string &firstname Buyer firs tname
string &header Order header
string &status New status of order
on_order_before_status_change
since 6.0.4
AMI_Event::MOD_ANY Allows to modify E-shop order status or discard action.

Set $aEvent['_discard'] to TRUE to discard action.

bool _discard Set to TRUE to discard action
array &aParams Order parameters
AmiClean_EshopOrder_TableItem oItem Order table item model
string &status New status of order
on_pkg_action AMI_Event::MOD_ANY Allows to modify or discard package manipulation action.

Set $aEvent['_discard'] to TRUE to discard action.

AMI_Tx oTx Transaction object
array aArgs Transaction arguments
string action Transaction action
AMI_Package_Manipulator::doActions()
on_post_process_fields $modId Called after front data processing.
array &aScope Scope
array &aItem Item data
string bodyType Body type
AMI_ModCommonViewFrn::processFields()
on_query_add_joined_columns $modId Event, called for add columns to the query result, a compound derived from the dependent model.
string alias Model alias
AMI_ModTableList oList Table list model
AMI_ModTable oTable Table model
DB_Query oQuery DB query object
string modId Module id
AMI_ModTable::getQueryBase()
on_query_add_table $modId Allow to modify DB query object.
string alias Model alias
AMI_ModTable oTable Table model
DB_Query oQuery DB query object
string modId Module id
AMI_ModTable::getQueryBase()
on_query_add_table AMI_Event::MOD_ANY Allow to modify DB query object.
string alias Model alias
AMI_ModTable oTable Table model
DB_Query oQuery DB query object
string modId Module id
AMI_ModTable::getQueryBase()
on_rate ext_rating Allows to collect information about ratings in Raeting extension.
string vid Site visitor id
int userId Authorized user id or 0 if not authorized
string rating Passed rating
int itemId Module item id
string modId Module id
on_response_send AMI_Event::MOD_ANY Allows receive information and modify headers buffered response, change response content.
array aHTTPHeaders Array of HTTP headers
string &content Content
bool isBuffered TRUE if response is buffered
string type Response type
AMI_Response::send()
on_response_start AMI_Event::MOD_ANY Allows receive information and modify headers of answer.
array aHTTPHeaders Array of HTTP headers
bool isBuffered Buffering
string type Type
AMI_Response::start()
on_rollback_save_model_item $modId Allows rollback saved model item.
bool success TRUE on success
array aData Table item raw data
AMI_ModTableItem oItem Table item model
AMI_ModTable oTable Table model
bool onCreate TRUE on new item creation, FALSE on existing item saving
AMI_ModTableItemModifier::rollback()
on_save_validate_{validator} $modId Allows add custom data validator.
AMI_ModTableItemModifier oTableItemModifier Table item modifier object
AMI_ModTable oTable Table object
AMI_ModTableItem oItem Table item object
mixed value Value of field
string field Field name
AMI_ModTableItemModifier::validate()
on_sort_columns $modId Allows modify list of sortable columns in list.
AMI_ModTableList oList Table list model
array aColumns Array of columns
AMI_ModListView_JSON::get()
on_table_get_item $modId Called when receive array of validators, allow add own validators.
AMI_ArrayIterator oTable Iterator model
string modId Module Id
AMI_ArrayIterator::getItem()
on_table_get_item_post $modId Called when receive array of validators, allow add own validators.
AMI_ArrayIteratorItem oItem Iterator item model
AMI_ArrayIterator oTable Iterator model
string modId Module Id
AMI_ArrayIterator::getItem()
on_table_get_list $modId Called before list request.
AMI_ArrayIterator oTable Iterator model
string modId Module Id
AMI_ArrayIterator::getList()
on_tx_command AMI_Event::MOD_ANY Allows to modify or discard transacton command.

Set $aEvent['_discard'] to TRUE to discard command.

AMI_Tx_Cmd_Args oArgs Transaction command arguments
AMI_Tx_Cmd oTx_Cmd Transaction command object
mixed caller Callback
AMI_Tx_Cmd::__construct()
on_webservice_start ----- Event to set any initial data.
AmiClean_Webservice_Service oWebservice Webservice service object
string action Action
on_webservice_{action}_action $modId Calls webservice action handler.
string errorMessage Error message
string errorCode Error code
set_global_filter_{FilterType} AMI_Event::MOD_ANY Called when a global filter type {FilterType}.
v5_on_apply_data
since 6.0.2
AMI_Event::MOD_ANY CustomApplyVars() function replacement ("_local/admin_functions.php", "_local/front_functions.php").
Set up '_skip' event array key to "return FALSE" from function.
int pageId Page Id (was $pageId argument)
mixed &aData Data (was $aVars argument)
mixed oObject Object (was $vObject argument)
string type Data type (was $cThread argument)
v5_on_before_init
since 6.0.2
AMI_Event::MOD_ANY EventInitBefore() function replacement ("_local/admin_functions.php", "_local/front_functions.php").
CMS_Base oObject Core v5 CMS object (was $vObject argument)
v5_on_before_save_cached_page
since 6.0.2
AMI_Event::MOD_ANY CacheSavePageBefore() function replacement ("_local/common_functions.php").
Set up '_skip' event array key to "return FALSE" from function.
int &pageId Found page Id (was $foundPageId argument)
string &pageUIN Page UIN (was $Pageuin argument)
CMS_Cache oObject Cache object (was $vObject argument)
v5_on_item_prepare
since 6.0.6
AMI_Event::MOD_ANY Fires on before prepare item data for saving.
array aData Array of item data
int itemId Item Id
string modId Module Id
v5_on_set_page_size
since 6.0.6
AMI_Event::MOD_ANY Fires on before front list page size set.
int pageSize Number of items on page
string modId Module Id
v5_on_show_page_size
since 6.0.6
AMI_Event::MOD_ANY Fires on before front list page size control show.
array aPageSizes Array of page sizes
bool enabled Is page