summaryrefslogtreecommitdiffstats
path: root/application/modules/dev/forms/BootmenuEntriesAdd.php
diff options
context:
space:
mode:
authorSimon2011-03-14 16:09:03 +0100
committerSimon2011-03-14 16:09:03 +0100
commitb5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c (patch)
treefcef50ad1ddf831f457d6aecd83e7fdc63297a1c /application/modules/dev/forms/BootmenuEntriesAdd.php
parentfooter bleibt am fensterbottom (diff)
downloadpbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.tar.gz
pbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.tar.xz
pbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.zip
Application in 3 Modules gesplittet, Dev = unsere entwicklungsumgebung, user = die weboberfläche fr anwender mit acl etc, fbgui = für die fbgui truppe - links in dev müssen noch angepasst werden
Diffstat (limited to 'application/modules/dev/forms/BootmenuEntriesAdd.php')
-rw-r--r--application/modules/dev/forms/BootmenuEntriesAdd.php110
1 files changed, 110 insertions, 0 deletions
diff --git a/application/modules/dev/forms/BootmenuEntriesAdd.php b/application/modules/dev/forms/BootmenuEntriesAdd.php
new file mode 100644
index 0000000..6981619
--- /dev/null
+++ b/application/modules/dev/forms/BootmenuEntriesAdd.php
@@ -0,0 +1,110 @@
+<?php
+
+class Application_Form_BootmenuEntriesAdd extends Zend_Form
+{
+ private $bootoslist;
+ private $configlist;
+ private $maxorder;
+
+ public function setBootoslist($bootoslist){
+ $this->bootoslist = $bootoslist;
+ }
+
+ public function setMaxorder($maxorder){
+ $this->maxorder = $maxorder;
+
+ }
+
+ public function setConfiglist($configlist){
+ $this->configlist = $configlist;
+
+ }
+
+
+ public function init()
+ {
+
+ if(!isset($_POST['bootosID'])){
+ $firstbootos = array_slice($this->bootoslist,0,1);
+ $_POST['bootosID'] = $firstbootos[0]->getID();
+ }
+
+ $this->setName("BootMenuEntryAdd");
+ $this->setMethod('post');
+
+ $this->addElement('text', 'title', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'Title:',
+ ));
+
+ $bootosfield = $this->createElement('select','bootosID');
+ $bootosfield ->setLabel('BootOs:');
+ $bootosfield->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();");
+
+ if(count($this->bootoslist)>0){
+ foreach($this->bootoslist as $bootos => $b){
+ $bootosfield->addMultiOption($b->getID(), $b->getTitle());
+ }
+ }
+ $bootosfield->setRegisterInArrayValidator(false);
+
+ $this->addElement($bootosfield);
+
+ $this->addElement('textarea', 'kcl', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => false,
+ 'cols' => 50,
+ 'rows' => 5,
+ 'label' => 'KCL:',
+ 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl()
+
+ ));
+
+ $defaultconfigid = $this->bootoslist[$_POST['bootosID']]->getConfigID();
+ $configfield = $this->createElement('select','configID');
+ $configfield->setLabel('Config:');
+ $configfield->addMultiOption($defaultconfigid, 'default');
+
+ if(count($this->configlist)>0){
+ foreach($this->configlist as $config => $c){
+ if($c->getID() != $defaultconfigid)
+ $configfield->addMultiOption($c->getID(), $c->getTitle());
+ }
+ }
+
+ $configfield->setRegisterInArrayValidator(false);
+ $this->addElement($configfield);
+
+ $orderfield = $this->createElement('select','order');
+ $orderfield ->setLabel('Position:');
+
+ for ($i = 0; $i <= $this->maxorder; $i++) {
+ $orderfield->addMultiOption($i, $i+1);
+ }
+ $orderfield->setRegisterInArrayValidator(false);
+ $this->addElement($orderfield);
+
+ $this->addElement('submit', 'addbootmenuentry', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Add Bootmenuentry',
+ ));
+
+ $this->addElement('button', 'Cancel', array(
+ 'onclick' => 'self.location="/bootmenu"'
+ ));
+
+ }
+
+
+
+
+}
+