diff options
Diffstat (limited to 'application/modules/user/forms/Bootos.php')
| -rw-r--r-- | application/modules/user/forms/Bootos.php | 400 |
1 files changed, 199 insertions, 201 deletions
diff --git a/application/modules/user/forms/Bootos.php b/application/modules/user/forms/Bootos.php index 432f0c7..02d865b 100644 --- a/application/modules/user/forms/Bootos.php +++ b/application/modules/user/forms/Bootos.php @@ -1,207 +1,205 @@ -<?php +<? php /* * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg - * This program is free software distributed under the GPL version 2. - * See http://gpl.openslx.org/ - * - * If you have any feedback please consult http://feedback.openslx.org/ and - * send your suggestions, praise, or complaints to feedback@openslx.org - * - * General information about OpenSLX can be found at http://openslx.org/ - */ - -class user_Form_Bootos extends Zend_Form -{ - - private $configlist; - private $action; - private $groupdepth; - private $page; - - public function setAction($action){ - $this->action = $action; - - } - public function setConfiglist($configlist){ - $this->configlist = $configlist; - - } - public function setGroupdepth($groupdepth){ - $this->groupdepth = $groupdepth; - } - public function setPage($page){ - $this->page = $page; - } - - public function init() - { - $this->setName("BootOsCreate"); - $this->setMethod('post'); - $this->setEnctype("multipart/form-data"); - - if (!Pbs_Acl::checkRight('boe') && $this->action == 'editbootos') - $meta = true; - else - $meta = null; - - if($this->action == 'editbootos') - $filereq = false; - else - $filereq = true; - - $this->addElement('text', 'title', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - '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:', - )); - - $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('text', 'distro', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 140)), - ), - 'required' => false, - 'readOnly' => $meta, - 'label' => 'Distro:', - )); - - $this->addElement('text', 'distroversion', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 140)), - ), - 'required' => false, - 'readOnly' => $meta, - 'label' => 'Distroversion:', - )); - - $this->addElement('text', 'shortname', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 140)), - ), - 'required' => false, - 'readOnly' => $meta, - 'label' => 'Shortname:', - )); - - $this->addElement('text', 'share', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 140)), - ), - 'required' => false, - 'readOnly' => $meta, - 'label' => 'Share:', - )); - - $this->addElement('file', 'kernel', array( - 'readOnly' => $meta, - 'label' => 'Kernel:', - )); - - $this->addElement('file', 'init', array( - 'readOnly' => $meta, - 'label' => 'Initramfs:', - )); - - $this->addElement('file', 'config', array( - 'validators' => array(array('Extension', false, array('tgz'))), - 'readOnly' => $meta, - 'label' => 'Config:', - )); - - $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(-1, 'X. Not Visible'); - $publicfield->addMultiOption(0, '0. Own Group'); - $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"); - } - - $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/index/page/'.$this->page.'"' - )); - - ?> - - <script type="text/javascript"> - $(document).ready(function(){ - changeDepth(); - $('#groups .v1').show(); - }); - function changeDepth(){ - i = $("#depth option:selected").val(); - $('#depthimg').attr('src','/stats/graphgroup/level/' + i); - }</script> - - <div id='groups' style='text-align: center;'> - <div class='v1' > - <img id=depthimg src='/stats/graphgroup/'/> - </div> - </div> - -<?php +* This program is free software distributed under the GPL version 2. +* See http://gpl.openslx.org/ +* +* If you have any feedback please consult http://feedback.openslx.org/ and +* send your suggestions, praise, or complaints to feedback@openslx.org +* +* General information about OpenSLX can be found at http://openslx.org/ +*/ + +class user_Form_Bootos extends Zend_Form { + + private $configlist; + private $action; + private $groupdepth; + private $page; + + public function setAction($action) { + $this->action = $action; + + } + public function setConfiglist($configlist) { + $this->configlist = $configlist; + + } + public function setGroupdepth($groupdepth) { + $this->groupdepth = $groupdepth; + } + public function setPage($page) { + $this->page = $page; + } + + public function init() { + $this->setName("BootOsCreate"); + $this->setMethod('post'); + $this->setEnctype("multipart/form-data"); + + if (!Pbs_Acl::checkRight('boe') && $this->action == 'editbootos') + { $meta = true; } + else + { $meta = null; } + + if($this->action == 'editbootos') + { $filereq = false; } + else + { $filereq = true; } + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + '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:', + )); + + $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('text', 'distro', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'readOnly' => $meta, + 'label' => 'Distro:', + )); + + $this->addElement('text', 'distroversion', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'readOnly' => $meta, + 'label' => 'Distroversion:', + )); + + $this->addElement('text', 'shortname', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'readOnly' => $meta, + 'label' => 'Shortname:', + )); + + $this->addElement('text', 'share', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'readOnly' => $meta, + 'label' => 'Share:', + )); + + $this->addElement('file', 'kernel', array( + 'readOnly' => $meta, + 'label' => 'Kernel:', + )); + + $this->addElement('file', 'init', array( + 'readOnly' => $meta, + 'label' => 'Initramfs:', + )); + + $this->addElement('file', 'config', array( + 'validators' => array(array('Extension', false, array('tgz'))), + 'readOnly' => $meta, + 'label' => 'Config:', + )); + + $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(-1, 'X. Not Visible'); + $publicfield->addMultiOption(0, '0. Own Group'); + $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"); } - + $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/index/page/'.$this->page.'"' + )); + + ? > + + < script type = "text/javascript" > + $(document).ready(function() { + changeDepth(); + $('#groups .v1').show(); + }); + function changeDepth() { + i = $("#depth option:selected").val(); + $('#depthimg').attr('src', '/stats/graphgroup/level/' + i); + } < / script > + + < div id = 'groups' style = 'text-align: center;' > + < div class = 'v1' > + < img id = depthimg src = '/stats/graphgroup/' / > + < / div > + < / div > + + <? php + } + + } -?> + ? > |
