• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Form_SubForm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Zend_Form_SubForm的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_SubForm类的具体用法?PHP Zend_Form_SubForm怎么用?PHP Zend_Form_SubForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Zend_Form_SubForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _prepareForm

 /**
  * Prepare form
  * 
  * @param Uni_Core_Form $form 
  */
 protected function _prepareForm(Uni_Core_Form $form)
 {
     $form->setName('menu')->setMethod('post');
     $subForm1 = new Zend_Form_SubForm();
     $subForm1->setLegend('Menu Item Information');
     $subForm1->setDescription('Menu Item Information');
     $idField = new Zend_Form_Element_Hidden('id');
     $title = new Zend_Form_Element_Text('title', array('class' => 'required', 'maxlength' => 200));
     $title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $link = new Zend_Form_Element_Text('link', array('maxlength' => 200));
     $link->setLabel('Link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDescription('Use module/controller/action for internal links or http://www.example.com for external links');
     $open_window = new Zend_Form_Element_Select('open_window', array('class' => 'required', 'maxlength' => 200));
     $open_window->setRequired(true)->setLabel('Open Window')->setMultiOptions(Fox::getModel('navigation/menu')->getAllTargetWindows());
     $status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200));
     $status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menu')->getAllStatuses());
     $sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200));
     $sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $style_class = new Zend_Form_Element_Text('style_class');
     $style_class->setLabel('Style Class')->addFilter('StripTags')->addFilter('StringTrim');
     $menugroup = new Zend_Form_Element_Multiselect('menu_group', array('class' => 'required'));
     $menugroup->setRequired(true)->setLabel('Menu Group')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setMultiOptions(Fox::getModel('navigation/menugroup')->getMenuGroupOptions());
     $subForm1->addElements(array($idField, $title, $link, $open_window, $sort_order, $style_class, $status, $menugroup));
     $form->addSubForm($subForm1, 'subform1');
     parent::_prepareForm($form);
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:30,代码来源:Form.php


示例2: init

 public function init()
 {
     parent::init();
     /*
      * Translations
      */
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Text('title');
         $element->setLabel('Titel (eigen)')->setDescription('Deze titel is voor gebruik in eigen administratie.')->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Text('display_title');
         $element->setLabel('Titel (gebruiker)')->setDescription('Deze titel krijgen de gebruikesr van het systeem te zien.')->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('title', 'display_title', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     /*
      * Submit
      */
     $element = new Zend_Form_Element_Submit('submit_chargeoptional');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_chargeoptional'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_chargeoptional'));
 }
开发者ID:jaspermeijaard,项目名称:home-booking-system,代码行数:35,代码来源:Chargeoptional.php


