コード例 #1
0
 public function __construct($name = NULL)
 {
     parent::__construct('cityForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'ctCatName', 'attributes' => array('type' => 'text', 'placeholder' => 'Add City Category', 'class' => 'commonDropDnInput')));
     $ctCatInfo = new Element\Textarea('ctCatInfo');
     $ctCatInfo->setLabel('Category Information');
     $ctCatInfo->setAttribute("class", "selectAreaInput");
     $ctCatInfo->setAttribute("rows", "4");
     $ctCatInfo->setAttribute("cols", "50");
     $this->add($ctCatInfo);
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
コード例 #2
0
ファイル: Content.php プロジェクト: sebaxplace/skilla-local
 public function __construct($name = null)
 {
     parent::__construct($name);
     //id
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     //titolo
     $this->add(array('name' => 'titolo', 'options' => array('label' => 'Titolo'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //contenuto
     $nota = new Element\Textarea('contenuto');
     $nota->setLabel('Contenuto');
     $nota->setAttribute('class', 'form-control');
     $nota->setAttribute('style', 'min-height:180px;');
     $this->add($nota);
     //Background
     $this->add(array('name' => 'background', 'attributes' => array('type' => 'Zend\\Form\\Element\\File'), 'options' => array('label' => 'Background')));
     // Posterlab
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'posterlab', 'options' => array('label' => 'Posterlab', 'empty_option' => 'Scegli un posterlab =>'), 'attributes' => array('class' => 'form-control', 'onChange' => 'javascript:caricaPosizioni()', 'id' => 'posterlabs')));
     // Posizione
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'posizione', 'options' => array('label' => 'posizione', 'empty_option' => 'Scegli una posizione =>', 'disable_inarray_validator' => true), 'attributes' => array('class' => 'form-control', 'id' => 'posizioni')));
     // tipo
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'tipo', 'options' => array('label' => 'Tipo', 'empty_option' => 'Scegli tipo =>'), 'attributes' => array('class' => 'form-control')));
     //stato
     $stato = new Element\Checkbox('stato');
     $stato->setLabel('Stato');
     $stato->setAttribute('class', 'make-switch');
     $this->add($stato);
     $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Salva', 'class' => 'btn green-haze pull-right')));
 }
コード例 #3
0
ファイル: TemplateForm.php プロジェクト: kristjanAnd/SimpleIV
 public function init()
 {
     $code = new Text('code');
     $code->setAttribute('id', 'code');
     $code->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('readonly', 'readonly')->setAttribute('placeholder', $this->translator->translate('template.form.code.placeholder'))->setLabel($this->translator->translate('template.form.code.label'));
     $this->add($code);
     $name = new Text('name');
     $name->setAttribute('id', 'name');
     $name->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('placeholder', $this->translator->translate('template.form.name.placeholder'))->setLabel($this->translator->translate('template.form.name.label'));
     $this->add($name);
     $titleEt = new Text('titleEt');
     $titleEt->setAttribute('id', 'titleEt');
     $titleEt->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('placeholder', $this->translator->translate('template.form.titleEt.placeholder'))->setLabel($this->translator->translate('template.form.titleEt.label'));
     $this->add($titleEt);
     $titleEn = new Text('titleEn');
     $titleEn->setAttribute('id', 'titleEn');
     $titleEn->setAttribute('required', 'required')->setAttribute('class', 'form-control')->setAttribute('placeholder', $this->translator->translate('template.form.titleEn.placeholder'))->setLabel($this->translator->translate('template.form.titleEn.label'));
     $this->add($titleEn);
     $contentEt = new Textarea('contentEt');
     $contentEt->setAttribute('id', 'contentEt');
     $contentEt->setAttribute('required', 'required')->setAttribute('class', 'editor')->setAttribute('placeholder', $this->translator->translate('template.form.contentEt.placeholder'))->setLabel($this->translator->translate('template.form.contentEt.label'));
     $contentEt->setAttribute('cols', 15);
     $contentEt->setAttribute('rows', 4);
     $this->add($contentEt);
     $contentEn = new Textarea('contentEn');
     $contentEn->setAttribute('id', 'contentEn');
     $contentEn->setAttribute('required', 'required')->setAttribute('class', 'editor')->setAttribute('placeholder', $this->translator->translate('template.form.contentEn.placeholder'))->setLabel($this->translator->translate('template.form.contentEn.label'));
     $contentEn->setAttribute('cols', 15);
     $contentEn->setAttribute('rows', 4);
     $this->add($contentEn);
     return $this;
 }
コード例 #4
0
ファイル: FileWithText.php プロジェクト: patrova/omeka-s
 public function form(PhpRenderer $view, SiteRepresentation $site, SitePageBlockRepresentation $block = null)
 {
     $textarea = new Textarea("o:block[__blockIndex__][o:data][html]");
     $textarea->setAttribute('class', 'block-html full wysiwyg');
     if ($block) {
         $textarea->setAttribute('value', $this->getData($block->data(), 'html'));
     }
     return $this->thumbnailTypeSelect($view, $site, $block) . $this->attachmentsForm($view, $site, $block) . $view->formRow($textarea);
 }
