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

The AMI_ModListActions class

• Introduction

List action controller.

• Class synopsis

AMI_ModListActions {
/* Properties */
// Action event data
protected array $aEvent;
/* Methods */
// Dispatches 'delete' action.
public dispatchDelete ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Dispatches 'public' action.
public dispatchPublic ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Dispatches 'unpublic' action.
public dispatchUnPublic ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Refreshes list view.
public refreshView ( ) returns void;
// Stores action event data for posterior usage.
public setActionData ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Changes one field of table item & save it.
protected changeItemFlag ( string $id, string $flag, string $value ) returns AMI_ModTableItem;
// Returns corresponding table item model.
protected getItem ( string $id, [ $aFields = array('*') ] ) returns AMI_ModTableItem;
// Returns 'id' parameter from request.
protected getRequestId ( ) returns string;
}
Tags:
resource list/actions AMI::getResource('list/actions')
since 5.12.0

• Class Properies

protected array $aEvent

Action event data

• Class Methods

// Dispatches 'delete' action.
public dispatchDelete ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
// Dispatches 'public' action.
public dispatchPublic ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
Event handler.
Publishes item (sets 'public' field to 1).
// Dispatches 'unpublic' action.
public dispatchUnPublic ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
Event handler.
Unpublishes item (sets 'public' field to 0).
// Refreshes list view.
public refreshView ( ) returns void;
// Stores action event data for posterior usage.
public setActionData ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
  • string $name
    Event name
  • array $aEvent
    Event data
  • string $handlerModId
    Handler module id
  • string $srcModId
    Source module id
Event handler.
Tags:
see AMI_ModListAdm::addActionCallback()
see AMI_Event::addHandler()
see AMI_Event::fire()
see AMI_ModListAdm::addColActions()
see AMI_ModListAdm::addActions()
// Changes one field of table item & save it.
protected changeItemFlag ( string $id, string $flag, string $value ) returns AMI_ModTableItem;
  • string $id
    Item primary key
  • string $flag
    Flag
  • string $value
    Value
  Example:
  •      // ...
  •      public function dispatchPublic($namearray $aEvent$handlerModId$srcModId){
  •          $this->changeItemFlag($this->getRequestId()'public'1);
  •          $aEvent['oResponse']->addStatusMessage('status_publish');
  •          $this->refreshView();
  •          return $aEvent;
  •      }
// Returns corresponding table item model.
protected getItem ( string $id, [ $aFields = array('*') ] ) returns AMI_ModTableItem;
  • string $id
    Item primary key
  • array $aFields
    Fields to load (since 5.12.8)
// Returns 'id' parameter from request.
protected getRequestId ( ) returns string;