示例3: init

 public function init()
 {
     $this->setAttrib('id', 'customAttribute');
     // Create and configure username element:
     $label = $this->createElement('text', 'label', array('label' => 'Label:'));
     $label->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags');
     $description = $this->createElement('text', 'description', array('label' => 'Description:'));
     $description->addFilter('StringTrim')->addFilter('StripTags');
     $required = $this->createElement('select', 'required', array('label' => 'Required?'));
     $required->setRequired(true)->setMultiOptions(array('1' => 'Yes', '0' => 'No'))->setAllowEmpty(false);
     $rowCt = $this->createElement('hidden', 'rowCt');
     $rowCt->setValue($this->_numberOfOptions);
     $rowCt->setDecorators(array('ViewHelper'));
     $this->addElements(array($label, $description, $required, $rowCt));
     if ($this->_numberOfOptions != 0) {
         $container = new Zend_Form_SubForm();
         $container->setDescription('Options:');
         $container->setDecorators(array(array('Description', array('tag' => 'label', 'class' => 'control-label')), array('FormElements'), array(array('controlsWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'control-group', 'id' => 'optionElement'))));
         $container->setElementDecorators(array('ViewHelper', 'FormElements'));
         $this->addSubForm($container, 'options');
         for ($i = 0; $i < $this->_numberOfOptions; $i++) {
             $optionSubform = new Ot_Form_CustomAttributeOption();
             $container->addSubForm($optionSubform, $i);
         }
         $this->addElement('button', 'addElement', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_SUCCESS, 'label' => 'Add Option', 'icon' => 'plus', 'whiteIcon' => true, 'iconPosition' => Twitter_Bootstrap_Form_Element_Button::ICON_POSITION_LEFT));
     }
     $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'Save Attribute'));
     $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button'));
     $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions')));
     return $this;
 }
开发者ID:ncsuwebdev,项目名称:otframework,代码行数:31,代码来源:CustomAttribute.php


示例4: addRows

 /**
  * Adds extra rows to the form
  *
  * @access public
  * @param mixed $data. (default: null)
  * @return void
  */
 public function addRows($start, $end)
 {
     for ($i = $start; $i < $end; $i++) {
         $rows = new Zend_Form_SubForm();
         $rows->setIsArray(true);
         $rows->setOrder($i);
         foreach ($this->_childlist as $col => $name) {
             switch ($col) {
                 case "item_id":
                     $rows->addElement("select", $col, array("attribs" => array("class" => "form-control products"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_childlist[$col], "validators" => array(), "belongsTo" => "rows{$i}"));
                     break;
                 case "number":
                     $rows->addElement("select", $col, array("attribs" => array("class" => "form-control batches"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_childlist[$col], "validators" => array(), "belongsTo" => "rows{$i}"));
                     break;
                 default:
                     $rows->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_childlist[$col], "validators" => array(), "belongsTo" => "rows{$i}"));
                     break;
             }
         }
         $rows->addElement("text", "ava_qty", array("attribs" => array("class" => "form-control", "readonly" => "readonly"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "belongsTo" => "rows{$i}"));
         $rows->addElement("text", "expiry_date", array("attribs" => array("class" => "form-control", "readonly" => "readonly"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "belongsTo" => "rows{$i}"));
         $rows->addElement("text", "quantity", array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "belongsTo" => "rows{$i}"));
         foreach ($rows->getElements() as $element) {
             $element->removeDecorator("Label");
             $element->removeDecorator("HtmlTag");
         }
         $this->addSubForm($rows, "rows{$i}");
     }
 }
开发者ID:uppaljs,项目名称:pakistan-vlmis-v2,代码行数:36,代码来源:PlannedIssue.php


示例5: buildForm

 public function buildForm()
 {
     $this->clearElements();
     $hourForm = new Zend_Form_SubForm();
     foreach ($this->data as $record) {
         $elm = new Zend_Form_Element((string) $record['id']);
         $elm->setValue($record);
         $hourForm->addElement($elm);
     }
     $this->addSubForm($hourForm, $this->key_existing);
     // add template element
     $newForm = new Zend_Form_SubForm();
     $elm = new Zend_Form_Element('__unique__');
     $newForm->addElement($elm);
     // add elements based on $_POST, (this is crap but will do for now)
     if (isset($_POST['hour_new'])) {
         foreach ($_POST['hour_new'] as $idx => $values) {
             if ($idx != '__unique__') {
                 $elm = new Zend_Form_Element($idx);
                 $elm->setValue($values);
                 $newForm->addElement($elm);
             }
         }
     }
     $this->addSubForm($newForm, $this->key_new);
 }
开发者ID:TBeijen,项目名称:Zend_Form_Dynamic,代码行数:26,代码来源:My_Form_Hours.php


示例6: init

 public function init()
 {
     parent::init();
     $subForm = new Zend_Form_SubForm('Translation');
     $langs = Model_Hm_Lang::listAll();
     foreach ($langs as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Text('name');
         $element->setLabel('Naam')->setAttrib('maxlength', 64)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 64))))->setRequired(true);
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('name', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
         $subForm->addSubForm($subSubForm, $lang->code);
         $this->bhvkSubDecorators($subSubForm);
     }
     $this->addSubForm($subForm, 'Translation');
     $this->bhvkSubDecorators($subForm);
     $element = new Zend_Form_Element_Submit('submit_category');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element)->addDisplayGroup(array('submit_category'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('submit_category');
 }
开发者ID:jaspermeijaard,项目名称:home-booking-system,代码行数:25,代码来源:Category.php


示例7: populate

 public function populate(array $values)
 {
     $diseasesList = $this->_object->_diseasesSrc();
     $oDiseases = new DiseasesDetailsObject();
     $dData = $oDiseases->findData(array($oDiseases->getForeignKey() => $values[$this->_object->getForeignKey()]));
     $fieldSet = $this->getDisplayGroup('diseases');
     $i = 6;
     foreach ($diseasesList as $id => $disease) {
         $tmpForm = new FormDiseasesDetails(array('object' => $oDiseases, 'isXmlHttpRequest' => true));
         if (!empty($values['MR_Diseases']) && in_array($id, $values['MR_Diseases'])) {
             $oDiseases->setFilters(array($oDiseases->getForeignKey() => $values[$this->_object->getForeignKey()], 'DD_DiseaseId' => $id));
             $data = $oDiseases->getAll();
             $data[0]['DD_TypeMedic'] = explode(',', $data[0]['DD_TypeMedic']);
             $tmpForm->populate($data[0]);
         }
         $elems = $tmpForm->getElements();
         $test = new Zend_Form_SubForm();
         $test->setDisableLoadDefaultDecorators(true);
         $test->addElements($elems);
         $test->removeDecorator('DtDdWrapper');
         $test->setLegend('Détails pour ' . $disease);
         $test->setAttrib('class', 'infosFieldsetParent fieldsetDiseaseDetails');
         $test->setOrder($i++);
         $this->addSubForm($test, 'dd_' . $id);
     }
     parent::populate($values);
 }
开发者ID:anunay,项目名称:stentors,代码行数:27,代码来源:FormMedicalProfile.php


示例8: init

 public function init()
 {
     $this->setAction('/core/submit/new');
     $type = new Zend_Form_Element_MultiCheckbox('submission_type');
     $type->setLabel('')->setRequired(false)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('submission_type'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title')->setRequired(true)->addValidator('StringLength', true, array(2, 64, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer title', Zend_Validate_StringLength::TOO_LONG => 'Your title is too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 64 characters')->setAttrib('maxLength', 64)->setDecorators(array('Composite'));
     $audience = new Zend_Form_Element_Radio('target_audience');
     $audience->setLabel('Please mark the target audience for your presentation')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('target_audience'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $publish = new Zend_Form_Element_Radio('publish_paper');
     $publish->setLabel('Please indicate whether you wish to prepare a full paper for possible publication')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('publish_paper', 'submit'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $topicModel = new Core_Model_Topic();
     $topicsForSelect = $topicModel->getTopicsForSelect();
     $topicsel = new Zend_Form_Element_MultiCheckbox('topic');
     $topicsel->setLabel('Topic')->setRequired(false)->setAttrib('class', 'tiny')->setMultiOptions($topicsForSelect)->setSeparator('<br />')->setDecorators(array('Composite'));
     $keywords = new Zend_Form_Element_Text('keywords');
     $keywords->setLabel('Keywords')->setRequired(false)->addValidator('StringLength', true, array(2, 500, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide longer keywords', Zend_Validate_StringLength::TOO_LONG => 'Your keywords are too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 500 characters')->setDecorators(array('Composite'));
     $abstract = new Zend_Form_Element_Textarea('abstract');
     $abstract->setLabel('Submission Summary (If your submission is accepted, this will be publicly visible!)')->setAttrib('class', 'small')->setDescription('Must be between 5 and 2000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 2000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer abstract', Zend_Validate_StringLength::TOO_LONG => 'Your abstract is too long')))->setDecorators(array('Composite'));
     $comment = new Zend_Form_Element_Textarea('comment');
     $comment->setLabel('Information for Reviewers')->setAttrib('class', 'small')->setDescription('Must be between 5 and 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 1000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer description', Zend_Validate_StringLength::TOO_LONG => 'Your description is too long')))->setDecorators(array('Composite'));
     $file = new TA_Form_Element_MagicFile('file');
     $file->setLabel('Your submission (File must be pdf and no bigger than 10Mb) *')->setRequired(false)->addDecorators($this->_magicFileElementDecorator)->addValidators(array(array('Count', true, 1), array('Size', true, 10000000), array('Extension', true, array('pdf', 'case' => true)), array('MimeType', false, array('application/pdf'))));
     $file->getValidator('Extension')->setMessage('Only pdf files are allowed!');
     $subform = new Zend_Form_SubForm();
     $subform->setDecorators(array('FormElements'));
     $subform->addElements(array($type, $file, $title, $audience, $topicsel, $keywords, $abstract, $comment));
     $this->addSubForm($subform, 'submission');
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
开发者ID:br00k,项目名称:tnc-web,代码行数:30,代码来源:Submit.php


示例9: init

 public function init()
 {
     parent::init();
     $this->setAttrib('enctype', 'multipart/form-data');
     $element = new Zend_Form_Element_File('filename');
     $element->setLabel('Foto')->setDescription('Maximale grootte van de foto is 1mb')->setRequired(true)->setValidators(array(array('Count', false, 1), array('Size', false, 1024000), array('Extension', false, 'jpg,png,gif')))->setDestination(APPLICATION_PATH . '/../public/images/uploads/holidayhome/photos');
     $this->addElement($element);
     $this->addDisplayGroup(array('filename'), 'photogroup', array('legend' => 'Foto', 'class' => 'file'));
     $subForm = new Zend_Form_SubForm('Translation');
     foreach (Model_Hm_Lang::listAll() as $lang) {
         $subSubForm = new Zend_Form_SubForm($lang->code);
         $element = new Zend_Form_Element_Text('title');
         $element->setLabel('Titel')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 4, 'max' => 64))));
         $subSubForm->addElement($element);
         $element = new Zend_Form_Element_Textarea('description');
         $element->setLabel('Omschrijving')->setAttrib('rows', 2)->setAttrib('class', 'autoexpand')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 40))));
         $subSubForm->addElement($element);
         $subSubForm->addDisplayGroup(array('title', 'description'), $lang->code, array('class' => 'textarea', 'legend' => $lang->name));
         $this->bhvkSubDecorators($subSubForm);
         $subForm->addSubForm($subSubForm, $lang->code);
     }
     $this->bhvkSubDecorators($subForm);
     $this->addSubForm($subForm, 'Translation');
     $element = new Zend_Form_Element_Submit('photo_submit');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('photo_submit'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmit('photo_submit');
     $this->bhvkDecorateFile($this->getElement('filename'));
 }
