summaryrefslogtreecommitdiffstats
path: root/application/forms
diff options
context:
space:
mode:
authormichael pereira2011-03-08 14:53:36 +0100
committermichael pereira2011-03-08 14:53:36 +0100
commitb457bd7b0e70b3f76fd1d30b7d31ff2d609b4de8 (patch)
treeb861c99b5942e74d77ca2a7b58865ee93dcb3010 /application/forms
parentBootMenu fix (diff)
downloadpbs2-b457bd7b0e70b3f76fd1d30b7d31ff2d609b4de8.tar.gz
pbs2-b457bd7b0e70b3f76fd1d30b7d31ff2d609b4de8.tar.xz
pbs2-b457bd7b0e70b3f76fd1d30b7d31ff2d609b4de8.zip
BootMenuEntries select
Diffstat (limited to 'application/forms')
-rw-r--r--application/forms/BootmenuEntriesAdd.php25
-rw-r--r--application/forms/BootmenuEntriesEdit.php24
2 files changed, 30 insertions, 19 deletions
diff --git a/application/forms/BootmenuEntriesAdd.php b/application/forms/BootmenuEntriesAdd.php
index 0577ede..c18b54c 100644
--- a/application/forms/BootmenuEntriesAdd.php
+++ b/application/forms/BootmenuEntriesAdd.php
@@ -2,13 +2,14 @@
class Application_Form_BootmenuEntriesAdd extends Zend_Form
{
+ private $bootoslist;
public function init()
{
$this->setName("BootMenuEntryAdd");
$this->setMethod('post');
- $this->addElement('text', 'title', array(
+ $this->addElement('text', 'title', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 50)),
@@ -17,15 +18,14 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form
'label' => 'Title:',
));
- $this->addElement('text', 'bootosID', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => true,
- 'label' => 'BootOsID:',
- 'value' => '1',
- ));
+ $bootosfield = $this->createElement('select','bootosID');
+ $bootosfield ->setLabel('BootOs:');
+
+ foreach($this->bootoslist as $bootos){
+ $bootosfield->addMultiOption($bootos->getID(), $bootos->getTitle());
+ }
+ $bootosfield->setRegisterInArrayValidator(false);
+ $this->addElement($bootosfield);
$this->addElement('text', 'kcl', array(
'filters' => array('StringTrim'),
@@ -66,6 +66,11 @@ class Application_Form_BootmenuEntriesAdd extends Zend_Form
));
}
+
+ public function setBootoslist($bootoslist){
+ $this->bootoslist = $bootoslist;
+
+ }
diff --git a/application/forms/BootmenuEntriesEdit.php b/application/forms/BootmenuEntriesEdit.php
index e69dc8b..added01 100644
--- a/application/forms/BootmenuEntriesEdit.php
+++ b/application/forms/BootmenuEntriesEdit.php
@@ -2,7 +2,14 @@
class Application_Form_BootmenuEntriesEdit extends Zend_Form
{
+
+ private $bootoslist;
+ public function setBootoslist($bootoslist){
+ $this->bootoslist = $bootoslist;
+
+ }
+
public function init()
{
$this->setName("BootMenuEntryAdd");
@@ -17,15 +24,14 @@ class Application_Form_BootmenuEntriesEdit extends Zend_Form
'label' => 'Title:',
));
- $this->addElement('text', 'bootosID', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => true,
- 'label' => 'BootOsID:',
- 'value' => '1',
- ));
+ $bootosfield = $this->createElement('select','bootosID');
+ $bootosfield ->setLabel('BootOs:');
+
+ foreach($this->bootoslist as $bootos){
+ $bootosfield->addMultiOption($bootos->getID(), $bootos->getTitle());
+ }
+ $bootosfield->setRegisterInArrayValidator(false);
+ $this->addElement($bootosfield);
$this->addElement('text', 'kcl', array(
'filters' => array('StringTrim'),