diff options
| author | michael pereira | 2011-03-08 19:41:00 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-08 19:41:00 +0100 |
| commit | d44db6d338d72c6229b1ba788784c7bb90471cf0 (patch) | |
| tree | 909a6e686f8c9a8bfa491014e404376604791d9d /application/forms | |
| parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-d44db6d338d72c6229b1ba788784c7bb90471cf0.tar.gz pbs2-d44db6d338d72c6229b1ba788784c7bb90471cf0.tar.xz pbs2-d44db6d338d72c6229b1ba788784c7bb90471cf0.zip | |
BootOs Name anzeigen & Reihenfolge im BootMenu
Diffstat (limited to 'application/forms')
| -rw-r--r-- | application/forms/BootmenuEntriesAdd.php | 28 | ||||
| -rw-r--r-- | application/forms/BootmenuEntriesEdit.php | 24 |
2 files changed, 32 insertions, 20 deletions
diff --git a/application/forms/BootmenuEntriesAdd.php b/application/forms/BootmenuEntriesAdd.php index c18b54c..93b87f1 100644 --- a/application/forms/BootmenuEntriesAdd.php +++ b/application/forms/BootmenuEntriesAdd.php @@ -3,6 +3,7 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form { private $bootoslist; + private $maxorder; public function init() { @@ -21,8 +22,8 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form $bootosfield = $this->createElement('select','bootosID'); $bootosfield ->setLabel('BootOs:'); - foreach($this->bootoslist as $bootos){ - $bootosfield->addMultiOption($bootos->getID(), $bootos->getTitle()); + foreach($this->bootoslist as $bootos => $b){ + $bootosfield->addMultiOption($b->getID(), $b->getTitle()); } $bootosfield->setRegisterInArrayValidator(false); $this->addElement($bootosfield); @@ -45,15 +46,15 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form 'label' => 'ConfigID:', 'value' => '1', )); - - $this->addElement('text', 'order', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'order:', - )); + + $orderfield = $this->createElement('select','order'); + $orderfield ->setLabel('Order:'); + + for ($i = 0; $i <= $this->maxorder; $i++) { + $orderfield->addMultiOption($i, $i); + } + $orderfield->setRegisterInArrayValidator(false); + $this->addElement($orderfield); $this->addElement('submit', 'addbootmenuentry', array( 'required' => false, @@ -71,6 +72,11 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form $this->bootoslist = $bootoslist; } + + public function setMaxorder($maxorder){ + $this->maxorder = $maxorder; + + } diff --git a/application/forms/BootmenuEntriesEdit.php b/application/forms/BootmenuEntriesEdit.php index added01..042ae12 100644 --- a/application/forms/BootmenuEntriesEdit.php +++ b/application/forms/BootmenuEntriesEdit.php @@ -4,11 +4,17 @@ class Application_Form_BootmenuEntriesEdit extends Zend_Form { private $bootoslist; - + private $maxorder; + public function setBootoslist($bootoslist){ $this->bootoslist = $bootoslist; } + + public function setMaxorder($maxorder){ + $this->maxorder = $maxorder; + + } public function init() { @@ -52,14 +58,14 @@ class Application_Form_BootmenuEntriesEdit extends Zend_Form 'value' => '1', )); - $this->addElement('text', 'order', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'order:', - )); + $orderfield = $this->createElement('select','order'); + $orderfield ->setLabel('Order:'); + + for ($i = 0; $i <= $this->maxorder; $i++) { + $orderfield->addMultiOption($i, $i); + } + $orderfield->setRegisterInArrayValidator(false); + $this->addElement($orderfield); $this->addElement('submit', 'editbootmenuentry', array( 'required' => false, |