コード例 #5
0
ファイル: CityForm.php プロジェクト: viplovegithub/Myzend
 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('CityForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'ctname', 'attributes' => array('type' => 'text', 'placeholder' => 'City name', 'class' => 'commonDropDnInput')));
     $stid = new Element\Select('stid');
     $stid->setLabel('State name');
     $stid->setAttributes(array('id' => 'stid'));
     $stid->setValueOptions($this->getOptionState());
     $stid->setAttribute("class", "dropDnInput");
     $this->add($stid);
     $ctcatid = new Element\Select('ctcatid');
     $ctcatid->setLabel('City category');
     $ctcatid->setValueOptions($this->getOptionCityCat());
     $ctcatid->setAttribute("class", "dropDnInput");
     $this->add($ctcatid);
     $ctdescription = new Element\Textarea('ctdescription');
     $ctdescription->setLabel('City Description');
     $ctdescription->setAttribute("class", "selectAreaInput");
     $ctdescription->setAttribute("rows", "4");
     $ctdescription->setAttribute("cols", "50");
     $this->add($ctdescription);
     $ctspecialInstructions = new Element\Textarea('ctspecialInstructions');
     $ctspecialInstructions->setLabel('City Special Instruction Description');
     $ctspecialInstructions->setAttribute("class", "selectAreaInput");
     $ctspecialInstructions->setAttribute("rows", "4");
     $ctspecialInstructions->setAttribute("cols", "33");
     $this->add($ctspecialInstructions);
     $ctbestSeasonToVisit = new Element\Textarea('ctbestSeasonToVisit');
     $ctbestSeasonToVisit->setLabel('City Best Season to visit');
     $ctbestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $ctbestSeasonToVisit->setAttribute("rows", "4");
     $ctbestSeasonToVisit->setAttribute("cols", "43");
     $this->add($ctbestSeasonToVisit);
     $this->add(array('name' => 'ctlatitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'ctlongitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'cityPhoto', 'attributes' => array('type' => 'file'), 'options' => array('label' => 'File Upload')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
コード例 #6
0
ファイル: Editor.php プロジェクト: gotcms/gotcms
 /**
  * Load upload editor
  *
  * @return string
  */
 public function load()
 {
     $data = unserialize($this->getValue());
     $property = $this->getProperty();
     $textarea = new Element\Textarea($this->getName());
     $textarea->setAttribute('id', $this->getName());
     $textarea->setAttribute('class', 'form-control');
     $textarea->setAttribute('required', $property->isRequired());
     $textarea->setLabel($this->getProperty()->getName());
     $textarea->setValue(!empty($data['source']) ? $data['source'] : '');
     return $this->addPath(__DIR__)->render('markdown-editor.phtml', array('textarea' => $textarea, 'id' => $this->getName(), 'value' => $this->getValue(), 'property' => $property));
 }
コード例 #7
0
ファイル: StateForm.php プロジェクト: viplovegithub/Myzend
 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('StateForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $country = new Element\Select('cntryId');
     $country->setLabel('Country name');
     $country->setValueOptions($this->getOptionCountry());
     $country->setAttribute("class", "dropDnInput");
     $this->add($country);
     $this->add(array('name' => 'stname', 'attributes' => array('type' => 'text', 'placeholder' => 'State name', 'class' => 'commonDropDnInput')));
     $cntrydescription = new Element\Textarea('statedescription');
     $cntrydescription->setLabel('State Description');
     $cntrydescription->setAttribute("class", "selectAreaInput");
     $cntrydescription->setAttribute("rows", "4");
     $cntrydescription->setAttribute("cols", "50");
     $this->add($cntrydescription);
     $cntryspecialInstructions = new Element\Textarea('statespecialInstructions');
     $cntryspecialInstructions->setLabel('State Special Instruction Description');
     $cntryspecialInstructions->setAttribute("class", "selectAreaInput");
     $cntryspecialInstructions->setAttribute("rows", "4");
     $cntryspecialInstructions->setAttribute("cols", "50");
     $this->add($cntryspecialInstructions);
     $cntrybestSeasonToVisit = new Element\Textarea('statebestSeasonToVisit');
     $cntrybestSeasonToVisit->setLabel('State Best Season to visit');
     $cntrybestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $cntrybestSeasonToVisit->setAttribute("rows", "4");
     $cntrybestSeasonToVisit->setAttribute("cols", "50");
     $this->add($cntrybestSeasonToVisit);
     $this->add(array('name' => 'latitude', 'attributes' => array('type' => 'text', 'placeholder' => 'State Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'longitude', 'attributes' => array('type' => 'text', 'placeholder' => 'State Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'statePhoto', 'attributes' => array('type' => 'file', 'allowEmpty' => False), 'options' => array('label' => 'File Upload')));
     //
     // File Input
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
コード例 #8
0
ファイル: BlogForm.php プロジェクト: andreaszobl/software
 /**
  * Add content element
  */
 public function addContentElement($name = 'content')
 {
     $element = new Textarea($name);
     $element->setLabel('Beitragstext');
     $element->setAttribute('class', 'ckeditor');
     $this->add($element);
 }
コード例 #9
0
ファイル: Poster.php プロジェクト: sebaxplace/skilla-local
 public function __construct($name = null)
 {
     parent::__construct($name);
     //id
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     //statosessione
     $this->add(array('name' => 'statosessione', 'attributes' => array('type' => 'hidden')));
     //password visible
     $this->add(array('name' => 'password2', 'attributes' => array('type' => 'hidden')));
     //titolo
     $this->add(array('name' => 'titolo', 'options' => array('label' => 'Titolo'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //password
     $this->add(array('type' => 'Zend\\Form\\Element\\Password', 'name' => 'password', 'options' => array('label' => 'Password'), 'attributes' => array('class' => 'form-control')));
     //confirmapassword
     $this->add(array('type' => 'Zend\\Form\\Element\\Password', 'name' => 'confirmarPassword', 'options' => array('label' => 'Confermare Password'), 'attributes' => array('class' => 'form-control')));
     // Relatori
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'relatori', 'options' => array('label' => 'Relatori', 'empty_option' => 'Scegli un relatore =>'), 'attributes' => array('class' => 'form-control')));
     // Steps
     $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'steps', 'options' => array('label' => 'Steps', 'empty_option' => 'Scegli steps =>'), 'attributes' => array('class' => 'form-control')));
     //testo
     $nota = new Element\Textarea('nota');
     $nota->setLabel('Nota');
     $nota->setAttribute('class', 'ckeditor form-control');
     $this->add($nota);
     //Durata
     $this->add(array('name' => 'durata', 'options' => array('label' => 'Durata Sessione'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //Linkedin
     $this->add(array('name' => 'link', 'options' => array('label' => 'Link Report'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //stato
     $stato = new Element\Checkbox('stato');
     $stato->setLabel('Stato');
     $stato->setAttribute('class', 'make-switch');
     $this->add($stato);
     $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Salva', 'class' => 'btn green-haze pull-right')));
 }
コード例 #10
0
ファイル: Comment.php プロジェクト: gotcms/gotcms
 /**
  * Init Module form
  *
  * @return void
  */
 public function init()
 {
     $showEmail = new Element\Checkbox('show_email');
     $showEmail->setLabel('Show email');
     $showEmail->setAttribute('required', 'required')->setAttribute('id', 'show-email');
     $username = new Element\Text('username');
     $username->setLabel('Username');
     $username->setAttribute('required', 'required')->setAttribute('id', 'username');
     $email = new Element\Text('email');
     $email->setLabel('Email');
     $email->setAttribute('required', 'required')->setAttribute('id', 'email');
     $message = new Element\Textarea('message');
     $message->setLabel('Message');
     $message->setAttribute('required', 'required')->setAttribute('id', 'message');
     $captchaImage = new CaptchaImage(array('font' => GC_PUBLIC_PATH . '/backend/fonts/arial.ttf', 'width' => 250, 'height' => 50, 'dotNoiseLevel' => 40, 'lineNoiseLevel' => 3));
     $captchaImage->setImgDir(GC_PUBLIC_PATH . '/frontend/tmp');
     $captchaImage->setImgUrl('/frontend/tmp');
     $captcha = new Element\Captcha('captcha');
     $captcha->setLabel('Please verify you are human')->setCaptcha($captchaImage)->setAttribute('required', 'required')->setAttribute('id', 'captcha');
     $this->add($showEmail);
     $this->add($username);
     $this->add($email);
     $this->add($message);
     $this->add($captcha);
     $inputFilterFactory = new InputFilterFactory();
     $inputFilter = $inputFilterFactory->createInputFilter(array('show_email' => array('name' => 'show_email', 'required' => false), 'username' => array('name' => 'username', 'required' => true), 'email' => array('name' => 'email', 'required' => true, 'validators' => array(array('name' => 'email_address'))), 'message' => array('name' => 'message', 'required' => true), 'captcha' => $captcha->getInputSpecification()));
     $this->setInputFilter($inputFilter);
 }
コード例 #11
0
ファイル: Add.php プロジェクト: samija/Deeplifec4tk
 public function __construct()
 {
     parent::__construct('add');
     $hydrator = new AggregateHydrator();
     $hydrator->add(new PostHydrator());
     $hydrator->add(new CategoryHydrator());
     $this->setHydrator($hydrator);
     $title = new Element\Text('title');
     $title->setLabel('Title');
     $title->setAttribute('class', 'form-control');
     $slug = new Element\Text('slug');
     $slug->setLabel('Slug');
     $slug->setAttribute('class', 'form-control');
     $content = new Element\Textarea('content');
     $content->setLabel('Content');
     $content->setAttribute('class', 'form-control');
     $category = new Element\Select('category_id');
     $category->setLabel('Category');
     $category->setAttribute('class', 'form-control');
     $category->setValueOptions(array(1 => 'WIN', 2 => 'BUILD', 3 => 'SEND', 4 => 'GENERAL'));
     $submit = new Element\Submit('submit');
     $submit->setValue('Add News');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($title);
     $this->add($slug);
     $this->add($content);
     $this->add($category);
     $this->add($submit);
 }
コード例 #12
0
ファイル: RentalsForm.php プロジェクト: andreaszobl/software
 /**
  * Add description element
  */
 public function addDescriptionElement($name = 'description')
 {
     $element = new Textarea($name);
     $element->setLabel('Was hast du mit dem Rad vor? (optional -  falls du das den anderen Nutzern mitteilen magst)');
     $element->setAttribute('class', 'form-control');
     $this->add($element);
 }
コード例 #13
0
ファイル: Editor.php プロジェクト: gotcms/gotcms
 /**
  * Load textarea editor
  *
  * @return Element\Textarea
  */
 public function load()
 {
     $config = $this->getConfig();
     $property = $this->getProperty();
     $textarea = new Element\Textarea($this->getName());
     $textarea->setAttribute('class', 'form-control');
     $textarea->setAttribute('required', $property->isRequired());
     $textarea->setAttribute('id', $this->getName());
     $textarea->setLabel($this->getProperty()->getName());
     $textarea->setValue($this->getValue());
     $config = empty($config) ? array() : $config;
     foreach ($config as $key => $value) {
         if (!empty($value)) {
             $textarea->setAttribute($key, $value);
         }
     }
     return $textarea;
 }
コード例 #14
0
ファイル: Nascosto.php プロジェクト: sebaxplace/skilla-local
 public function __construct($name = null)
 {
     parent::__construct($name);
     //id
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden', 'class' => 'id', 'id' => 'idpostit')));
     //xyz
     $this->add(array('name' => 'xyz', 'attributes' => array('type' => 'hidden', 'class' => 'xyz')));
     //nome
     $this->add(array('name' => 'nome', 'attributes' => array('type' => 'hidden', 'id' => 'note-name', 'class' => 'pr-author')));
     //messaggio
     /* $this->add(array(
            'name'=>'messaggio',
            'options'=>array(
                'label'=> 'Messaggio',
            ),
            'attributes'=> array(
                'type'=>'text',
                'class'=>'form-control pr-body pull-left',
                'id'=>'note-body',
                'placeholder'=>'Messaggio',
            ),
        ));*/
     $nota = new Element\Textarea('messaggio');
     $nota->setLabel('Contenuto');
     $nota->setAttribute('class', 'mintxt pr-body');
     $nota->setAttribute('placeholder', 'Scrivi qui il testo dell\'intervento');
     $nota->setAttribute('required', 'required');
     $this->add($nota);
     //color
     $this->add(array('name' => 'color', 'attributes' => array('type' => 'hidden', 'class' => 'color')));
     //posterlab
     $this->add(array('name' => 'posterlab', 'attributes' => array('type' => 'hidden', 'class' => 'posterlab')));
     //tipo
     $this->add(array('name' => 'tipo', 'attributes' => array('type' => 'hidden', 'class' => 'tipo')));
     //sessione
     $this->add(array('name' => 'sessione', 'attributes' => array('type' => 'hidden', 'class' => 'sessione')));
     //data
     $this->add(array('name' => 'data', 'attributes' => array('type' => 'hidden', 'class' => 'fecha')));
     //stato
     $this->add(array('name' => 'stato', 'attributes' => array('type' => 'hidden', 'class' => 'stato')));
     $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Invia', 'class' => 'button expand purple', 'id' => 'note-submit', 'style' => 'margin:0px !important', 'onClick' => 'return false')));
 }
コード例 #15
0
ファイル: CountryForm.php プロジェクト: viplovegithub/Myzend
 public function __construct($name = NULL)
 {
     parent::__construct('CountryForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'cntryName', 'attributes' => array('type' => 'text', 'placeholder' => 'Country name', 'class' => 'commonDropDnInput')));
     $cntrydescription = new Element\Textarea('cntrydescription');
     $cntrydescription->setLabel('Country Description');
     $cntrydescription->setAttribute("class", "selectAreaInput");
     $cntrydescription->setAttribute("rows", "4");
     $cntrydescription->setAttribute("cols", "39");
     $this->add($cntrydescription);
     $cntryspecialInstructions = new Element\Textarea('cntryspecialInstructions');
     $cntryspecialInstructions->setLabel('Country Special Instruction Description');
     $cntryspecialInstructions->setAttribute("class", "selectAreaInput");
     $cntryspecialInstructions->setAttribute("rows", "4");
     $cntryspecialInstructions->setAttribute("cols", "23");
     $this->add($cntryspecialInstructions);
     $cntrybestSeasonToVisit = new Element\Textarea('cntrybestSeasonToVisit');
     $cntrybestSeasonToVisit->setLabel('Country Best Season to Visit');
     $cntrybestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $cntrybestSeasonToVisit->setAttribute("rows", "4");
     $cntrybestSeasonToVisit->setAttribute("cols", "33");
     $this->add($cntrybestSeasonToVisit);
     $this->add(array('name' => 'latitude', 'attributes' => array('type' => 'text', 'placeholder' => 'Country Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'longitude', 'attributes' => array('type' => 'text', 'placeholder' => 'Country Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'contryphoto', 'attributes' => array('type' => 'file'), 'options' => array('label' => 'File Upload')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
コード例 #16
0
ファイル: Editor.php プロジェクト: gotcms/gotcms
    /**
     * Load textrich editor
     *
     * @return mixed
     */
    public function load()
    {
        $this->getHelper('headscript')->appendFile('/backend/assets/datatypes/textrich/ckeditor.js', 'text/javascript');
        $this->getHelper('headscript')->appendFile('/backend/assets/datatypes/textrich/ckeditor-adapters-jquery.js', 'text/javascript');
        $parameters = $this->getConfig();
        $ckeditor = new CkEditor();
        if (empty($parameters) or !is_array($parameters)) {
            $parameters = array();
        }
        $ckeditor->setParameters($parameters);
        $id = 'textrich' . $this->getProperty()->getId();
        $textrich = new Element\Textarea($this->getName());
        $textrich->setLabel($this->getProperty()->getName());
        $textrich->setAttribute('id', $id);
        $textrich->setAttribute('class', $id);
        $textrich->setValue($this->getProperty()->getValue());
        $script = '<script type="text/javascript">
            $(function () {
                var config = {
                    skin: "moono",
                    toolbar: ' . $ckeditor->getToolbarAsJs() . ',
                    allowedContent: true
                };

                $("#' . $id . '").ckeditor(config)
                .ckeditor(function () {
                    this.addCommand("saveDocument",
                    {
                        exec : function (editor, data) {
                            $("#input-save").click();
                        }
                    });
                    this.keystrokeHandler.keystrokes[CKEDITOR.CTRL + 83 /* S */] =  "saveDocument";
                });
            });
        </script>';
        return array($textrich, $script);
    }
コード例 #17
0
ファイル: AbstractFormContent.php プロジェクト: gotcms/gotcms
 /**
  * Initialize form
  *
  * @return void
  */
 public function init()
 {
     $this->setAttribute('class', 'relative form-horizontal');
     $inputFilterFactory = new InputFilterFactory();
     $inputFilter = $inputFilterFactory->createInputFilter(array('name' => array('required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'db\\no_record_exists', 'options' => array('table' => $this->tableName, 'field' => 'name', 'adapter' => $this->getAdapter())))), 'identifier' => array('required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'regex', 'options' => array('pattern' => parent::IDENTIFIER_PATTERN)), array('name' => 'db\\no_record_exists', 'options' => array('table' => $this->tableName, 'field' => 'identifier', 'adapter' => $this->getAdapter()))))));
     $this->setInputFilter($inputFilter);
     $name = new Element\Text('name');
     $name->setLabel('Name')->setLabelAttributes(array('class' => 'required control-label col-lg-2'));
     $name->setAttribute('class', 'form-control')->setAttribute('id', 'name');
     $this->add($name);
     $identifier = new Element\Text('identifier');
     $identifier->setLabel('Identifier')->setLabelAttributes(array('class' => 'required control-label col-lg-2'));
     $identifier->setAttribute('class', 'form-control')->setAttribute('id', 'identifier');
     $this->add($identifier);
     $description = new Element\Text('description');
     $description->setLabel('Description')->setLabelAttributes(array('class' => 'control-label col-lg-2'));
     $description->setAttribute('class', 'form-control')->setAttribute('id', 'description');
     $this->add($description);
     $content = new Element\Textarea('content');
     $content->setLabel('Content')->setLabelAttributes(array('class' => 'control-label col-lg-2'));
     $content->setAttribute('cols', '80')->setAttribute('rows', '24')->setAttribute('id', 'content');
     $this->add($content);
 }
コード例 #18
0
 public function addElements($id)
 {
     // File Input
     $this->data = $id;
     $file = new Element\File('seriecode');
     $file->setLabel('Video Mp4 Upload: ')->setAttribute('id', 'seriecode')->setAttribute('class', 'form-control')->setAttribute('title', 'File Upload')->setAttribute('multiple', true);
     // That's it
     $this->add($file);
     $title = new Element\Text('title');
     $title->setLabel('Title')->setAttribute('class', 'form-control')->setAttribute('id', 'title');
     $this->add($title);
     $cata = new Element\Select('catelog');
     $cata->setLabel('Catelog: ');
     $cata->setAttribute('class', 'form-control');
     $cata->setValueOptions($this->data);
     $this->add($cata);
     $tags = new Element\Text('tags');
     $tags->setLabel('Tags: ')->setAttribute('id', 'tag')->setAttribute('class', 'form-control')->setAttribute('class', 'form-control');
     $this->add($tags);
     $des = new Element\Textarea('description');
     $des->setLabel('Description: ');
     $des->setAttribute('class', 'form-control');
     $this->add($des);
 }
コード例 #19
0
 public function getForm(array $staffList, array $statusList, array $leaveList, $formType = 'W')
 {
     if (!$this->form) {
         $leaveId = new Element\Hidden('leaveId');
         $staff = new Element\Select();
         $staff->setName('staffId')->setEmptyOption('-- Choose Staff --')->setLabel('Staff')->setAttribute('class', 'form-control')->setValueOptions($staffList);
         $leaveType = new Element\Select();
         $leaveType->setName('leaveType')->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions($leaveList);
         $date = new Element\Date();
         $date->setName('date')->setLabel('Date')->setAttributes(array('allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD')));
         $description = new Element\Textarea('description');
         $description->setLabel('Description')->setAttribute('class', 'form-control');
         $status = new Element\Select();
         $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList);
         if ($formType == 'R' || $formType == 'V') {
             $staff->setAttribute('disabled', 'disabled');
             $leaveType->setAttribute('disabled', 'disabled');
             $description->setAttribute('readonly', 'readonly');
         }
         if ($formType == 'V') {
             $status->setAttribute('disabled', 'disabled');
             $date = new Element\Text();
             $date->setName('date')->setLabel('Date')->setattributes(array('class' => 'form-control', 'disabled' => 'disabled'));
         }
         $form = new Form();
         $form->setAttribute('class', 'form-horizontal');
         $form->add($leaveId);
         $form->add($staff);
         $form->add($leaveType);
         $form->add($date);
         $form->add($description);
         $form->add($status);
         $this->form = $form;
     }
     return $this->form;
 }
コード例 #20
0
ファイル: OtherForm.php プロジェクト: anton-phpcurs/aperture
 public function addElements()
 {
     //-- Full name --
     $full_name = new Element\Text('full_name');
     $full_name->setAttribute('placeholder', 'Full Name');
     $full_name->setAttribute('class', 'form-control');
     $full_name->setAttribute('id', 'full-name');
     $full_name->setLabel('Full name');
     $full_name->setLabelAttributes(array('class' => 'control-label', 'for' => 'full-name'));
     //-- Bio --
     $bio = new Element\Textarea('bio');
     $bio->setAttribute('placeholder', 'Bio');
     $bio->setAttribute('class', 'form-control');
     $bio->setAttribute('id', 'bio');
     $bio->setLabel('Bio');
     $bio->setLabelAttributes(array('class' => 'control-label', 'for' => 'bio'));
     //-- Link skype --
     $link_skype = new Element\Text('link_skype');
     $link_skype->setAttribute('placeholder', 'skype_name');
     $link_skype->setAttribute('class', 'form-control');
     $link_skype->setAttribute('id', 'link-skype');
     $link_skype->setLabel('Skype');
     $link_skype->setLabelAttributes(array('class' => 'control-label', 'for' => 'link-skype'));
     //-- Link site --
     $link_site = new Element\Text('link_site');
     $link_site->setAttribute('placeholder', 'http://my-site.com');
     $link_site->setAttribute('class', 'form-control');
     $link_site->setAttribute('id', 'link-site');
     $link_site->setLabel('Link my site');
     $link_site->setLabelAttributes(array('class' => 'control-label', 'for' => 'link-site'));
     //-- Link vkontakte --
     $link_vk = new Element\Text('link_vk');
     $link_vk->setAttribute('placeholder', 'http://vk.com/user_name');
     $link_vk->setAttribute('class', 'form-control');
     $link_vk->setAttribute('id', 'link-vk');
     $link_vk->setLabel('Link VKontakte');
     $link_vk->setLabelAttributes(array('class' => 'control-label', 'for' => 'link-vk'));
     //-- Link facebook --
     $link_fb = new Element\Text('link_fb');
     $link_fb->setAttribute('placeholder', 'https://www.facebook.com/user_name');
     $link_fb->setAttribute('class', 'form-control');
     $link_fb->setAttribute('id', 'link-fb');
     $link_fb->setLabel('Link Facebook');
     $link_fb->setLabelAttributes(array('class' => 'control-label', 'for' => 'link-fb'));
     //-- Link twitter --
     $link_tw = new Element\Text('link_tw');
     $link_tw->setAttribute('placeholder', 'https://twitter.com/user_name');
     $link_tw->setAttribute('class', 'form-control');
     $link_tw->setAttribute('id', 'link-tw');
     $link_tw->setLabel('Link Twitter');
     $link_tw->setLabelAttributes(array('class' => 'control-label', 'for' => 'flink-tw'));
     //-- Password --
     $check = new Element\Checkbox('is_active');
     $check->setAttribute('class', 'form-control');
     $check->setAttribute('id', 'is-active');
     $check->setCheckedValue("1");
     $check->setUncheckedValue("0");
     $check->setLabel('Is active');
     $check->setLabelAttributes(array('class' => 'control-label', 'for' => 'is-active'));
     //-- Submit --
     $submit = new Element\Submit('submit');
     $submit->setAttribute('class', 'btn btn-success');
     $submit->setValue('Send');
     // Binding elements
     $this->add($full_name);
     $this->add($bio);
     $this->add($link_skype);
     $this->add($link_site);
     $this->add($link_vk);
     $this->add($link_fb);
     $this->add($link_tw);
     $this->add($check);
 }
コード例 #21
0
ファイル: PostForm.php プロジェクト: lohmuller/OnlineMarket
 public function buildForm()
 {
     $this->setAttributes(array('id' => 'post-form', 'method' => 'post'));
     $category = new Element\Select('category');
     $category->setLabel('Categoria');
     $category->setValueOptions(array_combine($this->categories, $this->categories));
     $category->setAttribute('class', 'form-control');
     $title = new Element\Text('title');
     $title->setLabel('Título');
     $title->setAttributes(array('maxlength' => 128, 'class' => 'form-control'));
     $description = new Element\Textarea('description');
     $description->setAttribute('class', 'form-control');
     $description->setLabel('Descrição');
     $photoFilename = new Element\Url('photo_filename');
     $photoFilename->setAttribute('class', 'form-control');
     $photoFilename->setLabel('Foto');
     $contactName = new Element\Text('contact_name');
     $contactName->setAttribute('class', 'form-control');
     $contactName->setLabel('Nome completo');
     $contactEmail = new Element\Email('contact_email');
     $contactEmail->setAttribute('class', 'form-control');
     $contactEmail->setLabel('E-mail');
     $contactPhone = new Element\Text('contact_phone');
     $contactPhone->setAttribute('class', 'form-control');
     $contactPhone->setLabel('Contato');
     $cityCode = new Element\Select('cityCode');
     $cityCode->setAttribute('class', 'form-control');
     $cityCode->setValueOptions($this->cities);
     $cityCode->setLabel('Cidade');
     $deleteCode = new Element\Number('delete_code');
     $deleteCode->setAttribute('class', 'form-control');
     $deleteCode->setLabel('Código de deleção');
     $captcha = new Element\Captcha('captcha');
     $captchaAdapter = new ImageCaptcha(array('font' => './public/fonts/arial.ttf', 'imgDir' => './public/img/captcha', 'imgUrl' => '/img/captcha'));
     $captchaAdapter->setWordlen(4);
     $captcha->setCaptcha($captchaAdapter)->setLabel('Você é um ser humano ou um robô?')->setAttribute('class', 'captchaStyle')->setAttribute('title', 'Você é um ser humano ou um robô?');
     /*$captcha = new Element\Captcha('captcha');
             $captcha->setCaptcha(new \Zend\Captcha\Dumb());
             $captcha->setAttribute('class', 'form-control');
             $captcha->setOptions(array('label' => 'Você é um ser humano ou um robô?'));
     */
     $price = new Element\Number('price');
     $price->setAttributes(array('class' => 'form-control', 'maxlength' => 12, 'min' => 0, 'max' => '999999999999'));
     $price->setLabel('Preço');
     $dateExpires = new Element\Radio('date_expires');
     $dateExpires->setLabel('Expira em (dias)');
     $dateExpires->setValueOptions(array_combine($this->dateExpires, $this->dateExpires));
     $csrf = new Element\Csrf('security');
     $submit = new Element\Submit('submit');
     $submit->setAttributes(array('class' => 'btn btn-default', 'value' => 'Enviar formulário'));
     $this->add($category)->add($title)->add($price)->add($dateExpires)->add($description)->add($photoFilename)->add($contactName)->add($contactEmail)->add($contactPhone)->add($cityCode)->add($deleteCode)->add($captcha)->add($csrf)->add($submit);
     /*
             $factory = new \Zend\Form\Factory();
             $factory->createForm(array(
                 'hydrator' => 'Zend\Stdlib\Hydrator\ArraySerializable',
                 'elements' => array(
                     array(
                         'name' => 'category',
                         'type' => 'text',
                         'options' => array(
                             'label' => 'Category'
                         )
                     ),
                     array(
                         'name' => 'title',
                         'type' => 'text',
                         'options' => array(
                             'label' => 'Title'
                         )
                     ),
                 )
             )); */
 }
コード例 #22
0
ファイル: Relato.php プロジェクト: sebaxplace/skilla-local
 public function __construct($name = null)
 {
     parent::__construct($name);
     //id
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     //nombre
     $this->add(array('name' => 'nome', 'options' => array('label' => 'Nome'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //apellido
     $this->add(array('name' => 'cognome', 'options' => array('label' => 'Cognome'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //Email
     $this->add(array('type' => 'Zend\\Form\\Element\\Email', 'name' => 'email', 'options' => array('label' => 'Email'), 'attributes' => array('class' => 'form-control')));
     /*
     //password
     $this->add(array(
         'type'=>'Zend\Form\Element\Password',
         'name'=>'password',
         'options'=>array(
             'label'=> 'Password',
         ),
         'attributes'=> array(
            
             'class'=>'form-control',
         ),
     ));
     
     //confirmapassword
     $this->add(array(
         'type'=>'Zend\Form\Element\Password',
         'name'=>'confirmarPassword',
         'options'=>array(
             'label'=> 'Confermare Password',
         ),
         'attributes'=> array(
              
             'class'=>'form-control',
         ),
     ));
     */
     //Linkedin
     $this->add(array('name' => 'link', 'options' => array('label' => 'Link Linkedin'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //immagine
     $this->add(array('name' => 'immagine', 'attributes' => array('type' => 'Zend\\Form\\Element\\File'), 'options' => array('label' => 'Immagine')));
     /*
     $immagine = new File('immagine');
     $immagine->setLabel('Immagine');
     $this->add($immagine);
     */
     //Titolo
     $this->add(array('name' => 'titolo', 'options' => array('label' => 'Titolo'), 'attributes' => array('type' => 'text', 'class' => 'form-control')));
     //testo
     $testo = new Element\Textarea('testo');
     $testo->setLabel('Descrizione');
     $testo->setAttribute('class', 'ckeditor form-control');
     $this->add($testo);
     //stato
     $stato = new Element\Checkbox('stato');
     $stato->setLabel('Stato');
     $stato->setAttribute('class', 'make-switch');
     $this->add($stato);
     $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => 'Salva', 'class' => 'btn green-haze pull-right')));
 }
コード例 #23
0
ファイル: LocationForm.php プロジェクト: viplovegithub/Myzend
 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('LocationForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'locname', 'attributes' => array('type' => 'text', 'placeholder' => 'Location name', 'class' => 'commonDropDnInput')));
     $stid = new Element\Select('stid');
     $stid->setLabel('State');
     $stid->setValueOptions(array('' => 'State'));
     $stid->setValueOptions($this->getOptionState());
     $stid->setAttributes(array('id' => 'state'));
     $stid->setAttribute("class", "dropDnInput");
     $stid->setDisableInArrayValidator(true);
     $this->add($stid);
     $ctid = new Element\Select('ctid');
     $ctid->setLabel('City');
     $ctid->setAttributes(array('id' => 'city'));
     $ctid->setValueOptions(array('' => 'City'));
     $ctid->setAttribute("class", "dropDnInput");
     $ctid->setDisableInArrayValidator(true);
     $this->add($ctid);
     $locationtype = new Element\Select('loctypeid');
     $locationtype->setLabel('Location Type');
     $locationtype->setValueOptions($this->getOptionLocationType());
     $locationtype->setAttribute("class", "dropDnInput");
     $this->add($locationtype);
     $bestSeasonToVisit = new Element\Textarea('bestSeasonToVisit');
     $bestSeasonToVisit->setLabel('Best Season to visit');
     $bestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $bestSeasonToVisit->setAttribute("rows", "4");
     $bestSeasonToVisit->setAttribute("cols", "50");
     $this->add($bestSeasonToVisit);
     $entry = new Element\Select('entry');
     $entry->setLabel('Entry');
     $entry->setValueOptions(array('' => 'Entry', '1' => 'Yes', '2' => 'No'));
     $entry->setAttribute("class", "dropDnInput");
     $this->add($entry);
     $timingOpeningNClosing = new Element\Textarea('timingOpeningNClosing');
     $timingOpeningNClosing->setLabel('Opening and closing timing');
     $timingOpeningNClosing->setAttribute("class", "selectAreaInput");
     $timingOpeningNClosing->setAttribute("rows", "4");
     $timingOpeningNClosing->setAttribute("cols", "50");
     $this->add($timingOpeningNClosing);
     $description = new Element\Textarea('description');
     $description->setLabel('Description');
     $description->setAttribute("class", "selectAreaInput");
     $description->setAttribute("rows", "4");
     $description->setAttribute("cols", "50");
     $this->add($description);
     $specialInstructions = new Element\Textarea('specialInstructions');
     $specialInstructions->setLabel('Special Instruction Description');
     $specialInstructions->setAttribute("class", "selectAreaInput");
     $specialInstructions->setAttribute("rows", "4");
     $specialInstructions->setAttribute("cols", "50");
     $this->add($specialInstructions);
     $notAllowed = new Element\Textarea('notAllowed');
     $notAllowed->setLabel('Not allowed reason');
     $notAllowed->setAttribute("class", "selectAreaInput");
     $notAllowed->setAttribute("rows", "4");
     $notAllowed->setAttribute("cols", "50");
     $this->add($notAllowed);
     $airportRailwayStatus = new Element\Select('airportRailwayStatus');
     $airportRailwayStatus->setLabel('Airport/Railway');
     $airportRailwayStatus->setValueOptions(array('' => 'Select', '1' => 'Yes', '2' => 'No'));
     $airportRailwayStatus->setAttribute("class", "dropDnInput");
     $this->add($airportRailwayStatus);
     $this->add(array('name' => 'citytemp', 'attributes' => array('type' => 'hidden', 'placeholder' => 'citytemp', 'class' => 'commonDropDnInput', 'id' => 'citytemp')));
     $this->add(array('name' => 'latitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'longitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'locationPhoto', 'attributes' => array('type' => 'file'), 'options' => array('label' => 'File Upload')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
コード例 #24
0
ファイル: DocumentForm.php プロジェクト: kristjanAnd/SimpleIV
 public function init()
 {
     $customer = new Select('customer');
     $customer->setAttribute('id', 'customer');
     $customer->setAttribute('title', $this->translator->translate('web.form.document.customer.title'));
     $customer->setAttribute('class', 'form-control');
     $customer->setEmptyOption($this->translator->translate('web.form.document.customer.emptyOption'));
     $customer->setValueOptions($this->getCustomerValues());
     $customer->setLabel($this->translator->translate('web.form.document.customer.label'));
     $this->add($customer);
     $supplier = new Select('supplier');
     $supplier->setAttribute('id', 'supplier');
     $supplier->setAttribute('title', $this->translator->translate('web.form.document.supplier.title'));
     $supplier->setAttribute('class', 'form-control');
     $supplier->setEmptyOption($this->translator->translate('web.form.document.supplier.emptyOption'));
     $supplier->setValueOptions($this->getSupplierValues());
     $supplier->setLabel($this->translator->translate('web.form.document.supplier.label'));
     $this->add($supplier);
     $paymentType = new Select('paymentType');
     $paymentType->setAttribute('id', 'paymentType');
     $paymentType->setAttribute('title', $this->translator->translate('web.form.document.paymentMethod.title'));
     $paymentType->setAttribute('class', 'form-control');
     $paymentType->setEmptyOption($this->translator->translate('web.form.document.paymentMethod.emptyOption'));
     $paymentType->setValueOptions(Document::$paymentTypes);
     $paymentType->setLabel($this->translator->translate('web.form.document.paymentMethod.label'));
     $this->add($paymentType);
     $vat = new Select('vat');
     $vat->setAttribute('id', 'vat');
     $vat->setAttribute('title', $this->translator->translate('web.form.document.vat.title'));
     $vat->setAttribute('class', 'form-control');
     $vat->setEmptyOption($this->translator->translate('web.form.document.vat.emptyOption'));
     $vat->setValueOptions($this->getVatValues());
     $vat->setLabel($this->translator->translate('web.form.document.vat.label'));
     $this->add($vat);
     $docDate = new Date('docDate');
     $docDate->setAttributes(array('id' => 'docDate', 'type' => 'text', 'class' => 'input datepicker form-control', 'data-date-weekstart' => 1, 'data-date-format' => 'dd.mm.yyyy'));
     $docDate->setAttribute('title', $this->translator->translate('web.form.document.docDate.title'));
     $docDate->setAttribute('readonly', 'readonly');
     $docDate->setAttribute('placeholder', $this->translator->translate('web.form.document.docDate.placeholder'));
     $docDate->setLabel($this->translator->translate('web.form.document.docDate.label'));
     $this->add($docDate);
     $supplierDocNumber = new Text('supplierDocNumber');
     $supplierDocNumber->setAttribute('id', 'supplierDocNumber');
     $supplierDocNumber->setAttribute('title', $this->translator->translate('web.form.document.supplierDocNumber.title'));
     $supplierDocNumber->setAttribute('class', 'form-control');
     $supplierDocNumber->setAttribute('placeholder', $this->translator->translate('web.form.document.supplierDocNumber.placeholder'));
     $supplierDocNumber->setLabel($this->translator->translate('web.form.document.supplierDocNumber.label'));
     $this->add($supplierDocNumber);
     $deadlineDays = new Text('deadlineDays');
     $deadlineDays->setAttribute('id', 'deadlineDays');
     $deadlineDays->setAttribute('title', $this->translator->translate('web.form.document.deadlineDays.title'));
     $deadlineDays->setAttribute('class', 'form-control');
     $deadlineDays->setAttribute('placeholder', $this->translator->translate('web.form.document.deadlineDays.placeholder'));
     $deadlineDays->setLabel($this->translator->translate('web.form.document.deadlineDays.label'));
     $this->add($deadlineDays);
     $delayPercent = new Text('delayPercent');
     $delayPercent->setAttribute('id', 'delayPercent');
     $delayPercent->setAttribute('class', 'form-control');
     $delayPercent->setAttribute('title', $this->translator->translate('web.form.document.delayPercent.title'));
     $delayPercent->setAttribute('placeholder', $this->translator->translate('web.form.document.delayPercent.placeholder'));
     $delayPercent->setLabel($this->translator->translate('web.form.document.delayPercent.label'));
     $this->add($delayPercent);
     $amount = new Text('amount');
     $amount->setAttribute('id', 'amount');
     $amount->setAttribute('title', $this->translator->translate('web.form.document.amount.title'));
     $amount->setAttribute('class', 'form-control');
     $amount->setAttribute('readonly', 'readonly');
     $amount->setAttribute('placeholder', $this->translator->translate('web.form.document.amount.placeholder'));
     $amount->setLabel($this->translator->translate('web.form.document.amount.label'));
     $this->add($amount);
     $taxAmount = new Text('taxAmount');
     $taxAmount->setAttribute('id', 'taxAmount');
     $taxAmount->setAttribute('title', $this->translator->translate('web.form.document.taxAmount.title'));
     $taxAmount->setAttribute('class', 'form-control');
     $taxAmount->setAttribute('readonly', 'readonly');
     $taxAmount->setAttribute('placeholder', $this->translator->translate('web.form.document.taxAmount.placeholder'));
     $taxAmount->setLabel($this->translator->translate('web.form.document.taxAmount.label'));
     $this->add($taxAmount);
     $comment = new Textarea('comment');
     $comment->setAttribute('id', 'comment');
     $comment->setAttribute('title', $this->translator->translate('web.form.document.comment.title'));
     $comment->setAttribute('class', 'form-control');
     $comment->setAttribute('cols', 15);
     $comment->setAttribute('rows', 4);
     $comment->setAttribute('placeholder', $this->translator->translate('web.form.document.comment.placeholder'));
     $comment->setLabel($this->translator->translate('web.form.document.comment.label'));
     $this->add($comment);
     $amountTax = new Text('amountTax');
     $amountTax->setAttribute('id', 'amountTax');
     $amountTax->setAttribute('title', $this->translator->translate('web.form.document.amountTax.title'));
     $amountTax->setAttribute('class', 'form-control');
     $amountTax->setAttribute('readonly', 'readonly');
     $amountTax->setAttribute('placeholder', $this->translator->translate('web.form.document.amountTax.placeholder'));
     $amountTax->setLabel($this->translator->translate('web.form.document.amountTax.label'));
     $this->add($amountTax);
     return $this;
 }
コード例 #25
0
 private function addStep($index)
 {
     $quantityElement = new Text('stepQuantity' . $index);
     $quantityElement->setLabel('Menge');
     $quantityElement->setAttribute('id', 'stepQuantity' . $index);
     $this->add($quantityElement);
     $unitElement = new Select('stepUnit' . $index);
     $unitElement->setValueOptions(array('EL', 'TL'));
     $unitElement->setAttribute('id', 'stepUnit' . $index);
     $this->add($unitElement);
     $ingredientElement = new Select('stepIngredient' . $index);
     $ingredientElement->setValueOptions(array('Öl', 'Rahm'));
     $ingredientElement->setAttribute('id', 'stepIngredient' . $index);
     $this->add($ingredientElement);
     $textElement = new Textarea('stepText' . $index);
     $textElement->setAttribute('id', 'stepText' . $index);
     $this->add($textElement);
 }
コード例 #26
0
ファイル: AddRecipeForm.php プロジェクト: bbuehler99/zend1
 private function addStep($index)
 {
     $stepIdElement = new Hidden('StepId' . $index);
     $stepIdElement->setValue($index);
     $this->add($stepIdElement);
     $quantityElement = new Text('StepQuantityValue' . $index);
     $quantityElement->setLabel('Menge');
     $quantityElement->setAttribute('id', 'StepQuantityValue' . $index);
     $this->add($quantityElement);
     $units = $this->selectAllFrom('Units', 'Name');
     $unitElement = new Select('StepUnit' . $index);
     $unitElement->setValueOptions($units);
     // need to set default value. otherwise null is saved.
     $unitElement->setValue(0);
     $unitElement->setAttribute('id', 'StepUnit' . $index);
     $this->add($unitElement);
     $ingredients = $this->selectAllFrom('Ingredients', 'Name');
     $ingredientElement = new Select('StepIngredient' . $index);
     $ingredientElement->setValueOptions($ingredients);
     //just set any default value. inserting ingredients has to be workes out anyway
     $ingredientElement->setValue(0);
     $ingredientElement->setAttribute('id', 'StepIngredient' . $index);
     $this->add($ingredientElement);
     $textElement = new Textarea('StepText' . $index);
     $textElement->setAttribute('id', 'StepText' . $index);
     $this->add($textElement);
 }