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

The AMI_Mod class

• Introduction

Module action controller.

• Class synopsis

AMI_Mod {
/* Constants */
// Component opton specifying to init component directly on start
const AMI_Mod::INIT_ON_START =  0x01;
// Actions sign expiration time
const AMI_Mod::SIGN_EXPIRATION =  7;
/* Properties */
// Components options
protected array $aComponentsOptions = array();
// Path to status message locales
protected string $statusMessagePath = '';
/* Methods */
// Constructor.
public __construct ( $oRequest, $oResponse ) returns AMI_Mod;
// Destructor.
public __destruct ( ) returns void;
// Adds module component.
public addComponent ( $oComponent, [ string $serialId = null ], [ $aOptions = array() ] ) returns AMI_Mod;
// Adds module components by its types.
public addComponents ( $aComponents, [ $aOptions = array() ] ) returns AMI_Mod;
// Fires to dispatch module controller action.
public dispatch ( mixed $action ) returns void;
// Returns client locale path.
public getClientLocalePath ( ) returns string;
// Returns module id.
public getModId ( ) returns string;
// Returns module state object.
public getModState ( ) returns AMI_ModState;
// Called before initialization module component.
public init ( ) returns void;
// Called before module controller components initialization.
public initComponents ( ) returns void;
// Removes module components by its types.
public removeComponents ( $aTypes ) returns AMI_Mod;
// Set module id.
public setModId ( string $modId ) returns void;
}
Tags:
todo Decsribe methods
abstract
since 5.12.0

• Class Constants

INIT_ON_START

Component opton specifying to init component directly on start

SIGN_EXPIRATION

Actions sign expiration time

• Class Properies

protected array $aComponentsOptions

Components options

protected string $statusMessagePath

Path to status message locales

• Class Methods

// Destructor.
public __destruct ( ) returns void;

Overridden in child classes as: AMI_Module_Frn::__destruct().

Tags:
since 6.0.2
// Adds module component.
public addComponent ( $oComponent, [ string $serialId = null ], [ $aOptions = array() ] ) returns AMI_Mod;
  • AMI_iModComponent $oComponent
    Module component controller
  • string $serialId
    Component serial id (optional)
  • array $aOptions
    Component options (optional)
  Example:
  •  class AmiSample_Adm extends AMI_Mod{
  •      // ...
  •      public function __construct(AMI_Request $oRequestAMI_Response $oResponse){
  •          parent::__construct($oRequest$oResponse);
  •          $this->addComponent(AMI::getResource($this->getModId('/' $this->getType(.'/controller/adm'));
  •      }
  •      // ...
  •  }
Tags:
see AMI_Mod::addComponents()
todo Describe $aOptions parameter
// Adds module components by its types.
public addComponents ( $aComponents, [ $aOptions = array() ] ) returns AMI_Mod;
  • array $aComponents
    Components to add
  • array $aOptions
    Components options, will be described later (since 5.14.6)
  Example:
  •  class AmiSample_Adm extends AMI_Mod{
  •      // ...
  •      public function __construct(AMI_Request $oRequestAMI_Response $oResponse){
  •          parent::__construct($oRequest$oResponse);
  •          // Add following components: 'filter', 'list', 'form'
  •          $this->addComponents(array('filter''list''form'));
  •      }
  •      // ...
  •  }
Tags:
todo Describe $aOptions parameter
// Fires to dispatch module controller action.
public dispatch ( mixed $action ) returns void;
// Returns client locale path.
public getClientLocalePath ( ) returns string;

Overridden in child classes as: AMI_Module_Frn::getClientLocalePath(), AmiSample_Adm::getClientLocalePath().

Used to override default admin JavaScript controller messages.
See example locale "client.lng".

  Example:
  •  // AmiSample_Adm::getClientLocalePath()
  •  public function getClientLocalePath(){
  •      return '_local/plugins_distr/' $this->getModId(.  '/templates/client.lng';
  •  }
Tags:
example example
// Returns module id.
public getModId ( ) returns string;
// Returns module state object.
public getModState ( ) returns AMI_ModState;
// Called before initialization module component.
public init ( ) returns void;

Overridden in child classes as: AMI_Module_Frn::init(), Hyper_AmiMultifeeds_Frn::init().

// Called before module controller components initialization.
public initComponents ( ) returns void;
Tags:
// Removes module components by its types.
public removeComponents ( $aTypes ) returns AMI_Mod;
  • array $aTypes
    Component types
  Example:
  •  class AmiSample_Adm extends AmiParent_Adm{
  •      // ...
  •      public function __construct(AMI_Request $oRequestAMI_Response $oResponse){
  •          parent::__construct($oRequest$oResponse);
  •          // Remove following components: 'filter'
  •          $this->removeComponents(array('filter'));
  •      }
  •      // ...
  •  }
Tags:
since 5.12.4
// Set module id.
public setModId ( string $modId ) returns void;
  • string $modId
    Module id