Ejemplo n.º 1
0
 public function init()
 {
     $this->setAttrib('class', 'global_form_popup')->setAttrib('name', 'ynevent_add_location');
     // Element: address
     $this->addElement('Text', 'address', array('label' => 'Address', 'required' => true, 'style' => 'width: 400px;', 'filters' => array(new Engine_Filter_Censor(), 'StripTags', new Engine_Filter_StringLength(array('max' => '256')))));
     // Element: city
     $this->addElement('Text', 'city', array('label' => 'City', 'required' => true, 'style' => 'width: 400px;', 'filters' => array(new Engine_Filter_Censor(), 'StripTags', new Engine_Filter_StringLength(array('max' => '256')))));
     // Element: zip
     $this->addElement('Text', 'zip_code', array('label' => 'Zip/Postal Code', 'required' => true, 'filters' => array(new Engine_Filter_Censor(), 'StripTags', new Engine_Filter_StringLength(array('max' => '256')))));
     // Element: country
     $this->addElement('Select', 'country', array('label' => 'Country', 'multiOptions' => Ynevent_Model_DbTable_Countries::getMapMultiOptions(), 'onchange' => 'refresh_map()', 'value' => 'Viet Nam'));
     // google map
     $this->addElement('Dummy', 'google_map', array('label' => 'Save Changes', 'decorators' => array(array('ViewScript', array('viewScript' => '_googleMap.tpl', 'class' => 'form element')))));
 }
Ejemplo n.º 2
0
 public function init()
 {
     $this->addPrefixPath('Ynevent_Form_Decorator', APPLICATION_PATH . '/application/modules/Ynevent/Form/Decorator', 'decorator')->addPrefixPath('Ynevent_Form_Element', APPLICATION_PATH . '/application/modules/Ynevent/Form/Element', 'element')->addElementPrefixPath('Ynevent_Form_Decorator', APPLICATION_PATH . '/application/modules/Ynevent/Form/Decorator', 'decorator');
     $this->setTitle("Event Agent")->setAttrib('id', 'ynevent_agent_create');
     // Title
     $this->addElement('Text', 'title', array('label' => 'Agent Name', 'allowEmpty' => false, 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', false, array(1, 64))), 'filters' => array('StripTags', new Engine_Filter_Censor())));
     // Category
     $this->addElement('MultiLevel2', 'category_id', array('label' => 'Event Category', 'required' => false, 'model' => 'Ynevent_Model_DbTable_Categories', 'isSearch' => 1, 'module' => 'ynevent'));
     $this->addElement('YnCalendarSimple', 'starttime', array('label' => 'From Date:', 'allowEmpty' => true, 'required' => false));
     $this->addElement('YnCalendarSimple', 'endtime', array('label' => 'End Date:', 'allowEmpty' => true, 'required' => false));
     $this->addElement('Text', 'keyword', array('label' => 'Keyword:', 'maxlength' => '60', 'required' => false));
     $this->addElement('Text', 'address', array('label' => 'Address', 'maxlength' => '60', 'required' => false));
     $this->addElement('Select', 'country', array('label' => 'Country', 'multiOptions' => Ynevent_Model_DbTable_Countries::getMapMultiOptions(), 'value' => ''));
     $this->addElement('Text', 'state', array('label' => 'State', 'placeholder' => 'state', 'RegisterInArrayValidator' => false));
     $this->addElement('Text', 'city', array('label' => 'City', 'RegisterInArrayValidator' => false, 'required' => false));
     $this->addElement('Text', 'mile_of', array('label' => 'Within :', 'maxlength' => '60', 'required' => false, 'description' => 'mile(s)'));
     $this->getElement('mile_of')->getDecorator("Description")->setOption("placement", "append");
     $this->addElement('Text', 'zipcode', array('label' => 'Zip/Postal Code', 'maxlength' => '60', 'required' => false));
     // Buttons
     $this->addElement('Button', 'submit', array('label' => 'Save', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
     $this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'decorators' => array('ViewHelper')));
     $this->addDisplayGroup(array('submit', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
 }