diff options
Diffstat (limited to 'application/forms/ConfigCreate.php')
| -rw-r--r-- | application/forms/ConfigCreate.php | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/application/forms/ConfigCreate.php b/application/forms/ConfigCreate.php index 705fd62..3aa142c 100644 --- a/application/forms/ConfigCreate.php +++ b/application/forms/ConfigCreate.php @@ -3,6 +3,13 @@ class Application_Form_ConfigCreate extends Zend_Form { + private $grouplist; + + public function setGrouplist($grouplist){ + $this->grouplist = $grouplist; + + } + public function init() { $this->setName("ConfigCreate"); @@ -17,15 +24,17 @@ class Application_Form_ConfigCreate extends Zend_Form 'label' => 'Title:', )); - $this->addElement('text', 'groupID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'GroupID:', - 'value' => '1', - )); + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + 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('textarea', 'shellscript', array( 'filters' => array('StringTrim'), @@ -33,6 +42,8 @@ class Application_Form_ConfigCreate extends Zend_Form array('StringLength', false, array(0, 50)), ), 'required' => true, + 'rows' => 10, + 'cols' => 70, 'label' => 'Shellscript:', )); |
