summaryrefslogtreecommitdiffstats
path: root/application/modules/dev
diff options
context:
space:
mode:
authormichael pereira2011-03-16 16:35:15 +0100
committermichael pereira2011-03-16 16:35:15 +0100
commit26deb7a640aea0653dae33f9b9d36f552b58c07d (patch)
tree3d8c62cdd4906322cf518e618479b061ccf41e8d /application/modules/dev
parentDefault KCL wird jetzt automatisch geupdated (diff)
downloadpbs2-26deb7a640aea0653dae33f9b9d36f552b58c07d.tar.gz
pbs2-26deb7a640aea0653dae33f9b9d36f552b58c07d.tar.xz
pbs2-26deb7a640aea0653dae33f9b9d36f552b58c07d.zip
KCLAppend hinzugefuegt, KCL fertig :-)
Diffstat (limited to 'application/modules/dev')
-rw-r--r--application/modules/dev/controllers/BootmenuController.php18
-rw-r--r--application/modules/dev/controllers/ResourceController.php21
-rw-r--r--application/modules/dev/forms/BootmenuEntriesAdd.php35
-rw-r--r--application/modules/dev/forms/BootmenuEntriesEdit.php49
-rw-r--r--application/modules/dev/views/scripts/bootmenu/index.phtml4
5 files changed, 73 insertions, 54 deletions
diff --git a/application/modules/dev/controllers/BootmenuController.php b/application/modules/dev/controllers/BootmenuController.php
index 07924d4..2d2a1df 100644
--- a/application/modules/dev/controllers/BootmenuController.php
+++ b/application/modules/dev/controllers/BootmenuController.php
@@ -100,12 +100,12 @@ class dev_BootmenuController extends Zend_Controller_Action
unset($_POST['kcl']);
unset($_POST['configID']);
$addbootmenuentryForm->populate($_POST);
- } else {
+ } else {
$addbootmenuentryForm = new dev_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()),$_POST);
if ($addbootmenuentryForm->isValid($_POST)) {
-
+
$bootmenuentry = new Application_Model_BootMenuEntries($_POST);
$bootmenuentry->setBootmenuID($bootmenuID);
@@ -116,6 +116,9 @@ class dev_BootmenuController extends Zend_Controller_Action
$bootmenuentry->setOrder($bootmenuentry->getOrder());
$bootmenuentrymapper->order($bootmenuentry);
}
+
+ //print_a($bootmenuentry);
+
$bootmenuentrymapper->save($bootmenuentry);
}catch(Zend_Exception $e)
{
@@ -225,9 +228,10 @@ class dev_BootmenuController extends Zend_Controller_Action
} else {
$bootmenuentrymapper->find($bootmenuentryID, $bootmenuentry);
-
- $editbootmenuentryForm = new dev_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()));
- if(!isset($_POST['kcl'])){
+
+ $editbootmenuentryForm = new dev_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll(), 'kcl' => $bootmenuentry->getKcl()));
+
+ if(!isset($_POST['configID'])){
$editbootmenuentryForm->populate($bootmenuentry->toArray());
}
else{
@@ -237,10 +241,10 @@ class dev_BootmenuController extends Zend_Controller_Action
}
}
}else{
- $editbootmenuentryForm = new dev_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()),$_POST);
+ $editbootmenuentryForm = new dev_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll(), 'kcl' => $bootmenuentry->getKcl()),$_POST);
if ($editbootmenuentryForm->isValid($_POST)) {
-
+
$bootmenuentry = new Application_Model_BootMenuEntries($_POST);
$bootmenuentry->setBootmenuID($bootmenuID);
diff --git a/application/modules/dev/controllers/ResourceController.php b/application/modules/dev/controllers/ResourceController.php
index defab76..653b70d 100644
--- a/application/modules/dev/controllers/ResourceController.php
+++ b/application/modules/dev/controllers/ResourceController.php
@@ -97,14 +97,19 @@ class dev_ResourceController extends Zend_Controller_Action
$bme = new Application_Model_BootMenuEntries();
$bmemapper->find($bmeID,$bme);
- if($bme->getKcl() != null){
- header('Content-Type: text/html');
- $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment';
- header('Content-Disposition: ' . $content_disp . '; filename="kcl.txt"');
- header('Pragma: no-cache');
- header('Expires: 0');
- echo $bme->getKcl();
- }
+ header('Content-Type: text/html');
+ $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment';
+ header('Content-Disposition: ' . $content_disp . '; filename="kcl.txt"');
+ header('Pragma: no-cache');
+ header('Expires: 0');
+
+ if($bme->getKcl() != null)
+ $result = $bme->getKcl() . " " . $bme->getKclappend();
+ else
+ $result = $bme->getKclappend();
+
+ echo $result;
+
}
diff --git a/application/modules/dev/forms/BootmenuEntriesAdd.php b/application/modules/dev/forms/BootmenuEntriesAdd.php
index ef6e909..e849e2d 100644
--- a/application/modules/dev/forms/BootmenuEntriesAdd.php
+++ b/application/modules/dev/forms/BootmenuEntriesAdd.php
@@ -27,6 +27,7 @@ class dev_Form_BootmenuEntriesAdd extends Zend_Form
if(!isset($_POST['bootosID'])){
$firstbootos = array_slice($this->bootoslist,0,1);
$_POST['bootosID'] = $firstbootos[0]->getID();
+ $_POST['kclactive'] = true;
}
$this->setName("BootMenuEntryAdd");
@@ -52,28 +53,30 @@ class dev_Form_BootmenuEntriesAdd extends Zend_Form
}
$bootosfield->setRegisterInArrayValidator(false);
- $this->addElement($bootosfield);
+ $this->addElement($bootosfield);
$kclactive = $this->createElement('checkbox','kclactive');
- #$kclactive->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();");
+ $kclactive->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();");
$kclactive->setLabel('Use default KCL:');
$kclactive->setValue(true);
$this->addElement($kclactive);
- $this->addElement('textarea', 'kcl', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => false,
- 'cols' => 50,
- 'rows' => 5,
- 'label' => 'KCL:',
- 'readOnly' => true,
- 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl()
-
- ));
+ if($_POST['kclactive']){
+ $this->addElement('textarea', 'kcl', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => false,
+ 'cols' => 50,
+ 'rows' => 5,
+ 'label' => 'KCL:',
+ 'readOnly' => true,
+ 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl()
+
+ ));
+ }
$this->addElement('textarea', 'kclappend', array(
@@ -119,7 +122,7 @@ class dev_Form_BootmenuEntriesAdd extends Zend_Form
));
$this->addElement('button', 'Cancel', array(
- 'onclick' => 'self.location="/bootmenu"'
+ 'onclick' => 'self.location="/dev/bootmenu"'
));
}
diff --git a/application/modules/dev/forms/BootmenuEntriesEdit.php b/application/modules/dev/forms/BootmenuEntriesEdit.php
index 394563e..8c1c41f 100644
--- a/application/modules/dev/forms/BootmenuEntriesEdit.php
+++ b/application/modules/dev/forms/BootmenuEntriesEdit.php
@@ -6,21 +6,23 @@ class dev_Form_BootmenuEntriesEdit extends Zend_Form
private $bootoslist;
private $configlist;
private $maxorder;
+ private $kcl;
public function setBootoslist($bootoslist){
- $this->bootoslist = $bootoslist;
-
+ $this->bootoslist = $bootoslist;
}
public function setMaxorder($maxorder){
$this->maxorder = $maxorder;
-
}
public function setConfiglist($configlist){
- $this->configlist = $configlist;
-
+ $this->configlist = $configlist;
+ }
+ public function setKcl($kcl){
+ $this->kcl = $kcl;
}
+
public function init()
{
@@ -28,6 +30,10 @@ class dev_Form_BootmenuEntriesEdit extends Zend_Form
if(!isset($_POST['bootosID'])){
$firstbootos = array_slice($this->bootoslist,0,1);
$_POST['bootosID'] = $firstbootos[0]->getID();
+ if(isset($this->kcl))
+ $_POST['kclactive'] = true;
+ else
+ $_POST['kclactive'] = false;
}
$this->setName("BootMenuEntryAdd");
@@ -56,23 +62,25 @@ class dev_Form_BootmenuEntriesEdit extends Zend_Form
$this->addElement($bootosfield);
$kclactive = $this->createElement('checkbox','kclactive');
- #$kclactive->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();");
+ $kclactive->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();");
$kclactive->setLabel('Use default KCL:');
- $kclactive->setValue(true);
+ $kclactive->setValue($_POST['kclactive']);
$this->addElement($kclactive);
- $this->addElement('textarea', 'kcl', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => false,
- 'cols' => 50,
- 'rows' => 5,
- 'label' => 'KCL:',
- 'readOnly' => true,
- 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl()
- ));
+ if($_POST['kclactive']){
+ $this->addElement('textarea', 'kcl', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => false,
+ 'cols' => 50,
+ 'rows' => 5,
+ 'label' => 'KCL:',
+ 'readOnly' => true,
+ 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl()
+ ));
+ }
$this->addElement('textarea', 'kclappend', array(
'filters' => array('StringTrim'),
@@ -91,7 +99,6 @@ class dev_Form_BootmenuEntriesEdit extends Zend_Form
$configfield->setLabel('Config:');
$configfield->addMultiOption($defaultconfigid, 'default');
-
if(count($this->configlist)>0){
foreach($this->configlist as $config => $c){
if($c->getID() != $defaultconfigid)
@@ -117,7 +124,7 @@ class dev_Form_BootmenuEntriesEdit extends Zend_Form
));
$this->addElement('button', 'Cancel', array(
- 'onclick' => 'self.location="/bootmenu"'
+ 'onclick' => 'self.location="/dev/bootmenu"'
));
}
diff --git a/application/modules/dev/views/scripts/bootmenu/index.phtml b/application/modules/dev/views/scripts/bootmenu/index.phtml
index d321758..5a56fc4 100644
--- a/application/modules/dev/views/scripts/bootmenu/index.phtml
+++ b/application/modules/dev/views/scripts/bootmenu/index.phtml
@@ -92,8 +92,8 @@
<td><?php echo $this->escape($bootmenuentry->getTitle()); ?></td>
<!--<td><?php echo $this->escape($bootmenuentry->getBootmenuID()); ?></td>
--><td><?php echo "[".$this->escape($bootmenuentry->getBootosID()."] ". $bootos->getTitle()); ?></td>
- <td><?php echo $this->escape($bootmenuentry->getkcl()); ?></td>
- <td><?php echo $this->escape($bootmenuentry->getkclappend()); ?></td>
+ <td><?php echo $this->escape($bootmenuentry->getKcl()); ?></td>
+ <td><?php echo $this->escape($bootmenuentry->getKclappend()); ?></td>
<td><?php echo "[".$this->escape($bootmenuentry->getConfigID()."] ". $config->getTitle()); ?></td>
<td><?php echo $this->escape($bootmenuentry->getOrder() + 1); ?></td>
<td class='action'><a href="<?php echo $this->url(