Exemple #1
0
 public function init()
 {
     $formutil = new Agana_Form_Util($this->_action, $this->_model);
     $this->setName("person");
     $this->setMethod('post');
     $this->_addClassNames('well');
     $this->addAttribs(array('load-in' => 'content-container'));
     if ($this->_action == self::ACTION_EDIT) {
         $this->addElement($this->_getIdElement());
     }
     //$this->_addElementName();
     $formutil->addElementName($this, array('maxlength' => 120, 'dimension' => 7));
     $formutil->addElementGender($this);
     $formutil->addElementDate($this, array('name' => 'birthdate', 'label' => 'Birthdate', 'modelfield' => 'birthdate'));
     $formutil->addElementMaritalStatus($this, array('dimension' => 3));
     $formutil->addElementPhone($this, array('class' => 'float-left'));
     $formutil->addElementPhone($this, array('name' => 'mobilephone', 'label' => 'Mobile phone', 'modelfield' => 'mobilephone'));
     $formutil->addElementEmail($this);
     $formutil->addElementAddress($this);
     $formutil->addElementAddressNumber($this);
     $formutil->addElementAddressDetails($this);
     $formutil->addElementPostalCode($this);
     $formutil->addElementCityId($this, array('required' => true));
     $formutil->addElementCityRegionId($this, array('showcity' => true));
     $formutil->addElementWebsite($this);
     $formutil->addElementButtonSave($this);
     $formutil->addElementButtonCancel($this);
     $this->addDisplayGroup(array('name', 'gender', 'birthdate', 'marital_status', 'phone', 'mobilephone', 'email', 'address', 'addressnumber', 'addressdetails', 'postalcode', 'city_id', 'city_region_id', 'website'), 'personform', array('legend' => ''));
     //                $phonesForm = new Twitter_Bootstrap_Form_Inline();
     //        $formutil->addElementPhone($phonesForm);
     //        $formutil->addElementPhone($phonesForm, array(
     //            'name' => 'mobilephone',
     //            'label'=> 'Mobile Phone',
     //            'modelfield' => 'mobilephone'
     //            ));
     //
     //        $phonesForm->addDisplayGroup(array(
     //            'phone', 'mobilephone',
     //                ), 'personformphone',
     //            array(
     //                'legend' => 'Phones',
     //            )
     //        );
     //
     //        $this->addSubForm($phonesForm, 'phonesform');
     //
     $this->addDisplayGroup(array('save', 'cancel'), 'actions-end', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions')));
 }