Source for file AmiSample_FormAdm.php
Documentation is available at AmiSample_FormAdm.php
* @copyright Amiro.CMS. All rights reserved.
* @version $Id: AmiSample_FormAdm.php 61273 2013-08-07 10:47:54Z Leontiev Anton $
* Sample module admin form component action controller.
* @resource ami_sample/form/controller/adm <code>AMI::getResource('ami_sample/form/controller/adm')</code>
* Save action dispatcher.
* @param array &$aEvent Event data
protected function _save(array &$aEvent){
if(is_object($this->oItem)){
AMI::getSingleton('response')->addStatusMessage('origin_data', array('data' => d::getDumpAsString($this->oItem->getOriginData())));
AMI::getSingleton('response')->addStatusMessage('difference_from_origin', array('data' => d::getDumpAsString($this->oItem->getDiffFromOrigin())));
* Sample module form component view.
* @resource ami_sample/form/view/adm <code>AMI::getResource('ami_sample/form/view/adm')</code>
// Add custom sets for the fields
$this->addField(array('name' => 'id', 'type' => 'hidden'));
$this->addField(array('name' => 'mod_action', 'value' => 'form_save', 'type' => 'hidden'));
$this->addField(array('name' => 'public', 'type' => 'checkbox', 'default_checked' => true));
$this->addField(array('name' => 'nickname'));
$this->addField(array('name' => 'birth', 'type' => 'date', 'validate' => array('custom', 'stop_on_error')));
$this->addField(array('name' => 'email'));
$this->addTab('info', 'tabset', self::TAB_STATE_ACTIVE);
$this->addTab('contacts', 'tabset',self::TAB_STATE_COMMON,'', array('edit','show'));
$this->addField(array('name' => 'about', 'type' => 'htmleditor', 'cols' => 80, 'rows' => 10, 'position' => 'info.end', 'modes' => array('editor', 'bb')));
$this->addField(array('name' => 'phone', 'position' => 'contacts.end'));
$this->addField(array('name' => 'homepage', 'position' => 'contacts.end', 'validate' => array('domain')));
$this->addField(array('name' => 'file', 'type' => 'file', 'position' => 'email.after', 'validate' => array('required')));
$this->addField(array('name' => 'views', 'position' => 'special.begin' ,'display_by_action' => array('edit', 'show')));
* Returns module specific locale path.
* Returns module specific template path.
return '_local/plugins_distr/' . $this->getModId() . '/templates/';
|