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

The AMI_ModCommonViewFrn class

AMI_View
   |
   --AMI_ModCommonViewFrn

• Introduction

Module common front view.

• Class synopsis

AMI_ModCommonViewFrn extends AMI_View {
/* Properties */
// Browser related data
protected array $aBrowser = array( 'mode' => 'page', // Browsing type: page, tape 'pageSize' => 10, // Items per page 'offset' => 0, // Item list offset 'catoffset' => 0, // Category list offset 'offsetVar' => 'offset', // Item list offset variable name 'catoffsetVar' => 'catoffset', // Category list offset variable name 'currentItemOffset' => 0, // Current item offset, used in the 'tape' mode 'listStart' => 0, // List start position 'listLimit' => 0, // List limit 'orderColumn' => 'id', // List order column 'orderDirection' => 'asc', // List order direction 'navData' => '?', // Pagination navigation data 'useSpecView' => FALSE, // Spicifies if special list view // (public direct link/sticky) is used 'cols' => 1, // List colimns number 'forceViewEndLink' => FALSE, // Used by forum 'tapePosition' => 0 // Tape position, used in the 'tape' mode );
// Array of fields data
protected array $aFields = array();
// Array of links data
protected array $aFrontScope = array();
// Array of simple set fields
protected array $aSimpleSetFields = array();
// Structure containing template set prefixes
protected array $aTplData;
// Body type
protected string $bodyType;
// Module id
protected string $modId;
// Template engine object
protected AMI_Template $oTpl;
// Pagination block name
protected string $paginationBlockName = '_pager';
// Pagination template name
protected string $paginationTemplate = 'templates/pager.tpl';
/* Inherited Properties */
// Locale
protected AMI_View::$aLocale = array();
// Scope
protected AMI_View::$aScope = array();
// Locale file name
protected AMI_View::$localeFileName = '';
// Model
protected AMI_View::$oModel = null;
// Template block name
protected AMI_View::$tplBlockName = '';
// Template file name
protected AMI_View::$tplFileName = '';
/* Methods */
// Constructor.
public __construct ( ) returns AMI_ModCommonViewFrn;
// Applies simple sets to specified simple items on frontend.
public applySimpleSetsCB ( &$aItem, &$aData ) returns void;
// Fill the item fields.
public drawItemCB ( &$aItem, &$aData ) returns void;
// Fills empty description.
public fillEmptyDescription ( &$aItem, [ bool $isCat = FALSE ], [ bool $usePrefix = TRUE ] ) returns void;
// Stub.
public get ( ) returns void;
// Returns browsing related data.
public getBrowserData ( ) returns array;
// Returns part of front scope.
public getFrontScope ( ) returns array;
// Generates navigation data.
public getNavDataCB ( &$aItem, &$aData ) returns void;
// Returns list pagination.
public getPagination ( $aParams, AMI_ModTableList $oList ) returns string;
// Generates previous/next links.
public getPrevNextLinksCB ( &$aItem, &$aData ) returns void;
// Appends splitter to list.
public getSplitterCB ( &$aItem, &$aData ) returns void;
// Returns template set prefixes/names.
public getTplData ( ) returns array;
// Sets global body type.
public handleAfterInitComponents ( string $name, $aEvent, string $handlerModId, string $srcModId ) returns array;
// Initialize view by body type.
public initByBodyType ( string $type, $aSimpleSetFields ) returns void;
// Outputs data using specified response type.
public outType ( $aData, [ string $type = 'json' ] ) returns void;
// Parses set from template data and returns the result as a string.
public parseTpl ( string $setName, [ $aScope = array() ] ) returns string;
// Process fields by callbacks.
public processFields ( &$aItem, &$aScope ) returns void;
// Sets body type.
public setBodyType ( string $bodyType ) returns AMI_ModCommonViewFrn;
// Sets browsing related data.
public setBrowserData ( $aData ) returns void;
// Sets field callback.
public setFieldCallback ( string $field, [ callback $aCallback = null ] ) returns void;
// Set module id.
public setModId ( string $modId, [ string $tplFileName = '' ] ) returns void;
// Returns module id.
protected getModId ( ) returns string;
// Sets up browsing according to options/state.
protected setupList ( ) returns void;
// Sets up template data.
protected setupTplData ( string $prefix, [ $aTplData = array() ] ) returns void;
/* Inherited Methods */
// Constructor.
public AMI_View::__construct ( ) returns AMI_View;
// Adds locale.
public AMI_View::addLocale ( $aLocale, [ bool $doOverwrite = true ] ) returns AMI_View;
// Adds script code.
public AMI_View::addScriptCode ( string $code ) returns AMI_View;
// Adds script file.
public AMI_View::addScriptFile ( string $file ) returns AMI_View;
// Returns view data.
public AMI_View::get ( ) returns mixed;
// Initialize, processing after setting model.
public AMI_View::init ( ) returns AMI_View;
// Adds locale from resource.
public AMI_View::setModel ( mixed $oModel, [ $aLocale = array() ], string $path ) returns AMI_View;
// Set module id.
public AMI_View::setModId ( string $modId ) returns void;
// Sets view scope.
public AMI_View::setScope ( $aScope ) returns AMI_View;
protected AMI_View::addOpenGraphTags ( $header, $description, [ $image = '' ] ) returns void;
// Returns module id.
protected AMI_View::getModId ( ) returns string;
// Returns module specific locale path.
protected AMI_View::getModLocalePath ( ) returns string;
// Returns prepared view scope.
protected AMI_View::getScope ( string $type, [ $aScope = array() ] ) returns array;
// Returns template object.
protected AMI_View::getTemplate ( ) returns AMI_iTemplate;
// Parses block template and returns the result as a string.
protected AMI_View::parse ( string $setName, [ $aScope = array() ] ) returns string;
// Sets up model object.
protected AMI_View::_setModel ( mixed $oModel ) returns AMI_View;
}

• Class Details

Supports simple sets, pagination.
Tags:
resource 'module/common/view/frn' AMI::getSingleton('module/common/view/frn')
since 5.14.8

• Class Properies

protected array $aBrowser

Browser related data

protected array $aFields

Array of fields data

protected array $aFrontScope

Array of links data

protected array $aSimpleSetFields

Array of simple set fields

protected array $aTplData

Structure containing template set prefixes

protected string $bodyType

Body type

protected string $modId

Module id

protected AMI_Template $oTpl

Template engine object

protected string $paginationBlockName

Pagination block name

protected string $paginationTemplate

Pagination template name

• Class Methods

// Constructor.
public __construct ( ) returns AMI_ModCommonViewFrn;

Overrides: AMI_View::__construct().

Tags:
todo SEO check
// Applies simple sets to specified simple items on frontend.
public applySimpleSetsCB ( &$aItem, &$aData ) returns void;
  • array &$aItem
    Item data
  • array &$aData
    List data
// Fill the item fields.
public drawItemCB ( &$aItem, &$aData ) returns void;
  • array &$aItem
    Item data
  • array &$aData
    List data
// Fills empty description.
public fillEmptyDescription ( &$aItem, [ bool $isCat = FALSE ], [ bool $usePrefix = TRUE ] ) returns void;
  • array &$aItem
    Item data
  • bool $isCat
    Specifies to use field 'cat_' prefix / module '_cat' postfix
  • bool $usePrefix
    Specifies to use field 'cat_' prefix
// Stub.
public get ( ) returns void;

Overrides: AMI_View::get().

// Returns browsing related data.
public getBrowserData ( ) returns array;
// Returns part of front scope.
public getFrontScope ( ) returns array;
// Generates navigation data.
public getNavDataCB ( &$aItem, &$aData ) returns void;
  • array &$aItem
    Item data
  • array &$aData
    List data
// Returns list pagination.
public getPagination ( $aParams, AMI_ModTableList $oList ) returns string;
// Generates previous/next links.
public getPrevNextLinksCB ( &$aItem, &$aData ) returns void;
  • array &$aItem
    Item data
  • array &$aData
    List data
// Appends splitter to list.
public getSplitterCB ( &$aItem, &$aData ) returns void;
  • array &$aItem
    Item data
  • array &$aData
    List data
// Returns template set prefixes/names.
public getTplData ( ) returns array;
// Sets global body type.
public handleAfterInitComponents ( 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
// Initialize view by body type.
public initByBodyType ( string $type, $aSimpleSetFields ) returns void;
  • string $type
    Body type
  • array $aSimpleSetFields
    Simple set field list
// Outputs data using specified response type.
public outType ( $aData, [ string $type = 'json' ] ) returns void;
  • array $aData
    Module data
  • string $type
    Response type
// Parses set from template data and returns the result as a string.
public parseTpl ( string $setName, [ $aScope = array() ] ) returns string;
  • string $setName
    Set name
  • array $aScope
    Scope
// Process fields by callbacks.
public processFields ( &$aItem, &$aScope ) returns void;
  • array &$aItem
    Item data
  • array &$aScope
    Scope
// Sets body type.
public setBodyType ( string $bodyType ) returns AMI_ModCommonViewFrn;
  • string $bodyType
    Page body type
// Sets browsing related data.
public setBrowserData ( $aData ) returns void;
  • array $aData
    Data
// Sets field callback.
public setFieldCallback ( string $field, [ callback $aCallback = null ] ) returns void;
  • string $field
    Field name
  • callback $aCallback
    Callback
// Set module id.
public setModId ( string $modId, [ string $tplFileName = '' ] ) returns void;
  • string $modId
    Module id
  • string $tplFileName
    Template file name

Overrides: AMI_View::setModId().

// Returns module id.
protected getModId ( ) returns string;

Overrides: AMI_View::getModId().

// Sets up browsing according to options/state.
protected setupList ( ) returns void;
// Sets up template data.
protected setupTplData ( string $prefix, [ $aTplData = array() ] ) returns void;
  • string $prefix
    Sets prefix
  • array $aTplData
    Temlate data overriding defaults