开发者ID:jaspermeijaard,项目名称:home-booking-system,代码行数:31,代码来源:Photo.php


示例10: addTripLines

 public function addTripLines($tripCount = 1, $startDate, $buses = array())
 {
     // create subform
     $tripLinePanel = new Zend_Form_SubForm();
     $tripLinePanel->setDecorators($this->_displayGroupDecorators)->addAttribs(array('class' => 'fieldsetForm span-8'));
     for ($i = 1; $i <= $tripCount; ++$i) {
         // create bus element
         $bus = $this->_createBusElement($buses);
         // create departure time element
         $departureTime = $this->_createElement('text', 'departureTime', 'Ngày giờ đi', 'Làm ơn nhập ngày giờ đi', true);
         $departureTime->setValue($startDate . ' 00:00:00');
         $departureTime->addValidator(new TBB_Validate_DepartureTime($startDate));
         // create arrival time element
         $arrivalTime = $this->_createElement('text', 'arrivalTime', 'Ngày giờ đến', 'Làm ơn nhập ngày giờ đến', true);
         $arrivalTime->setValue($startDate . ' 00:00:00');
         $arrivalTime->addValidator(new TBB_Validate_ArrivalTime());
         $fare = $this->_createElement('text', 'fare', 'Giá vé', 'Làm ơn nhập giá vé', false, true);
         // create trip line
         $tripLine = new Zend_Form_SubForm();
         $tripLine->setDecorators($this->_displayGroupDecorators)->addAttribs(array('class' => 'span-7'))->setLegend('Chuyến #' . $i);
         // add elements to the tripline
         $tripLine->addElements(array($bus, $departureTime, $arrivalTime, $fare));
         $tripLinePanel->addSubForm($tripLine, $i);
     }
     // add submit button
     $submit = $this->_createSubmitButton();
     $tripLinePanel->addElement($submit);
     $this->addSubForm($tripLinePanel, 'tripLines');
 }
