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

Source for file AmiSample_FilterAdm.php

Documentation is available at AmiSample_FilterAdm.php

  • <?php
  • /**
  •  * @copyright  Amiro.CMS. All rights reserved.
  •  * @category   AMI
  •  * @package    Module_Sample
  •  * @since      5.12.0
  •  * @filesource
  •  * @version    $Id: AmiSample_FilterAdm.php 61273 2013-08-07 10:47:54Z Leontiev Anton $
  •  */
  •  
  • /**
  •  * Sample module admin filter component action controller.
  •  *
  •  * To use admin filter component you should create AMI_ModFilter child.<br />
  •  *
  •  * @package    Module_Sample
  •  * @subpackage Controller
  •  * @resource   ami_sample/filter/controller/adm <code>AMI::getResource('ami_sample/filter/controller/adm')</code>
  •  * @since      5.12.0
  •  */
  • }
  •  
  • /**
  •  * Sample module admin component item list filter model.
  •  *
  •  * @package    Module_Sample
  •  * @subpackage Model
  •  * @resource   ami_sample/filter/model/adm <code>AMI::getResource('ami_sample/filter/model/adm')</code>
  •  * @since      5.12.0
  •  */
  •     /**
  •      * Constructor.
  •      */
  •     public function __construct(){
  •         $this->addViewField(
  •             array(
  •                 'name'          => 'nickname',
  •                 'type'          => 'input',
  •                 'flt_type'      => 'text',
  •                 'flt_default'   => '',
  •                 'flt_condition' => 'like',
  •                 'flt_column'    => 'nickname'
  •             )
  •         );
  •         $this->addViewField(
  •             array(
  •                 'name'          => 'datefrom',
  •                 'type'          => 'datefrom',
  •                 'flt_type'      => 'date',
  •                 'flt_default'   => AMI_Lib_Date::formatUnixTime(AMI_Lib_Date::UTIME_MIN),
  •                 'flt_condition' => '>=',
  •                 'flt_column'    => 'birth'
  •             )
  •         );
  •         $this->addViewField(
  •             array(
  •                 'name'          => 'dateto',
  •                 'type'          => 'dateto',
  •                 'flt_type'      => 'date',
  •                 'flt_default'   => AMI_Lib_Date::formatUnixTime(AMI_Lib_Date::UTIME_MAX),
  •                 'flt_condition' => '<',
  •                 'flt_column'    => 'birth'
  •             )
  •         );
  •     }
  • }
  •  
  • /**
  •  * Sample module filter component view.
  •  *
  •  * @package    Module_Sample
  •  * @subpackage View
  •  * @resource   ami_sample/filter/view/adm <code>AMI::getResource('ami_sample/filter/view/adm')</code>
  •  * @since      5.12.0
  •  */
  •     /**
  •      * Constructor.
  •      */
  •     public function __construct(){
  •         parent::__construct();
  •  
  •         // Add admin filter form placeholder for 'nickname' before 'datefrom' filter field
  •         // $this->addPlaceholders(array('nickname' => 'datefrom.before'));
  •         $this->putPlaceholder('nickname''datefrom.before');
  •     }
  •  
  •     /**
  •      * Returns module specific locale path.
  •      *
  •      * @return string 
  •      */
  •     protected function getModLocalePath(){
  •         return '_local/plugins_distr/' $this->getModId(.  '/templates/filter.lng';
  •     }
  • }