public function init() { $this->setMethod('POST'); $this->setName('guestForm'); $element = new Zend_Form_Element_Text('name'); $element->setLabel('怎么称呼您'); $element->setDescription('必填,中英文都可,2到30个字'); $element->setRequired(true); $this->addElement($element); $element = new Zend_Form_Element_Text('email'); $element->setLabel('您的Email'); $element->setRequired(true); $element->addValidator(new Zend_Validate_EmailAddress()); $element->addValidator('NotEmpty'); $element->setDescription('必填'); $this->addElement($element); $element = new Zend_Form_Element_Textarea('body'); $element->setLabel('您的留言'); $element->setAttrib('rows', 4); $element->addValidator('NotEmpty'); $this->addElement($element); $element = new Elements(); $element->addReCaptcha($this); $element = new Zend_Form_Element_Submit('post'); $element->setValue('提交')->removeDecorator('Label'); $this->addElement($element); }
public function init() { parent::init(); $this->setAction('/core/feedback/programme'); $id = new Zend_Form_Element_Hidden('id'); $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite')); $best = new Zend_Form_Element_Textarea('best_stuff'); $best->setLabel('Which sessions or presentations were the best – and why?')->setAttrib('class', 'medium')->setDescription('Please limit your comments to 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(1, 5000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer comment', Zend_Validate_StringLength::TOO_LONG => 'Your comment is too long')))->setDecorators(array('Composite')); $worst = clone $best; $worst->setName('worst_stuff')->setLabel('Which sessions or presentations were the worst – and why?'); $comments = clone $best; $comments->setName('comments')->setLabel('Comments on the programme'); $this->addElements(array($id, $best, $worst)); $elements = array('exhibition' => 'How useful did you find the exhibitions and demos?', 'meetings' => 'How useful did you find the meetings / workshops around the conference?', 'lightning' => 'How useful did you find the lightning talks?', 'poster' => 'How useful did you find the poster presentations?'); // add all elements in loop, since they are all the same foreach ($elements as $name => $label) { $newSelect = new Zend_Form_Element_Radio($name); $newSelect->setLabel($label)->setAttrib('class', 'tiny')->setMultiOptions($this->_getFieldValues('rating', 'feedback'))->setDecorators(array('Composite')); $newText = new Zend_Form_Element_Text('remarks_' . $name); $newText->setDescription('Comments')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $this->addElements(array($newSelect, $newText)); } $this->addElement($comments); $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator)); }
public function init() { $this->setMethod('POST'); $this->setName("adminForm"); $element = new Zend_Form_Element_Hidden('id'); $element->setValue($this->advertisement->id); $this->addElement($element); $element = new Zend_Form_Element_Hidden('city'); $element->setValue($this->city); $this->addElement($element); $element = new Zend_Form_Element_Radio('action'); $element->setMultiOptions(array('0' => '已解决, 关闭帖子', '1' => '打错了些东东, 修改帖子', '2' => '我是管理员, 删除帖子')); $element->setValue(0); $this->addElement($element); $element = new Zend_Form_Element_Text('password'); $element->setLabel('密码'); $element->setDescription('忘记密码?'); $this->addElement($element); $element = new Elements(); $element->addReCaptcha($this); $element = new Zend_Form_Element_Submit('post'); $element->setLabel('提交')->removeDecorator('Label'); $this->addElement($element); $this->addDisplayGroup(array('password', 'captcha', 'post'), 'leftMargin'); $this->getDisplayGroup('leftMargin')->removeDecorator('DtDdWrapper'); }
public function init() { $country_code = new Zend_Form_Element_Text('country_code'); $country_code->setLabel('Country code'); $country_code->setDescription('List of codes you can see here: http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html'); $country_code->setRequired(true); $this->addElement($country_code); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name'); $name->setRequired(true); $this->addElement($name); $is_active = new Zend_Form_Element_Checkbox('is_active'); $is_active->setLabel('Active'); $is_active->setRequired(true); $this->addElement($is_active); $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setLabel('Cancel'); $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black'); $cancel->setAttrib("onClick", "window.location = window.location.origin+'/locale/languages/'"); $this->addElement($cancel); $submit = new Zend_Form_Element_Submit('save'); $submit->setAttrib('class', 'btn btn-primary'); $submit->setLabel('Confirm'); $this->setAction('')->setMethod('post')->addElement($submit); }
public function init() { /* Form Elements & Other Definitions Here ... */ $name = new Zend_Form_Element_Text("name"); $name->setLabel("You Name : "); $name->setRequired(true); $website = new Zend_Form_Element_Text("website"); $website->setLabel("Your Website : "); $website->setDescription(" http://www.google.com "); $email = new Zend_Form_Element_Text("email"); $email->setLabel("Email Address : "); $email->setDescription(" Example : john@googe.com "); $email->addValidator("EmailAddress", false, array('messages' => array(Zend_Validate_EmailAddress::INVALID_FORMAT => "Invalid Email Address Ya tayeb"))); $email->setRequired(true); $body = new Zend_Form_Element_Textarea("body"); $body->setLabel("Text Message : "); $body->setAttrib("class", "textbox"); $body->setAttrib("rows", "6"); $body->setAttrib("cols", "60"); $body->setRequired(true); $submit = new Zend_Form_Element_Submit("contact"); $this->addElement($name); $this->addElements(array($website, $email, $body, $submit)); $this->addElement("hash", "contact_us_hash_form"); }
public function init() { parent::init(); $this->setAction('/core/feedback/participant'); $id = new Zend_Form_Element_Hidden('id'); $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite')); $country = new TA_Form_Element_Country('country'); $country->setLabel('Please select the country in which you work as primary place of employment.')->setDecorators(array('Composite')); $orgType = new Zend_Form_Element_Select('org_type'); $orgType->setLabel('Please select the type of organisation that most closely resembles your primary place of employment.')->setAttrib('class', 'medium')->setMultiOptions(array('0' => '---', 'nren' => 'National Research and Education Network (NREN)', 'high' => 'Higher / Further Education Institute (universities / college / polytechnic...)', 'ari' => 'Academic Research Institute', 'project' => 'Research project', 'admin' => 'Administrative departments of academic institutions', 'local' => 'Local / regional / central government department', 'cultural' => 'Cultural organisation (galeries, librairies, museums, etc.)', 'comm' => 'Commercial organisation', 'other' => 'Other non-profit (specify)'))->setDecorators(array('Composite')); $orgOther = new Zend_Form_Element_Text('org_type_other'); $orgOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $occupation = new Zend_Form_Element_Select('occupation'); $occupation->setLabel('Please select the title that most closely resembles your primary role in the organisation.')->setAttrib('class', 'medium')->setMultiOptions(array('0' => '---', 'director' => 'Director (responsible for overall organisational management)', 'manager' => 'Technical Manager', 'admin' => 'Administrative / Operational Manager', 'tech' => 'Technical staff / Engineer', 'res' => 'Researcher / Scientist', 'prof' => 'Professor / Teacher', 'pr' => 'Public Relations / Communications', 'bizz' => 'Business Development', 'stud' => 'Student', 'other' => 'Other (specify)'))->setDecorators(array('Composite')); $occOther = new Zend_Form_Element_Text('occupation_other'); $occOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $interest = new Zend_Form_Element_MultiCheckbox('interest'); $interest->setLabel('Please select your main areas of interest. Up to three selections are possible.')->setAttrib('class', 'tiny')->setMultiOptions(array('sec' => 'Network security (incident, prevention and response)', 'nom' => 'Network operations management', 'clouds' => 'Storage and clouds', 'grids' => 'Grids', 'media' => 'Media management and distribution', 'auth' => 'Authentication and Authorisation systems and federations', 'wireless' => 'Fixed & mobile wireless and roaming technologies', 'vid' => 'Video / web-based conferencing', 'reg' => 'Regulatory issues including privacy', 'pr' => 'PR / communications / business development', 'strat' => 'Strategic development: European policy setting and / or organisational management', 'other' => 'Other (specify)'))->addValidator('Callback', true, array('callback' => function ($value, $arr) { return count($arr['interest']) > 3 ? false : true; }, 'messages' => array(Zend_Validate_Callback::INVALID_VALUE => "Please don't select more than three options")))->setDecorators(array('Composite')); $intOther = new Zend_Form_Element_Text('interest_other'); $intOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $this->addElements(array($id, $country, $orgType, $orgOther, $occupation, $occOther, $interest, $intOther)); $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator)); }
/** * Form initialization * * @return void */ public function init() { $url = Zend_Controller_Front::getInstance()->getRouter()->assemble(array('module' => "flex", 'controller' => 'panel', 'action' => 'form'), 'default'); $this->setAction($url)->setMethod('post'); $this->setLegend(sprintf(Zoo::_('Edit %s'), $this->target->name)); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name')->setRequired(true); $name->setDescription('Administration-side identifier'); $title = new Zend_Form_Element_Text('title'); $title->setLabel('Title'); $title->setDescription('User-visible title of panel'); $layout = new Zend_Form_Element_Select('layout'); $layout->setLabel('Layout'); $layout->setMultiOptions($this->getLayouts()); $category = new Zend_Form_Element_Text('category'); $category->setLabel('Category'); $category->setDescription('Administration-side grouping'); $category->setRequired(true); $submit = new Zend_Form_Element_Submit('save'); $submit->setLabel('save')->setOrder(100); $this->addElements(array($name, $title, $layout, $category)); $legend = Zoo::_("Basic options"); $this->addDisplayGroup(array('name', 'title', 'layout', 'category'), 'block_form', array('legend' => $legend)); $this->addElement($submit); if ($this->target->id > 0) { $id_ele = new Zend_Form_Element_Hidden('id'); $id_ele->setValue(intval($this->target->id)); $this->addElement($id_ele); } $this->populate($this->target->toArray()); }
public function renderFormElement() { $elm = new Zend_Form_Element_Text($this->getName(), array('label' => $this->getLabel() . ':', 'class' => 'mask')); $elm->setDescription($this->getDescription()); $elm->setValue($this->getValue()); $elm->setRequired($this->getRequired()); return $elm; }
public function init() { $this->setMethod("POST"); $this->setName("createAdAgencyForm"); if (!empty($this->next)) { $element = new Zend_Form_Element_Hidden("next"); $element->setValue($this->next); $this->addElement($element); } $element = new Zend_Form_Element_Hidden(AdvertisingAgency::CITY); $element->setValue($this->city->id); $this->addElement($element); $element = new Zend_Form_Element_Text(User::NAME); $element->setLabel('怎么称呼您'); $element->setDescription('必填,中英文都可,2到30个字'); $this->addElement($element); $element = new Zend_Form_Element_Text(User::EMAIL); $element->setLabel('您的Email'); $element->setDescription('必填,方便我们联系您'); $element->setRequired(true); $element->addValidator(new Zend_Validate_EmailAddress()); $element->addValidator('NotEmpty'); $this->addElement($element); $element = new Zend_Form_Element_Text(User::MOBILE); $element->setLabel('您的手机号'); $element->addFilter(new Zend_Filter_HtmlEntities()); $element->addFilter(new Zend_Filter_StripTags()); $element->setDescription('方便我们及时联系您'); $this->addElement($element); $this->addDisplayGroup(array('city_id', 'name', 'email', 'mobile'), 'aboutYou'); $this->getDisplayGroup('aboutYou')->removeDecorator('DtDdWrapper'); $element = new Zend_Form_Element_Textarea(AdvertisingAgency::DESCRIPTION); $element->setAttrib('rows', 6); $element->setLabel("有哪些人要入住?基本情况?尽量详细!"); $element->setDescription('如:三口之家,男30岁在爱立信有稳定工作,不吸烟;女27岁在kth读计算机硕士,不吸烟,男孩6岁。整洁,爱干净。'); $element->setRequired(true); $this->addElement($element); $element = new Zend_Form_Element_Textarea(AdvertisingAgency::COMMENT); $element->setAttrib('rows', 6); $element->setLabel("对房子的要求?最高房租?最小面积?地点?入住时间?"); $element->setDescription('如:最好是一室一厅的整个公寓,也可以与其他人合租。可以合用厨房卫生间。最高房租10000kr每月,最小面积30平米。地点只要是地铁附近,不要离中心太远都可以。入住时间是9月1日,希望能长租。'); $element->setRequired(true); $this->addElement($element); $element = new Elements(); $element->addReCaptcha($this); $element = new Zend_Form_Element_Submit("post"); $this->addElement($element); $this->addDisplayGroup(array(AdvertisingAgency::DESCRIPTION, AdvertisingAgency::COMMENT, 'challenge', 'post'), 'aboutRoom'); $this->getDisplayGroup('aboutRoom')->removeDecorator('DtDdWrapper'); }
private function _buildElements() { $date = new Zend_Form_Element_Text($this->_name . "_Date"); $date->setLabel("Date de publication"); $date->addValidator(new Zend_Validate_Date(array("format" => "dd/MM/yyyy hh:mm")), true); $date->setDescription("JJ/MM/AAAA hh:mm"); $date->setAttrib("size", 16); $date->addDecorators(array("br" => new Zend_Form_Decorator_HtmlTag(array("tag" => "br", "noAttribs" => true)), "hr" => new Zend_Form_Decorator_HtmlTag(array("tag" => "hr", "noAttribs" => true)))); $active = new Zend_Form_Element_Checkbox($this->_name . "_Active"); $active->setLabel("Est Actif"); $active->removeDecorator("dtDdWrapper"); $submit = new Zend_Form_Element_Submit($this->_name . "_Submit"); $submit->setLabel("Creer"); return array($date, $active, $submit); }
/** * Returns/sets a password element. * * @return \Zend_Form_Element_Password */ public function getTokenElement() { $element = $this->getElement($this->_tokenFieldName); if (!$element) { $tokenLib = $this->tracker->getTokenLibrary(); $max_length = $tokenLib->getLength(); // Veld token $element = new \Zend_Form_Element_Text($this->_tokenFieldName); $element->setLabel($this->translate->_('Token')); $element->setDescription(sprintf($this->translate->_('Enter tokens as %s.'), $tokenLib->getFormat())); $element->setAttrib('size', $max_length + 2); $element->setAttrib('maxlength', $max_length); $element->setRequired(true); $element->addFilter($this->tracker->getTokenFilter()); $element->addValidator($this->tracker->getTokenValidator()); $this->addElement($element); } return $element; }
public function init() { $key = new Zend_Form_Element_Text('key'); $key->setLabel('Key'); $key->setRequired(true); $key->setDescription('Key must contain small letters. Blank space replace with _'); $this->addElement($key); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Description'); $description->setRequired(true); $this->addElement($description); $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setLabel('Cancel'); $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black'); $cancel->setAttrib("onClick", "window.location = window.location.origin+'/locale/translate-keys/'"); $this->addElement($cancel); $submit = new Zend_Form_Element_Submit('save'); $submit->setAttrib('class', 'btn btn-primary'); $submit->setLabel('Confirm'); $this->setAction('')->setMethod('post')->addElement($submit); }
public function init() { $this->setMethod('POST'); $this->setName('sendEmailForm'); //$this->setAction('index/view'); $element = new Zend_Form_Element_Hidden('id'); $element->setValue($this->advertisement->id); $this->addElement($element); $element = new Zend_Form_Element_Hidden('city'); $element->setValue($this->city); $this->addElement($element); $element = new Zend_Form_Element_Text('name'); $element->setLabel('怎么称呼您'); $element->setRequired(true); $element->setDescription('必填'); $this->addElement($element); $element = new Zend_Form_Element_Text('email'); $element->setLabel('您的Email'); $element->setRequired(true); $element->addValidator(new Zend_Validate_EmailAddress()); $element->addFilter(new Zend_Filter_HtmlEntities()); $element->addFilter(new Zend_Filter_StripTags()); $element->addValidator('NotEmpty'); $element->setDescription('必填'); $this->addElement($element); $element = new Zend_Form_Element_Textarea('body'); $element->setLabel('内容'); $element->setRequired(true); $element->addValidator('NotEmpty'); $element->setDescription('必填'); $element->setAttrib('rows', 4); $this->addElement($element); $element = new Elements(); $element->addReCaptcha($this); $element = new Zend_Form_Element_Submit('send'); $element->setValue('发送'); $element->removeDecorator('Label'); $this->addElement($element); }
/** Initialise the form * @access public * @return void */ public function init() { $username = new Zend_Form_Element_Text('username'); $username->setLabel('Your username'); $username->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Db_RecordExists', false, array('table' => 'users', 'field' => 'username')); $activationKey = new Zend_Form_Element_Text('activationKey'); $activationKey->setLabel('Your activation key'); $activationKey->setDescription('Your key was sent in your activation email')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Db_RecordExists', false, array('table' => 'users', 'field' => 'activationKey')); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Your email address'); $email->setRequired(true)->addValidator('Db_RecordExists', false, array('table' => 'users', 'field' => 'email'))->addValidator('EmailAddress', false, array('mx' => true)); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(480); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Activate me!'); $this->addElement($submit); $this->addElements(array($username, $activationKey, $email, $hash)); $this->addDisplayGroup(array('username', 'email', 'activationKey'), 'userdetails'); $this->addDisplayGroup(array('submit'), 'buttons'); $this->setLegend('Enter details: '); parent::init(); }
public function init() { parent::init(); $this->setAction('/core/feedback/general'); $id = new Zend_Form_Element_Hidden('id'); $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite')); $confRating = new Zend_Form_Element_Radio('rating'); $confRating->setLabel('How would you rate the conference overall?')->setAttrib('class', 'tiny')->setMultiOptions($this->_getFieldValues('rating', 'feedback'))->setDecorators(array('Composite')); $partReasons = new Zend_Form_Element_MultiCheckbox('part_reasons'); $partReasons->setLabel('Please select your top three reasons for participating in the TERENA conference')->setAttrib('class', 'tiny')->setMultiOptions(array('networking' => 'Networking opportunities (i.e. opportunities to form new professional contacts)', 'collaboration' => 'Collaboration opportunities (i.e. opportunities to work together with others on a common area of interest)', 'interesting' => 'Interesting topic/speaker that could help me in my job', 'exposure' => 'Visibility/exposure within the Research & Education Community', 'management' => 'It is encouraged by my management', 'support' => 'To support the ongoing development of the research & education community as a whole', 'other' => 'Other'))->setDecorators(array('Composite')); $partOther = new Zend_Form_Element_Text('why_other_spec'); $partOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $confHear = new Zend_Form_Element_MultiCheckbox('conf_hear'); $confHear->setLabel('How did you hear about the conference? (check all that apply)')->setAttrib('class', 'tiny')->setMultiOptions(array('last' => 'During the last conference', 'pp' => 'Printed promotion', 'email' => 'Email', 'col' => 'Colleagues', 'web' => 'TERENA or NREN website', 'sns' => 'Social networking site (Facebook, Linkedin, Twitter...etc)', 'other' => 'Other'))->setDecorators(array('Composite')); $hearOther = new Zend_Form_Element_Text('heard_other_spec'); $hearOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $beenBefore = new Zend_Form_Element_Radio('been_before'); $beenBefore->setLabel('Have you been to a TERENA conference before?')->setAttrib('class', 'tiny')->setMultiOptions(array('no' => 'No', 'yesone' => 'Yes, once', 'yestwice' => 'Yes, twice', 'yesthree' => 'Yes, three times and more'))->setDecorators(array('Composite')); $comeAgain = new Zend_Form_Element_Radio('come_again'); $comeAgain->setLabel('Will you come to the TERENA conference again?')->setAttrib('class', 'tiny')->setMultiOptions(array('yes' => 'Yes, definitely', 'maybe' => 'Yes, maybe', 'un' => 'Undecided', 'probnot' => 'Probably not', 'no' => 'No'))->setDecorators(array('Composite')); $this->addElements(array($id, $confRating, $partReasons, $partOther, $confHear, $hearOther, $beenBefore, $comeAgain)); $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator)); }
public function init() { $model_t_countries = new Locale_Model_Languages(); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name'); $name->setRequired(true); $this->addElement($name); $country_code = new Zend_Form_Element_Text('country_code'); $country_code->setLabel('Country code'); $country_code->setDescription('List of codes you can see here: http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html'); $country_code->setRequired(true); $this->addElement($country_code); $calling_code = new Zend_Form_Element_Text('calling_code'); $calling_code->setLabel('Calling code'); $calling_code->setRequired(true); $calling_code->addValidator('Digits', true); $this->addElement($calling_code); $t_country_id = new Zend_Form_Element_Select('language_id'); $t_country_id->addValidator(new Zend_Validate_Digits(), true); $t_country_id->setLabel('Language'); $t_country_id->setAttrib("data-placeholder", "Choose language..."); $t_country_id->setMultiOptions(array('0' => 'none') + $model_t_countries->getIdAndNameArray()); $this->addElement($t_country_id); $is_active = new Zend_Form_Element_Checkbox('is_active'); $is_active->setLabel('Active'); $is_active->setRequired(true); $this->addElement($is_active); $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setLabel('Cancel'); $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black'); $cancel->setAttrib("onClick", "window.location = window.location.origin+'/locale/countries/'"); $this->addElement($cancel); $submit = new Zend_Form_Element_Submit('save'); $submit->setAttrib('class', 'btn btn-primary'); $submit->setLabel('Confirm'); $this->setAction('')->setMethod('post')->addElement($submit); }
public function init() { parent::init(); $this->setAction('/core/feedback/logistics'); $id = new Zend_Form_Element_Hidden('id'); $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite')); $elements = array('website' => 'Conference website', 'core' => 'Conference software (CORE) usability', 'social_media' => 'Conference social media (usefulness)', 'registration' => 'Registration / payment procedures', 'hotel_booking' => 'Hotel booking procedures', 'doc_during' => 'Onsite information', 'venue' => 'Venue', 'network' => 'Networking facilities', 'catering' => 'Catering', 'social_events' => 'Social events'); // add all elements in loop, since they are all the same foreach ($elements as $name => $label) { $newSelect = new Zend_Form_Element_Radio($name); $newSelect->setLabel($label)->setAttrib('class', 'tiny')->setMultiOptions($this->_getFieldValues('rating', 'feedback'))->setDecorators(array('Composite')); $newText = new Zend_Form_Element_Text('remarks_' . $name); $newText->setDescription('Comments')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $this->addElements(array($newSelect, $newText)); } $accomodation = new Zend_Form_Element_Radio('vfm_accomodation'); $accomodation->setLabel('Accommodation')->setAttrib('class', 'tiny')->setMultiOptions(array('good' => 'Good value for money', 'reasonable' => 'Reasonable value for money', 'poor' => 'Poor value for money'))->setDecorators(array('Composite')); $regfee = clone $accomodation; $regfee->setName('vfm_regfee')->setLabel('Registration fee'); $comments = new Zend_Form_Element_Textarea('comments'); $comments->setLabel('Comments on the logistical arrangements')->setAttrib('class', 'medium')->setDescription('Please limit your comments to 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(1, 5000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer comment', Zend_Validate_StringLength::TOO_LONG => 'Your comment is too long')))->setDecorators(array('Composite')); $this->addElements(array($id, $accomodation, $regfee, $comments)); $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator)); }
public function init() { $menu_items_model = new Admin_Model_MenuItems(); $menu_items_icons_model = new Admin_Model_MenuItemsIcons(); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name'); $name->setAttrib("class", "form-control"); $name->setAttrib("style", "width:200px"); $name->setRequired(true); $this->addElement($name); $title = new Zend_Form_Element_Text('title'); $title->setLabel('Title'); $title->setAttrib("class", "form-control"); $title->setAttrib("style", "width:200px"); $title->setRequired(true); $title->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $this->addElement($title); $parent = new Zend_Form_Element_Select('parent_id'); $parent->setLabel('Parent menu item')->setRequired(false); $parent->setAttrib("class", "select2")->setAttrib("style", "width:200px"); $parent->setDescription('If menu item isn\'t a child element, choose None'); $parent->addMultiOption(0, 'None'); foreach ($menu_items_model->getForDropDown() as $key => $v) { $parent->addMultiOption($key, $v); } $this->addElement($parent); $module = new Zend_Form_Element_Text('module'); $module->setLabel('Module'); $module->setAttrib("class", "form-control"); $module->setAttrib("style", "width:200px"); $module->setRequired(false); $module->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $this->addElement($module); $controller = new Zend_Form_Element_Text('controller'); $controller->setLabel('Controller'); $controller->setAttrib("class", "form-control"); $controller->setAttrib("style", "width:200px"); $controller->setRequired(false); $this->addElement($controller); $action = new Zend_Form_Element_Text('action'); $action->setLabel('Action'); $action->setAttrib("class", "form-control"); $action->setAttrib("style", "width:200px"); $action->setRequired(false); $this->addElement($action); $params = new Zend_Form_Element_Text('params'); $params->setLabel('Params'); $params->setDescription('Insert params in format: key1:value1,key2:value2 ...'); $params->setAttrib("class", "form-control"); $params->setAttrib("style", "width:200px"); $params->setRequired(false); $this->addElement($params); $icon_id = new Zend_Form_Element_Hidden('icon_id'); $icon_id->setRequired(false); $this->addElement($icon_id); $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setLabel('Cancel'); $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black'); $cancel->setAttrib("onClick", "window.location = window.location.origin+'/admin/menu-items/'"); $this->addElement($cancel); $submit = new Zend_Form_Element_Submit('save'); $submit->setAttrib('class', 'btn btn-primary'); $submit->setLabel('Confirm'); $this->setAction('')->setMethod('post')->addElement($submit); }
public function init() { if (isset($this->advertisement)) { $user = Advertisement::getUser($this->advertisement->id); $element = new Zend_Form_Element_Hidden('id'); $element->setValue($this->advertisement->id); $this->addElement($element); $element = new Zend_Form_Element_Hidden('password'); $element->setValue($this->password); $this->addElement($element); $this->setAction('/' . strtolower($this->city->name) . '/bulletin/update'); } else { $this->setAction('/' . strtolower($this->city->name) . '/bulletin/create'); } $element = new Zend_Form_Element_Hidden('city'); $element->setValue($this->city->id); $this->addElement($element); $this->setMethod('POST'); $this->setName('createAdForm'); $element = new Zend_Form_Element_Text('name'); $element->setLabel('怎么称呼您'); $element->setDescription('必填,中英文都可,2到30个字'); $element->setRequired(true); //$element->addValidator(new Zend_Validate_StringLength(2,30)); if (isset($user)) { $element->setValue($user->name); } $this->addElement($element); $element = new Zend_Form_Element_Text('email'); $element->setLabel('您的Email'); $element->setRequired(true); $element->addValidator(new Zend_Validate_EmailAddress()); $element->addValidator('NotEmpty'); $element->setDescription('必填,将不会显示在您的帖子里'); if (isset($user)) { $element->setValue($user->email); } $this->addElement($element); $element = new Zend_Form_Element_Text('mobile'); $element->setLabel('您的手机号'); $element->addFilter(new Zend_Filter_HtmlEntities()); $element->addFilter(new Zend_Filter_StripTags()); $element->setDescription('方便其他用户联系您'); if (isset($user)) { $element->setValue($user->mobile); } $this->addElement($element); $this->addDisplayGroup(array('name', 'email', 'mobile'), 'aboutYou'); $this->getDisplayGroup('aboutYou')->removeDecorator('DtDdWrapper'); // radio box $element = new Zend_Form_Element_Radio('type'); $element->addMultiOptions(array('lease' => '供', 'want' => '求'))->removeDecorator('Label'); $element->setSeparator('')->setValue(Advertisement::LEASE); if (isset($this->advertisement)) { $element->setValue($this->advertisement->type); } $this->addElement($element); // category $element = new Zend_Form_Element_Checkbox("isBusiness"); $element->setLabel('是商铺/店面吗?'); if (isset($this->advertisement) && $this->advertisement->category_id == Category::SHOP) { $element->setValue(1); } else { $element->setValue(0); } $this->addElement($element); $element = new Zend_Form_Element_Text('title'); $element->setLabel('帖子标题'); $element->setRequired(true); $element->addValidator('NotEmpty'); //$element->addValidator(new Zend_Validate_StringLength(10,30)); $element->setDescription('必填,5-100字,概括题目,突出重点'); if (isset($this->advertisement)) { $element->setValue($this->advertisement->title); } $this->addElement($element); $element = new Zend_Form_Element_Text('address'); $element->setLabel('房子的住址'); $element->setDescription('必填,以便用户在地图上方便的找到'); if (isset($this->advertisement)) { $element->setValue($this->advertisement->address); } $this->addElement($element); $element = new Zend_Form_Element_Text('rent'); $element->setLabel('租金'); if (isset($this->advertisement)) { $element->setValue($this->advertisement->rent); } $this->addElement($element); $element = new Zend_Form_Element_Select('currency'); //$element->setLabel("货币"); $element->addMultiOptions(Currency::getAvailableCurrencyAsArray()); if (isset($this->advertisement)) { $element->setValue(Advertisement::getCurrency($this->advertisement)->id); } else { $element->setValue(127); } $this->addElement($element); $element = new Zend_Form_Element_Radio('rent_measurement'); $element->addMultiOptions(array('month' => '每月', 'day' => '每日'))->setSeparator('')->setDescription('必填')->removeDecorator('Label'); $element->setSeparator('')->setValue(Advertisement::RENT_MONTHLY); if (isset($this->advertisement)) { if ($this->advertisement->rent_measurement == Advertisement::RENT_MONTHLY) { $element->setValue('month'); } else { if ($this->advertisement->rent_measurement == Advertisement::RENT_DAILY) { $element->setValue('day'); } } } $element->setRequired(true); $element->addValidator('NotEmpty'); $element->addValidator(new Zend_Validate_Alnum()); $this->addElement($element); // start date and stop date $element = new Zend_Form_Element_Text('start_date'); $element->setRequired(true); $element->addValidator('NotEmpty'); $element->setLabel('开始日期'); $element->setDescription('必填,格式为2010-09-11'); if (isset($this->advertisement)) { $element->setValue($this->advertisement->start_date); } $this->addElement($element); $element = new Zend_Form_Element_Text('stop_date'); $element->setLabel('结束日期'); $element->setDescription('同上,留空则为长期'); if (isset($this->advertisement)) { $element->setValue($this->advertisement->stop_date); } $this->addElement($element); $element = new Zend_Form_Element_Text('area'); $element->setLabel('面积(平方米)'); $element->addValidator(new Zend_Validate_Alnum()); if (isset($this->advertisement)) { $element->setValue($this->advertisement->area); } $this->addElement($element); $element = new Zend_Form_Element_Text('num_of_room'); $element->setLabel('房间数'); $element->addValidator(new Zend_Validate_Alnum()); $element->setDescription('卧房数'); if (isset($this->advertisement)) { $element->setValue($this->advertisement->num_of_room); } $this->addElement($element); $element = new Zend_Form_Element_Textarea('description'); $element->setLabel('其他描述'); $element->setDescription('更多详细信息,例如: 交通是否方便? 是否有独立卫生间和厨房? 是否仅限女生? 是否有家具? 月租是否包括网费? 您的个人习惯等等。'); $element->setAttrib('rows', 4); if (isset($this->advertisement)) { $element->setValue($this->advertisement->description); } $this->addElement($element); $element = new Elements(); $element->addReCaptcha($this); $element = new Zend_Form_Element_Submit('post'); $element->setValue('提交')->removeDecorator('Label'); $this->addElement($element); $this->addDisplayGroup(array('isBusiness', 'type', 'title', 'address', 'rent', 'currency', 'rent_measurement', 'start_date', 'stop_date', 'area', 'num_of_room', 'description', 'challenge', 'post'), 'aboutRoom'); $this->getDisplayGroup('aboutRoom')->removeDecorator('DtDdWrapper'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $institutions = new Institutions(); $inst_options = $institutions->getInsts(); $rulers = new Rulers(); $ruler_options = $rulers->getRomanRulers(); $discs = new DiscoMethods(); $disc_options = $discs->getOptions(); $periods = new Periods(); $period_options = $periods->getPeriodFrom(); $periods = new Periods(); $periodword_options = $periods->getPeriodFromWords(); $reasons = new Findofnotereasons(); $reason_options = $reasons->getReasons(); $rallies = new Rallies(); $rally_options = $rallies->getRallies(); $counties = new OsCounties(); $county_options = $counties->getCountiesID(); $regions = new OsRegions(); $region_options = $regions->getRegionsID(); $terminalDates = new TerminalReasons(); $termOptions = $terminalDates->getReasons(); $qualityRatings = new DataQuality(); $qualityStreet = $qualityRatings->getRatings(); $current_year = date('Y'); $years = range(1650, $current_year); $years_list = array_combine($years, $years); $reeces = new Reeces(); $reece_options = $reeces->getReeces(); $siteclasses = new ArchaeologicalSiteClass(); $siteclass_options = $siteclasses->getOptions(); $contexts = new ArchaeologicalContexts(); $context_options = $contexts->getOptions(); $features = new ArchaeologicalFeatures(); $feature_options = $features->getOptions(); parent::__construct($options); $this->setName('AdvancedHoards'); $old_findID = new Zend_Form_Element_Text('old_findID'); $old_findID->setLabel('Find number: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(3, 20))->addErrorMessage('Please enter a valid number!'); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('HOARD')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid object type!'); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Hoard description contains: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term'); //Find of note $findofnote = new Zend_Form_Element_Checkbox('note'); $findofnote->setLabel('Find of Note: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); //Reason for find of note $findofnotereason = new Zend_Form_Element_Select('reason'); $findofnotereason->setLabel('Reason for noteworthy status: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose reason', 'Available reasons' => $reason_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); //Institution $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow')); $notes = new Zend_Form_Element_Text('notes'); $notes->setLabel('Notes: ')->addFilters(array('StringTrim', 'StripTags')); $broadperiod = new Zend_Form_Element_Select('broadperiod'); $broadperiod->setLabel('Broad period: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $periodword_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate1subperiod = new Zend_Form_Element_Select('fromsubperiod'); $objdate1subperiod->setLabel('Sub period from: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available sub period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period from: Assigned via dropdown $objdate1period = new Zend_Form_Element_Select('periodFrom'); $objdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate2subperiod = new Zend_Form_Element_Select('tosubperiod'); $objdate2subperiod->setLabel('Sub period to: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available subperiods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setDisableTranslator(true)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period to: Assigned via dropdown $objdate2period = new Zend_Form_Element_Select('periodTo'); $objdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $from = new Zend_Form_Element_Text('fromdate'); $from->setLabel('Start date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'))->setDescription('If you want to search for a date range, ' . 'enter a start date in this box and and end in the ' . 'box below. You do not need to add AD or BC'); $to = new Zend_Form_Element_Text('todate'); $to->setLabel('End date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $workflow = new Zend_Form_Element_Select('workflow'); $workflow->setLabel('Workflow stage: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow')); if (in_array($this->_role, $this->_higherlevel)) { $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published'))); } if (in_array($this->_role, $this->_restricted)) { $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published'))); } $treasure = new Zend_Form_Element_Checkbox('treasure'); $treasure->setLabel('Treasure find: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); $treasureID = new Zend_Form_Element_Text('TID'); $treasureID->setLabel('Treasure ID number: ')->addFilters(array('StringTrim', 'StripTags')); //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $other_ref = new Zend_Form_Element_Text('otherRef'); $other_ref->setLabel('Other reference: ')->addFilters(array('StringTrim', 'StripTags')); $smrRef = new Zend_Form_Element_Text('smrRef'); $smrRef->setLabel('SMR reference: ')->addFilters(array('StringTrim', 'StripTags')); $county = new Zend_Form_Element_Select('countyID'); $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $district = new Zend_Form_Element_Select('districtID'); $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $parish = new Zend_Form_Element_Select('parishID'); $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $regionID = new Zend_Form_Element_Select('regionID'); $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $gridref = new Zend_Form_Element_Text('gridref'); $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StringTrim', 'StripTags')); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags')); $idBy = new Zend_Form_Element_Text('idBy'); $idBy->setLabel('Primary identifier: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags')); $identifierID = new Zend_Form_Element_Hidden('identifierID'); $identifierID->addFilters(array('StringTrim', 'StripTags')); $created = new Zend_Form_Element_Text('createdBefore'); $created->setLabel('Date record created on or before: ')->addFilters(array('StringTrim', 'StripTags')); $created2 = new Zend_Form_Element_Text('createdAfter'); $created2->setLabel('Date record created on or after: ')->addFilters(array('StringTrim', 'StripTags')); $updated = new Zend_Form_Element_Text('updatedBefore'); $updated->setLabel('Date record updated on or before: ')->addFilters(array('StringTrim', 'StripTags')); $updated2 = new Zend_Form_Element_Text('updatedAfter'); $updated2->setLabel('Date record updated on or after: ')->addFilters(array('StringTrim', 'StripTags')); $finder = new Zend_Form_Element_Text('finder'); $finder->setLabel('Found by: ')->addFilters(array('StringTrim', 'StripTags')); $finderID = new Zend_Form_Element_Hidden('finderID'); $finderID->addFilters(array('StringTrim', 'StripTags')); $recordby = new Zend_Form_Element_Text('recordername'); $recordby->setLabel('Recorded by: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('autoComplete', 'true'); $recorderID = new Zend_Form_Element_Hidden('recorderID'); $recorderID->addFilters(array('StringTrim', 'StripTags')); $discoverydate = new Zend_Form_Element_Select('discovered'); $discoverydate->setLabel('Year of discovery')->setMultiOptions(array(null => 'Choose a year of discovery', 'Date range' => $years_list))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Submit your search'); $woeid = new Zend_Form_Element_Text('woeid'); $woeid->setLabel('Where on earth ID: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim')); $elevation = new Zend_Form_Element_Text('elevation'); $elevation->setLabel('Elevation: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim')); $lastRulerID = new Zend_Form_Element_Select('lastRulerID'); $lastRulerID->setLabel('Last Ruler: ')->addValidator('Int')->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setDescription('You need to pick a broad period first')->setRegisterInArrayValidator(false); $termDate1 = new Zend_Form_Element_Text('fromTerminalYear'); $termDate1->setLabel('Terminal year from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $termDate2 = new Zend_Form_Element_Text('toTerminalYear'); $termDate2->setLabel('Terminal year to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $qualityRatingNum = new Zend_Form_Element_Select('qualityRatingNumismatic'); $qualityRatingNum->setLabel('Coin data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $qualityRatingArch = new Zend_Form_Element_Select('qualityRatingArchaeological'); $qualityRatingArch->setLabel('Archaeology data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $qualityRatingFindspot = new Zend_Form_Element_Select('qualityRatingFindspot'); $qualityRatingFindspot->setLabel('Findspot data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $terminalReasonID = new Zend_Form_Element_Select('terminalReasonID'); $terminalReasonID->setLabel('Terminal date reasoning: ')->addMultiOptions(array(null => 'Choose terminal reasoning', 'Available options' => $termOptions))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $excavatedYear1 = new Zend_Form_Element_Text('excavatedYear1'); $excavatedYear1->setLabel('Excavated year first date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $excavatedYear2 = new Zend_Form_Element_Text('excavatedYear2'); $excavatedYear2->setLabel('Excavated year end date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $archaeologicalDescription = new Zend_Form_Element_Text('archaeologyDescription'); $archaeologicalDescription->setLabel('Archaeological description contains: '); //Period from: Assigned via dropdown $archdate1period = new Zend_Form_Element_Select('archaeologyPeriodFrom'); $archdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period to: Assigned via dropdown $archdate2period = new Zend_Form_Element_Select('archaeologyPeriodTo'); $archdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $siteDateYear1 = new Zend_Form_Element_Text('siteDateYear1'); $siteDateYear1->setLabel('Site date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $siteDateYear2 = new Zend_Form_Element_Text('siteDateYear2'); $siteDateYear2->setLabel('Site date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $featureDateYear1 = new Zend_Form_Element_Text('featureDateYear1'); $featureDateYear1->setLabel('Feature date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $featureDateYear2 = new Zend_Form_Element_Text('featureDateYear2'); $featureDateYear2->setLabel('Feature date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $knownSite = new Zend_Form_Element_Checkbox('knownSite'); $knownSite->setLabel('Known site: ')->setUncheckedValue(null); $excavated = new Zend_Form_Element_Checkbox('excavated'); $excavated->setLabel('Excavated: ')->setUncheckedValue(null); $siteclass = new Zend_Form_Element_Select('siteClassID'); $siteclass->setLabel('Site class: ')->addMultioptions(array(null => 'Choose class of site', 'Available classes' => $siteclass_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($siteclass_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow'); $arch_context = new Zend_Form_Element_Select('siteContextID'); $arch_context->setLabel('Context: ')->addMultioptions(array(null => 'Choose a context', 'Available contexts' => $context_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($context_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow'); $arch_feature = new Zend_Form_Element_Select('featureID'); $arch_feature->setLabel('Feature: ')->addMultioptions(array(null => 'Choose a feature', 'Available features' => $feature_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($feature_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow'); $quantityCoins = new Zend_Form_Element_Text('quantityCoins'); $quantityCoins->setLabel('Quantity of coins in hoard: '); $quantityCoins->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box'); $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts'); $quantityArtefacts->setLabel('Quantity of artefacts in hoard: '); $quantityArtefacts->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box'); $quantityContainers = new Zend_Form_Element_Text('quantityContainers'); $quantityContainers->setLabel('Quantity of containers in hoard: '); $quantityContainers->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box'); $legacyID = new Zend_Form_Element_Text('legacyID'); $legacyID->setLabel('Legacy hoard database number: '); //Reece $reece = new Zend_Form_Element_Select('reeceID'); $reece->setLabel('Reece period: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose Reece period', 'Available Reece periods' => $reece_options))->addValidator('InArray', false, array(array_keys($reece_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); if (in_array($this->_role, $this->_restricted)) { $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $termDate1, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $submit, $elevation, $woeid, $institution, $hash, $smrRef, $lastRulerID, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $archaeologicalDescription, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $knownSite, $excavated, $siteclass, $arch_context, $arch_feature, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period)); } else { $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $elevation, $woeid, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $idBy, $finder, $finderID, $recordby, $recorderID, $identifierID, $lastRulerID, $submit, $institution, $archaeologicalDescription, $smrRef, $hash, $termDate1, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $siteclass, $arch_context, $arch_feature, $knownSite, $excavated, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period)); } $this->addDisplayGroup(array('old_findID', 'objecttype', 'description', 'notes', 'note', 'reason', 'treasure', 'TID', 'rally', 'rallyID', 'workflow', 'otherRef', 'smrRef', 'quantityArtefacts', 'quantityCoins', 'quantityContainers'), 'details'); $this->details->setLegend('Main details: '); $this->addDisplayGroup(array('broadperiod', 'periodFrom', 'periodTo', 'fromdate', 'todate'), 'temporaldetails'); $this->temporaldetails->setLegend('Dates and periods: '); $this->addDisplayGroup(array('lastRulerID', 'reeceID', 'fromTerminalYear', 'toTerminalYear', 'terminalReasonID', 'legacyID', 'qualityRatingNumismatic'), 'numismatics'); $this->numismatics->setLegend('Numismatic analysis: '); $this->addDisplayGroup(array('knownSite', 'excavated', 'archaeologyPeriodFrom', 'archaeologyPeriodTo', 'archaeologyDescription', 'excavatedYear1', 'excavatedYear2', 'siteClassID', 'siteContextID', 'featureID', 'featureDateYear1', 'featureDateYear2', 'qualityRatingArchaeological'), 'archaeology'); $this->archaeology->setLegend('Archaeological context: '); $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'fourFigure', 'elevation', 'woeid', 'qualityRatingFindspot'), 'Spatial'); $this->Spatial->setLegend('Spatial details: '); if (in_array($this->_role, $this->_restricted)) { $this->addDisplayGroup(array('institution', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery'); } else { $this->addDisplayGroup(array('institution', 'finder', 'idBy', 'identifierID', 'recordername', 'recorderID', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery'); } $this->Discovery->setLegend('Discovery details: '); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
/** * Faz o parse de um elemento <int> para Zend_Form. * @param SimpleXMLElement $element */ protected function parseInt($element) { $form_element = new Zend_Form_Element_Text((string) $element->id); $validate_ìnt = new Zend_Validate_Int(); $validate_ìnt->setMessage("Somente números inteiros"); $form_element->addValidator($validate_ìnt); $form_element->setLabel((string) $element->label); $form_element->setAttrib('size', $element->size); if (isset($element->unit)) { $form_element->setDescription($element->unit); } if (isset($element->value)) { $form_element->setValue($element->value); } else { if (isset($element->default)) { $form_element->setValue($element->default); } } return $form_element; }
/** * @author code generate * @return mixed */ public function __construct($option = array()) { $userId = new Zend_Form_Element_Hidden('TutorId'); $userId->setDecorators(array('ViewHelper')); $this->addElement($userId); $birthDay = new Zend_Form_Element_Text('Birthday'); $birthDay->setLabel('Ngày sinh *'); $birthDay->addFilter('StringTrim'); $birthDay->setRequired(true); $birthDay->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $birthDay->addValidator('stringLength', false, array(2, 50, "messages" => "Ngày sinh dài tối đa 50 ký tự")); $this->addElement($birthDay); $gender = new Zend_Form_Element_Select('Gender'); $gender->setLabel('Giới tính *'); $gender->addFilter('StringTrim'); $gender->setRequired(true); $gender->setMultiOptions(array('1' => 'Nam', '0' => 'Nữ')); $gender->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $gender->setSeparator(''); $gender->setValue("1"); $this->addElement($gender); $email = new Zend_Form_Element_Text('Email'); $email->setLabel('Email *'); $email->addFilter('StringTrim'); $email->setRequired(true); $email->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $email->addValidator(new Zend_Validate_Db_NoRecordExists("Tutors", "Email")); $email->addValidator('EmailAddress', true); $email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Email không phù hợp"))); $this->addElement($email); $userName = new Zend_Form_Element_Text('UserName'); $userName->setLabel('Họ tên *'); $userName->addFilter('StringTrim'); $userName->setRequired(true); $userName->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $userName->addValidator('stringLength', false, array(2, 50, "messages" => "Họ tên dài tối đa 2-50 ký tự")); $this->addElement($userName); $address = new Zend_Form_Element_Text('Address'); $address->setLabel('Địa chỉ *'); $address->addFilter('StringTrim'); $address->setRequired(true); $address->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $userName->addValidator('stringLength', false, array(1, 100, "messages" => "Địa chỉ dài tối đa 100 ký tự")); $this->addElement($address); $phone = new Zend_Form_Element_Text('Phone'); $phone->setLabel('Điện thoại *'); $phone->addFilter('StringTrim'); $phone->setRequired(true); $phone->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $phone->addValidator('stringLength', false, array(6, 50, "messages" => "Điện thoại dài tối đa 6-50 ký tự")); $this->addElement($phone); $required = new Zend_Validate_NotEmpty(); $required->setType($required->getType() | Zend_Validate_NotEmpty::INTEGER | Zend_Validate_NotEmpty::ZERO); $level = new Zend_Form_Element_Select('Level'); $level->setLabel('Trình độ *'); $level->addFilter('StringTrim'); $level->addValidator('Int'); $level->setRequired(true); $level->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $level->addValidators(array($required)); $level->setMultiOptions(unserialize(TUTOR_LEVELS)); $this->addElement($level); $university = new Zend_Form_Element_Text('University'); $university->setLabel('Trường tốt nghiệp *'); $university->addFilter('StringTrim'); $university->setRequired(true); $university->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $university->addValidator('stringLength', false, array(1, 100, "messages" => "Trường tố nghiệp dài tối đa 100 ký tự")); $this->addElement($university); $subject = new Zend_Form_Element_Text('Subject'); $subject->setLabel('Chuyên ngành *'); $subject->addFilter('StringTrim'); $subject->setRequired(true); $subject->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $subject->addValidator('stringLength', false, array(1, 100, "messages" => "Chuyên ngành dài tối đa 100 ký tự")); $this->addElement($subject); $experienceYears = new Zend_Form_Element_Select('ExperienceYears'); $experienceYears->setLabel('Số Năm Kinh Nghiệm *'); $experienceYears->addFilter('StringTrim'); $experienceYears->setRequired(false); $experienceYears->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $options = unserialize(EXPERIENCE_YEAR); //$experienceYears->addMultiOptions(array_combine($options, $options)); $experienceYears->setMultiOptions(unserialize(EXPERIENCE_YEAR)); $this->addElement($experienceYears); $career = new Zend_Form_Element_Select('Career'); $career->setLabel('Hiện tại là *'); $career->addFilter('StringTrim'); $career->addValidator('Int'); $career->setRequired(true); $career->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $career->setMultiOptions(unserialize(TUTOR_CAREERS)); $this->addElement($career); $careerLocation = new Zend_Form_Element_Text('CareerLocation'); $careerLocation->setLabel('Nơi Công Tác ( Giáo hoặc Giảng Viên ) *'); $careerLocation->addFilter('StringTrim'); $careerLocation->setRequired(false); $careerLocation->setAttrib('style', 'min-height: 30px;'); $careerLocation->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $careerLocation->addValidator('stringLength', false, array(1, 100, "messages" => "Nơi Công Tác dài tối đa 100 ký tự")); $this->addElement($careerLocation); $teachableInClass = new Zend_Form_Element_Text('TeachableInClass'); $teachableInClass->setLabel('Lớp Có Thể Dạy'); $teachableInClass->addFilter('StringTrim'); $teachableInClass->setRequired(false); $teachableInClass->setAttrib('disabled', true); $teachableInClass->setDescription('<a id="grades-modal" class="btn btn-info" title="Chọn lớp">...</a>'); $teachableInClass->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($teachableInClass); $teachableSubjects = new Zend_Form_Element_Text('TeachableSubjects'); $teachableSubjects->setLabel('Môn Có Thể Dạy'); $teachableSubjects->addFilter('StringTrim'); $teachableSubjects->setRequired(false); $teachableSubjects->setAttrib('disabled', true); $teachableSubjects->setDescription('<a id="subjects-modal" class="btn btn-info" title="Chọn môn">...</a>'); $teachableSubjects->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($teachableSubjects); $teachableDistricts = new Zend_Form_Element_Text('TeachableDistricts'); $teachableDistricts->setLabel('Khu Vực Có Thể Dạy'); $teachableDistricts->addFilter('StringTrim'); $teachableDistricts->setRequired(false); $teachableDistricts->setAttrib('disabled', true); $teachableDistricts->setDescription('<span id="districts-modal" class="btn btn-info" title="Chọn quận">...</span>'); $teachableDistricts->setDecorators(array('ViewHelper', array('Description', array('escape' => false)), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control col-lg-6')), array('Label', array('class' => 'control-label col-lg-2')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($teachableDistricts); $avatar = new Zend_Form_Element_Hidden('Upload'); $avatar->setLabel('Hình đại diện'); $avatar->setRequired(false); $avatar->setDescription('fieldlabel'); $avatar->setDecorators(array('ViewHelper', array(array('Description' => 'HtmlTag'), array('tag' => 'div', 'id' => "file-uploader")), array(array('Errors' => 'HtmlTag'), array('placement' => 'append', 'tag' => 'img', 'id' => 'progress-img', 'src' => "/scripts/upload/loading.gif")), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control', 'style' => "position: relative;float: left;margin-left: 20px;")), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($avatar); $avatarNote = new Zend_Form_Element_Hidden('Avatar'); $avatarNote->setLabel('Chú ý'); $avatarNote->setRequired(false); $avatarNote->setDescription("Kích thước khoảng: 240 x 120 (px)<br>Kích cỡ cho phép: " . IMAGE_SIZE_LIMIT . " kB"); $avatarNote->setDecorators(array('ViewHelper', array('Description', array('escape' => false, 'tag' => 'div')), array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group', 'style' => "float: left;")))); $this->addElement($avatarNote); $introduction = new Zend_Form_Element_Textarea('Introduction'); $introduction->setLabel('Giới thiệu bản thân'); $introduction->addFilter('StringTrim'); $introduction->setRequired(false); $introduction->setOptions(array('cols' => '10', 'rows' => '4')); /* $introduction->setDecorators(array('ViewHelper')); */ $introduction->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $subject->addValidator('stringLength', false, array(1, 2000, "messages" => "Giới thiệu bản thân dài tối đa 2000 ký tự")); $this->addElement($introduction); $isDisabled = new Zend_Form_Element_Text('IsDisabled'); $isDisabled->setLabel('IsDisabled'); $isDisabled->addFilter('StringTrim'); $isDisabled->addValidator('Int'); $isDisabled->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElement($isDisabled); $submit = new Zend_Form_Element_Submit('Save'); $submit->setLabel('Đăng ký'); $submit->setAttrib('class', 'btn btn-primary'); $submit->setDecorators(array('ViewHelper')); $this->addElement($submit); $reset = new Zend_Form_Element_Reset('Reset'); $reset->setLabel('Làm lại'); $reset->setAttrib('class', 'btn btn-primary'); $reset->setDecorators(array('ViewHelper')); $this->addElement($reset); $this->addDisplayGroup(array('UserName', 'Gender', 'Birthday', 'Email', 'Address', 'Phone'), 'contact', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin cá nhân')); $contact = $this->getDisplayGroup('contact'); $contact->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); $this->addDisplayGroup(array('Level', 'University', 'Subject', 'Career', 'CareerLocation', 'ExperienceYears'), 'level', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin học vấn')); $level = $this->getDisplayGroup('level'); $level->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); $this->addDisplayGroup(array('TeachableInClass', 'TeachableSubjects', 'TeachableDistricts', 'Upload', 'Avatar', 'Introduction'), 'extra', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin thêm')); $extra = $this->getDisplayGroup('extra'); $extra->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); $this->addDisplayGroup(array('Save', 'Reset'), 'submit', array('disableLoadDefaultDecorators' => false, 'legend' => 'Thông tin học vấn')); $submit = $this->getDisplayGroup('submit'); $submit->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'fieldset', 'class' => 'well the-fieldset')))); }