开发者ID:rizkioa,项目名称:etak6,代码行数:29,代码来源:TripCreateMultipleCont.php


示例11: addCustomVariable

 protected function addCustomVariable($varname)
 {
     $a = new \Zend_Form_SubForm();
     $a->addElement('note', 'title', array('label' => sprintf($this->translate('Custom Variable "%s"'), $varname)));
     $a->addElement('text', 'description', array('label' => $this->translate('Description'), 'required' => true));
     $a->addElement('text', 'default_value', array('label' => $this->translate('Default value')));
     $this->addSubForm($a, 'cv_' . $varname);
 }
开发者ID:dgoeger,项目名称:icingadirector,代码行数:8,代码来源:IcingaCommandArgumentForm.php


示例12: getForm

 public function getForm()
 {
     $form = new Zend_Form();
     $form->addElement('text', 'foo')->addElement('text', 'bar')->addElement('text', 'baz')->addElement('text', 'bat');
     $subForm = new Zend_Form_SubForm();
     $subForm->addElement('text', 'foo')->addElement('text', 'bar')->addElement('text', 'baz')->addElement('text', 'bat');
     $form->addDisplayGroup(array('foo', 'bar'), 'foobar')->addSubForm($subForm, 'sub')->setView(new Zend_View());
     return $form;
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:9,代码来源:DojoTest.php


示例13: getForm

 protected function getForm()
 {
     $translationKey = $this->_request->getParam('key');
     if (empty($translationKey)) {
         throw new Application_Exception('Parameters missing');
     }
     $form = new Zend_Form_SubForm();
     $form->addSubForm(new Setup_Form_LanguageKey($translationKey), $translationKey);
     return $form;
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:10,代码来源:LanguageController.php


示例14: init

 /**
  */
 public function init()
 {
     $this->addElement('hash', 'csrf');
     $this->addElement('select', 'type', array('label' => getGS('Type'), 'required' => true, 'multioptions' => array('reuters' => 'Thomson Reuters')));
     $config = new Zend_Form_SubForm();
     $config->addElement('text', 'username', array('label' => getGS('Username'), 'required' => true, 'filters' => array('stringTrim')));
     $config->addElement('text', 'password', array('label' => getGS('Password'), 'required' => true, 'filters' => array('stringTrim')));
     $this->addSubForm($config, 'config');
     $this->addElement('submit', 'submit', array('label' => getGS('Add'), 'ignore' => true));
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:12,代码来源:Ingest.php


示例15: indexAction

 public function indexAction()
 {
     // action body
     $idEncuesta = $this->getParam("idEncuesta");
     $encuesta = $this->encuestaDAO->obtenerEncuesta($idEncuesta);
     $secciones = $this->seccionDAO->obtenerSecciones($idEncuesta);
     $formulario = new Zend_Form($encuesta->getHash());
     //debemos agregar a este formulario campos para identificar quien es el que esta llenando esta encuesta
     $eSubCabecera = new Zend_Form_SubForm();
     $eSubCabecera->setLegend("Datos Personales: ");
     $eEncuesta = new Zend_Form_Element_Hidden("idEncuesta");
     $eEncuesta->setValue($idEncuesta);
     $eReferencia = new Zend_Form_Element_Text("referencia");
     $eReferencia->setLabel("Boleta o Clave : ");
     $eReferencia->setAttrib("class", "form-control");
     $eReferencia->setDecorators($this->decoratorsPregunta);
     $eSubCabecera->addElements(array($eEncuesta, $eReferencia));
     $eSubCabecera->setDecorators($this->decoratorsSeccion);
     $formulario->addSubForm($eSubCabecera, "referencia");
     //============================================= Iteramos a traves de las secciones del grupo
     foreach ($secciones as $seccion) {
         //============================================= Cada seccion es una subforma
         $subFormSeccion = new Zend_Form_SubForm($seccion->getHash());
         $subFormSeccion->setLegend("Sección: " . $seccion->getNombre());
         //============================================= Obtenemos los elemntos de la seccion
         $elementos = $this->seccionDAO->obtenerElementos($seccion->getIdSeccion());
         foreach ($elementos as $elemento) {
             //============================================= Verificamos que tipo de elemento es
             if ($elemento instanceof Encuesta_Model_Pregunta) {
                 //============================================= Aqui ya la agregamos a la seccion
                 $this->agregarPregunta($subFormSeccion, $elemento);
             } elseif ($elemento instanceof Encuesta_Model_Grupo) {
                 //============================================= un grupo es otra subform
                 $subFormGrupo = new Zend_Form_SubForm($elemento->getHash());
                 $subFormGrupo->setLegend("Grupo: " . $elemento->getNombre());
                 $preguntasGrupo = $this->grupoDAO->obtenerPreguntas($elemento->getIdGrupo());
                 foreach ($preguntasGrupo as $pregunta) {
                     //============================================= Aqui ya la agregamos al grupo
                     $this->agregarPregunta($subFormGrupo, $pregunta);
                 }
                 $subFormGrupo->setDecorators($this->decoratorsGrupo);
                 $subFormSeccion->addSubForm($subFormGrupo, $elemento->getIdGrupo());
             }
         }
         $subFormSeccion->setDecorators($this->decoratorsSeccion);
         $formulario->addSubForm($subFormSeccion, $seccion->getIdSeccion());
     }
     $eSubmit = new Zend_Form_Element_Submit("submit");
     $eSubmit->setLabel("Enviar Encuesta");
     $eSubmit->setAttrib("class", "btn btn-success");
     $formulario->addElement($eSubmit);
     $formulario->setDecorators($this->formDecorators);
     $this->view->encuesta = $encuesta;
     $this->view->formulario = $formulario;
 }
开发者ID:blackgios,项目名称:General,代码行数:55,代码来源:GeneradorController.php


示例16: init

 public function init()
 {
     $this->setAttrib('class', 'horizontal-form');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'id_fe_registration')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'fk_id_perdata')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'entity')->setIsArray(true);
     $elements[] = $this->createElement('text', 'client_name')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Naran Kompletu');
     $elements[] = $this->createElement('text', 'client_fone')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Kontatu');
     $elements[] = $this->createElement('text', 'email')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('E-mail');
     $elements[] = $this->createElement('text', 'evidence')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Kartaun Evidensia');
     $elements[] = $this->createElement('text', 'electoral')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Kartaun Eleitoral');
     $elements[] = $this->createElement('text', 'date_inserted')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12')->setLabel('Data');
     $mapperScholarityArea = new Register_Model_Mapper_ScholarityArea();
     $sections = $mapperScholarityArea->fetchAll();
     $optScholarityArea[''] = '';
     foreach ($sections as $section) {
         $optScholarityArea[$section['id_scholarity_area']] = $section['scholarity_area'];
     }
     $dbOccupationTimor = App_Model_DbTable_Factory::get('PROFOcupationTimor');
     $occupations = $dbOccupationTimor->fetchAll();
     $optOccupations[''] = '';
     foreach ($occupations as $occupation) {
         $optOccupations[$occupation['id_profocupationtimor']] = $occupation['acronym'] . ' ' . $occupation['ocupation_name_timor'];
     }
     $dbScholarityLevel = App_Model_DbTable_Factory::get('PerLevelScholarity');
     $levels = $dbScholarityLevel->fetchAll(array(), array('id_perlevelscholarity'));
     $optLevel[''] = '';
     foreach ($levels as $level) {
         $optLevel[$level->id_perlevelscholarity] = $level->level_scholarity;
     }
     $elementsProfessional = array();
     $elementsProfessional[] = $this->createElement('select', 'area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen focused')->setLabel('Area Kursu')->setBelongsTo('professional')->addMultiOptions($optScholarityArea);
     $elementsProfessional[] = $this->createElement('select', 'occupation')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Dezignasaun')->setBelongsTo('professional')->addMultiOptions($optOccupations);
     $elementsProfessional[] = $this->createElement('select', 'level')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optLevel)->setBelongsTo('professional')->setLabel('Nivel');
     $professionalSubForm = new Zend_Form_SubForm();
     $professionalSubForm->addElements($elementsProfessional);
     $this->addSubForm($professionalSubForm, 'professional');
     $elementsFormation = array();
     $elementsFormation[] = $this->createElement('select', 'area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen focused')->setLabel('Area Kursu')->setBelongsTo('formation')->addMultiOptions($optScholarityArea);
     $elementsFormation[] = $this->createElement('select', 'occupation')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Dezignasaun')->setBelongsTo('formation')->addMultiOptions($optOccupations);
     $elementsFormation[] = $this->createElement('select', 'level')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optLevel)->setBelongsTo('formation')->setLabel('Nivel');
     $formationSubForm = new Zend_Form_SubForm();
     $formationSubForm->addElements($elementsFormation);
     $this->addSubForm($formationSubForm, 'formation');
     $selectedElements = array();
     $selectedElements[] = $this->createElement('select', 'area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen focused')->setLabel('Area Kursu')->setBelongsTo('selected')->setRequired(true)->addMultiOptions($optScholarityArea);
     $selectedElements[] = $this->createElement('select', 'occupation')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Dezignasaun')->setBelongsTo('selected')->setRequired(true)->addMultiOptions($optOccupations);
     $selectedSubForm = new Zend_Form_SubForm();
     $selectedSubForm->addElements($selectedElements);
     $this->addSubForm($selectedSubForm, 'selected');
     $this->addElements($elements);
     App_Form_Toolbar::build($this, self::ID);
     $this->setDecorators($this->getDefaultFormDecorators());
 }
