예제 #1
0
 public function init()
 {
     parent::init();
     $this->addElement('text', 'title', array('label' => 'Naziv:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 50))), 'filters' => array(array('filter' => 'StringTrim', 'filter' => 'StripTags'))));
     $this->addElement('text', 'slug', array('label' => 'Slug:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 255))), 'filters' => array(array('filter' => 'StringTrim', 'filter' => 'StripTags', 'filter' => 'Slug'))));
     $this->addElement('hidden', 'id', array('decorators' => $this->hiddenElementDecorators));
     $this->addSubmitAndResetButtons();
 }
예제 #2
0
 public function init()
 {
     parent::init();
     $this->setName('tagsform');
     $this->addElement('text', 'tags', array('label' => 'Oznake:', 'required' => false, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 255))), 'filters' => array(array('filter' => 'StringTrim', 'filter' => 'StripTags'))));
     $this->addSubmitAndResetButtons();
     $this->removeElement('reset');
     $this->removeElement('csrf');
 }
예제 #3
0
 public function init()
 {
     parent::init();
     $this->addElement('text', 'name', array('label' => 'Ime', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 20))), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('text', 'email', array('label' => 'Email', 'required' => true, 'validators' => array(array('validator' => 'EmailAddress')), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('text', 'subject', array('label' => 'Tema', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 50))), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('textarea', 'message', array('label' => '', 'required' => true, 'options' => array('rows' => 10, 'cols' => 80), 'validators' => array(array('validator' => 'StringLength', 'options' => array(6))), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('text', 'honeypot', array('label' => 'Honeypot', 'required' => false, 'class' => 'honeypot', 'decorators' => array('ViewHelper'), 'validators' => array(array('validator' => 'Honeypot'))));
     $this->addSubmitAndResetButtons();
     $this->removeElement('reset');
     $this->getElement('submit')->setLabel('Pošalji');
 }
예제 #4
0
 public function init()
 {
     parent::init();
     $this->addElement('text', 'name', array('label' => 'Ime', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 20))), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('text', 'email', array('label' => 'Email', 'required' => true, 'validators' => array(array('validator' => 'EmailAddress')), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('text', 'url', array('label' => 'Website', 'required' => false, 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('textarea', 'comment', array('label' => '', 'required' => true, 'options' => array('rows' => 10, 'cols' => 80), 'validators' => array(array('validator' => 'StringLength', 'options' => array(6))), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('checkbox', 'active', array('label' => 'Aktivno?', 'required' => true));
     $this->addElement('text', 'datetime_added', array('label' => 'Datum:', 'required' => false, 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addElement('text', 'honeypot', array('label' => 'Honeypot:', 'required' => false, 'class' => 'honeypot', 'decorators' => array('ViewHelper'), 'validators' => array(array('validator' => 'Honeypot'))));
     $this->addElement('text', 'js_fill', array('label' => 'JS fill:', 'required' => true, 'class' => 'honeypot', 'decorators' => array('ViewHelper')));
     $this->addElement('hidden', 'id', array('decorators' => $this->hiddenElementDecorators));
     $this->addElement('hidden', 'fk_news_id', array('decorators' => $this->hiddenElementDecorators, 'required' => true, 'validators' => array(array('validator' => 'Digits')), 'filters' => array(array('filter' => 'StringTrim'), array('filter' => 'StripTags'))));
     $this->addSubmitAndResetButtons();
     $this->removeElement('reset');
     $this->getElement('submit')->setLabel('Ostavi komentar');
 }
예제 #5
0
 public function init()
 {
     parent::init();
     $this->addElement('text', 'title', array('label' => 'Naslov:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 100))), 'filters' => array(array('filter' => 'StringTrim', 'filter' => 'StripTags'))));
     $this->addElement('text', 'slug', array('label' => 'Slug:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(3, 255))), 'filters' => array(array('filter' => 'StringTrim', 'filter' => 'StripTags', 'filter' => 'Slug'))));
     $this->addElement('select', 'fk_news_category_id', array('label' => 'Kategorija:', 'required' => true));
     $this->addElement('textarea', 'text', array('label' => 'Tekst:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(6))), 'filters' => array(array('filter' => 'StringTrim'))));
     $this->addElement('checkbox', 'active', array('label' => 'Aktivno?', 'required' => true));
     $this->addElement('checkbox', 'comments_enabled', array('label' => 'Komentari?', 'required' => true));
     $this->addElement('hidden', 'fk_user_id', array('decorators' => $this->hiddenElementDecorators));
     $this->addElement('hidden', 'datetime_added', array('decorators' => $this->hiddenElementDecorators));
     $this->addElement('hidden', 'id', array('decorators' => $this->hiddenElementDecorators));
     $this->addElement('hidden', 'related_tags', array('decorators' => $this->hiddenElementDecorators, 'required' => false));
     $this->addSubmitAndResetButtons();
     $this->getElement('fk_news_category_id')->addMultiOptions($this->getModel()->getNewsCategoriesForSelectBox());
     $tagValidator = new Zend_Validate_Regex('/^(#\\d+\\#)+$/');
     $this->getElement('related_tags')->addValidator($tagValidator);
 }