Source for file AmiSample_ListAdm.php
Documentation is available at AmiSample_ListAdm.php
* @copyright Amiro.CMS. All rights reserved.
* @version $Id: AmiSample_ListAdm.php 61273 2013-08-07 10:47:54Z Leontiev Anton $
* Sample module admin list component action controller.
* @resource ami_sample/list/controller/adm <code>AMI::getResource('ami_sample/list/controller/adm')</code>
* List actions controller resource id
* List group actions controller resource id
* @return AmiSample_ListAdm
// AMI_ModListAdm::addActions() must be called before parent::init()!
// Add actions to "actions" column
$this->addActions(array(self::REQUIRE_FULL_ENV . 'edit', self::REQUIRE_FULL_ENV . 'delete', self::REQUIRE_FULL_ENV . 'copy', 'show'));
// Add separate column action
$this->addColActions(array(self::REQUIRE_FULL_ENV . 'public'), true);
// Add separate column action
// Add action inside existing column
array(self::REQUIRE_FULL_ENV . 'public', 'public_section'),
array(self::REQUIRE_FULL_ENV . 'unpublic', 'public_section'),
array(self::REQUIRE_FULL_ENV . 'rename', 'rename_section'),
array(self::REQUIRE_FULL_ENV . 'delete', 'delete_section'),
* Sample module admin list component view.
* @resource ami_sample/list/view/adm <code>AMI::getResource('ami_sample/list/view/adm')</code>
->addColumnType('age', 'int')
->setColumnTensility('nickname')
// place 'rename' action column before 'nickname' column
// Truncate 'nickname' column by 50 symbols
array($this, 'fmtTruncate'),
// Format 'birth' column as date
array($this, 'fmtDateTime'),
// Use custom formatter on 'value' column
array($this, 'fmtCustom')
* Returns module specific locale path.
return '_local/plugins_distr/' . $this->getModId() . '/templates/list.lng';
* Custom column formatter.
* @param mixed $value Value to format
* @param array $aArgs Arguments
* @see AMI_ModListView::formatColumn()
protected function fmtCustom($value, array $aArgs){
return '~ ' . $value . ' ~';
|