开发者ID:fredcido,项目名称:simuweb,代码行数:55,代码来源:FERegistration.php


示例17: addFields

 /**
  * Inclusão de Elementos
  * @param array $fields Conjunto de Identificadores e Conteúdo
  * @return Application_Form_Referencia Próprio Objeto para Encadeamento
  */
 public function addFields(array $fields)
 {
     $form = new Zend_Form_SubForm();
     foreach ($fields as $identifier => $content) {
         $element = new Zend_Dojo_Form_Element_TextBox($identifier);
         $element->setLabel($content)->setRequired(true);
         $form->addElement($element);
     }
     $this->addSubForm($form, 'conteudo');
     return $this;
 }
开发者ID:laiello,项目名称:wanderson,代码行数:16,代码来源:Referencia.php


示例18: setupForm

 public function setupForm()
 {
     $form1 = new Zend_Form_SubForm();
     $form1->addElement('text', 'foo', array('label' => 'Sub Foo: ', 'required' => true, 'validators' => array('NotEmpty', 'Alpha')))->addElement('text', 'bar', array('label' => 'Sub Bar: ', 'required' => true, 'validators' => array('Alpha', 'Alnum')));
     $form2 = new Zend_Form();
     $form2->addElement('text', 'foo', array('label' => 'Master Foo: ', 'required' => true, 'validators' => array('NotEmpty', 'Alpha')))->addElement('text', 'bar', array('required' => true, 'validators' => array('Alpha', 'Alnum')))->addSubForm($form1, 'sub');
     $form2->isValid(array('foo' => '', 'bar' => 'foo 2 u 2', 'sub' => array('foo' => '', 'bar' => 'foo 2 u 2')));
     $form2->setView($this->getView());
     $this->decorator->setElement($form2);
     $this->form = $form2;
     return $form2;
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:12,代码来源:FormErrorsTest.php


示例19: getSubFormMarkup

 /**
  *
  * @param Zend_Form_SubForm $form
  * @return string 
  */
 protected function getSubFormMarkup(Zend_Form_SubForm $form)
 {
     $content = '<h3 class="accordion-header"><a href="#">' . $form->getLegend() . '</a></h3>' . '<div id="' . $form->getId() . '" class="accordion-content"><ul><li>' . '<table cellspacing="0" cellpadding="0" border="0" align="left"><tbody>';
     $output = '';
     $elements = $form->getElements();
     if (is_array($elements)) {
         foreach ($elements as $element) {
             $element->setView($form->getView());
             $output = $this->getElementMarkup($element, $output);
         }
     }
     return $content . $output . '</tbody></table></li></ul></div>';
 }
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:18,代码来源:Accordion.php


示例20: initForm

 /**
  */
 public function initForm(Zend_Form $form, ListView $list, MemberView $member = null)
 {
     $newsletter = new Zend_Form_Su 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Gdata类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Form_Element_Xhtml类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap