diff options
| author | michael pereira | 2011-03-15 11:35:00 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-15 11:35:00 +0100 |
| commit | 3f9700079f95c7fb715e5c9363e48dce6c7c627f (patch) | |
| tree | 17fe70fcfbe651a9c52194423a67bac5a9c692e9 /application/modules/dev/forms/GroupAdd.php | |
| parent | Ressource Controller (diff) | |
| parent | links korrigiert, dev ist nun lauffähig (diff) | |
| download | pbs2-3f9700079f95c7fb715e5c9363e48dce6c7c627f.tar.gz pbs2-3f9700079f95c7fb715e5c9363e48dce6c7c627f.tar.xz pbs2-3f9700079f95c7fb715e5c9363e48dce6c7c627f.zip | |
Ressource gelöscht
Diffstat (limited to 'application/modules/dev/forms/GroupAdd.php')
| -rw-r--r-- | application/modules/dev/forms/GroupAdd.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/application/modules/dev/forms/GroupAdd.php b/application/modules/dev/forms/GroupAdd.php new file mode 100644 index 0000000..f7636e7 --- /dev/null +++ b/application/modules/dev/forms/GroupAdd.php @@ -0,0 +1,65 @@ +<?php + +class dev_Form_GroupAdd extends Zend_Form +{ + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + + + public function init() + { + $this->setName("GroupAdd"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $this->addElement('text', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'label' => 'Description:', + )); + + $groupfield = $this->createElement('select','superordinatedGroupID'); + $groupfield ->setLabel('superordinated Group:'); + + $groupfield->addMultiOption('-1', '---- none ----'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Add', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/group/show"', + )); + } + + +} + |
