From a29a04821929e737a436b842e519845d0d29da94 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Wed, 30 Mar 2011 17:23:30 +0200 Subject: Bootos & Bootiso --- application/modules/user/forms/Bootos.php | 49 ++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 14 deletions(-) (limited to 'application/modules/user/forms/Bootos.php') diff --git a/application/modules/user/forms/Bootos.php b/application/modules/user/forms/Bootos.php index 5597f49..f56761b 100644 --- a/application/modules/user/forms/Bootos.php +++ b/application/modules/user/forms/Bootos.php @@ -27,9 +27,11 @@ class user_Form_Bootos extends Zend_Form { $this->setName("BootOsCreate"); $this->setMethod('post'); - - if ($this->rights == 'meta') + + if ($this->rights == "meta") $meta = true; + else + $meta = null; $this->addElement('text', 'title', array( 'filters' => array('StringTrim'), @@ -39,6 +41,17 @@ class user_Form_Bootos extends Zend_Form 'required' => true, 'label' => 'Title:', )); + + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Description:', + )); $configfield = $this->createElement('select','configID'); $configfield ->setLabel('Config:'); @@ -49,6 +62,7 @@ class user_Form_Bootos extends Zend_Form $configfield->addMultiOption($c->getID(), $c->getTitle()); } } + $configfield->setRegisterInArrayValidator(false); $this->addElement($configfield); @@ -86,17 +100,6 @@ class user_Form_Bootos extends Zend_Form 'label' => 'Default-KCL:', )); - $this->addElement('textarea', 'description', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => false, - 'rows' => 5, - 'cols' => 50, - 'label' => 'Description:', - )); - $date = new DateTime(); $date->add(new DateInterval('P1Y')); $this->addElement('text', 'expires', array( @@ -114,6 +117,8 @@ class user_Form_Bootos extends Zend_Form $publicfield->setLabel('Public:'); $publicfield->addMultiOption(0, '0. Eigene Gruppe'); $publicfield->setAttrib('readOnly', $meta); + $publicfield->setAttrib('id', 'depth'); + $publicfield->setAttrib('onchange', "$('#groups .v1').show();changeDepth();"); for($i=1; $i<$this->groupdepth; $i++){ $publicfield->addMultiOption($i, "$i. Untergruppe"); @@ -137,8 +142,24 @@ class user_Form_Bootos extends Zend_Form 'onclick' => 'self.location="/user/bootos"' )); - } + ?> + +