summaryrefslogtreecommitdiffstats
path: root/application/modules/user/forms/Bootos.php
diff options
context:
space:
mode:
authormichael pereira2011-03-30 10:54:29 +0200
committermichael pereira2011-03-30 10:54:29 +0200
commit912f7ffb34fb824d238ef89b91c5bd8203cfe3ad (patch)
treeec186f68b023f27fc93bb7bfa918581ccf9394e6 /application/modules/user/forms/Bootos.php
parentPreboot Metadaten Recht gesetzt (diff)
downloadpbs2-912f7ffb34fb824d238ef89b91c5bd8203cfe3ad.tar.gz
pbs2-912f7ffb34fb824d238ef89b91c5bd8203cfe3ad.tar.xz
pbs2-912f7ffb34fb824d238ef89b91c5bd8203cfe3ad.zip
Notifier 404 zu BootIso Download hinzugefügt
Diffstat (limited to 'application/modules/user/forms/Bootos.php')
-rw-r--r--application/modules/user/forms/Bootos.php144
1 files changed, 144 insertions, 0 deletions
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 @@
+<?php
+
+class user_Form_Bootos extends Zend_Form
+{
+
+ private $configlist;
+ private $action;
+ private $rights;
+ private $groupdepth;
+
+ public function setRights($rights){
+ $this->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"'
+ ));
+
+ }
+
+
+}
+