From 912f7ffb34fb824d238ef89b91c5bd8203cfe3ad Mon Sep 17 00:00:00 2001 From: michael pereira Date: Wed, 30 Mar 2011 10:54:29 +0200 Subject: Notifier 404 zu BootIso Download hinzugefügt --- application/modules/user/forms/Bootos.php | 144 ++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 application/modules/user/forms/Bootos.php (limited to 'application/modules/user/forms') diff --git a/application/modules/user/forms/Bootos.php b/application/modules/user/forms/Bootos.php new file mode 100644 index 0000000..5597f49 --- /dev/null +++ b/application/modules/user/forms/Bootos.php @@ -0,0 +1,144 @@ +rights = $rights; + } + public function setAction($action){ + $this->action = $action; + + } + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + public function setGroupdepth($groupdepth){ + $this->groupdepth = $groupdepth; + } + + public function init() + { + $this->setName("BootOsCreate"); + $this->setMethod('post'); + + if ($this->rights == 'meta') + $meta = true; + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $configfield = $this->createElement('select','configID'); + $configfield ->setLabel('Config:'); + $configfield->setAttrib('readOnly', $meta); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); + + $this->addElement('text', 'path_init', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 250)), + ), + 'required' => true, + 'size' => 50, + 'readOnly' => $meta, + 'label' => 'Init-Path:', + )); + + $this->addElement('text', 'path_kernel', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 250)), + ), + 'required' => true, + 'size' => 50, + 'readOnly' => $meta, + 'label' => 'Kernel-Path:', + )); + + $this->addElement('textarea', 'defaultkcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 175)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'readOnly' => $meta, + '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( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'readOnly' => $meta, + 'value' => $date->format('Y-m-d'), + )); + + $publicfield = $this->createElement('select','public'); + $publicfield->setLabel('Public:'); + $publicfield->addMultiOption(0, '0. Eigene Gruppe'); + $publicfield->setAttrib('readOnly', $meta); + + for($i=1; $i<$this->groupdepth; $i++){ + $publicfield->addMultiOption($i, "$i. Untergruppe"); + } + + $publicfield->setRegisterInArrayValidator(false); + $this->addElement($publicfield); + + if($this->action == "createbootos") + $label = "Create Bootos"; + else + $label = "Edit Bootos"; + + $this->addElement('submit', $this->action, array( + 'required' => false, + 'ignore' => true, + 'label' => $label, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/user/bootos"' + )); + + } + + +} + -- cgit v1.2.3-55-g7522