summaryrefslogtreecommitdiffstats
path: root/application/modules
diff options
context:
space:
mode:
authorSimon2011-04-08 17:55:55 +0200
committerSimon2011-04-08 17:55:55 +0200
commit63f0c0060bce22ed4a994f5bda013676f327ebf0 (patch)
treeb98a1ad9646cdac647dc87c8f120a3e3b9d1ec38 /application/modules
parentRecht: 'Edit role' hinzugefügt (diff)
parentkcl fixed (diff)
downloadpbs2-63f0c0060bce22ed4a994f5bda013676f327ebf0.tar.gz
pbs2-63f0c0060bce22ed4a994f5bda013676f327ebf0.tar.xz
pbs2-63f0c0060bce22ed4a994f5bda013676f327ebf0.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/modules')
-rw-r--r--application/modules/user/controllers/BootmenuController.php29
-rw-r--r--application/modules/user/forms/BootmenuEntries.php22
-rw-r--r--application/modules/user/views/scripts/bootmenu/index.phtml2
3 files changed, 31 insertions, 22 deletions
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php
index adcf08f..03d0362 100644
--- a/application/modules/user/controllers/BootmenuController.php
+++ b/application/modules/user/controllers/BootmenuController.php
@@ -73,6 +73,12 @@ class user_BootmenuController extends Zend_Controller_Action
$bootmenuID = $bm->getID();
$bootmenuentries[$bootmenuID] = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID));
foreach ($bootmenuentries[$bootmenuID] as $bootmenuentry){
+ if($bootmenuentry->getKcl())
+ $bootmenuentry->setKcl($bootosMapper->find($bootmenuentry->getBootosID())->getDefaultkcl());
+ else
+ $bootmenuentry->setKcl("deactivated (edit Bootmenuentry to activate)");
+ if($bootmenuentry->getKclappend() == null)
+ $bootmenuentry->setKclappend("none (edit Bootmenuentry to set KCL-Append)");
$bootmenuentry->setBootosID("[".$bootmenuentry->getBootosID()."] ".$bootosMapper->find($bootmenuentry->getBootosID())->getTitle());
$bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle());
}
@@ -84,6 +90,12 @@ class user_BootmenuController extends Zend_Controller_Action
$bootmenuID = $bootmenu[0]->getID();
$bootmenuentries[$bootmenuID] = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID));
foreach ($bootmenuentries[$bootmenuID] as $bootmenuentry){
+ if($bootmenuentry->getKcl())
+ $bootmenuentry->setKcl($bootosMapper->find($bootmenuentry->getBootosID())->getDefaultkcl());
+ else
+ $bootmenuentry->setKcl("deactivated (edit Bootmenuentry to activate)");
+ if($bootmenuentry->getKclappend() == null)
+ $bootmenuentry->setKclappend("none");
$bootmenuentry->setBootosID("[".$bootmenuentry->getBootosID()."] ".$bootosMapper->find($bootmenuentry->getBootosID())->getTitle());
$bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle());
}
@@ -313,17 +325,20 @@ class user_BootmenuController extends Zend_Controller_Action
if (!isset($_POST["addbootmenuentry"])){
+ if(!isset($_POST['kcl']))
+ $_POST['kcl'] = true;
+
$bootmenuentryForm = new user_Form_BootmenuEntries(array(
'bootoslist'=> $bootoslist,
'bootosanzeige' => $bootosanzeige,
'maxorder'=> $maxorder,
'configlist'=> $configlist,
'page' => $this->page,
- 'action' => 'addbootmenuentry'
+ 'action' => 'addbootmenuentry',
));
$bootmenuentryForm->populate(array('order' => $maxorder));
- unset($_POST['kcl']);
+ unset($_POST['defaultkcl']);
unset($_POST['configID']);
$bootmenuentryForm->populate($_POST);
@@ -335,7 +350,8 @@ class user_BootmenuController extends Zend_Controller_Action
'maxorder'=> $maxorder,
'configlist'=>$configlist,
'page' => $this->page,
- 'action' => 'addbootmenuentry'),$_POST);
+ 'action' => 'addbootmenuentry',
+ ),$_POST);
if ($bootmenuentryForm->isValid($_POST)) {
@@ -415,12 +431,14 @@ class user_BootmenuController extends Zend_Controller_Action
if (!isset($_POST["editbootmenuentry"])){
+ if(!isset($_POST['kcl']))
+ $_POST['kcl'] = $bootmenuentry->getKcl();
+
$bootmenuentryForm = new user_Form_BootmenuEntries(array(
'bootoslist'=> $bootoslist,
'bootosanzeige' => $bootosanzeige,
'maxorder'=> $maxorder-1,
'configlist'=> $configlist,
- 'kcl' => $bootmenuentry->getKcl(),
'page' => $this->page,
'action' => 'editbootmenuentry',
));
@@ -429,7 +447,7 @@ class user_BootmenuController extends Zend_Controller_Action
$bootmenuentryForm->populate($bootmenuentry->toArray());
}
else{
- unset($_POST['kcl']);
+ unset($_POST['defaultkcl']);
unset($_POST['configID']);
$bootmenuentryForm->populate($_POST);
}
@@ -440,7 +458,6 @@ class user_BootmenuController extends Zend_Controller_Action
'bootosanzeige' => $bootosanzeige,
'maxorder'=> $maxorder-1,
'configlist'=> $configlist,
- 'kcl' => $bootmenuentry->getKcl(),
'page' => $this->page,
'action' => 'editbootmenuentry'),$_POST);
diff --git a/application/modules/user/forms/BootmenuEntries.php b/application/modules/user/forms/BootmenuEntries.php
index b897974..58a2820 100644
--- a/application/modules/user/forms/BootmenuEntries.php
+++ b/application/modules/user/forms/BootmenuEntries.php
@@ -7,13 +7,8 @@ class user_Form_BootmenuEntries extends Zend_Form
private $configlist;
private $maxorder;
private $action;
- private $page;
- private $kcl;
+ private $page;
-
- public function setKcl($kcl){
- $this->kcl = $kcl;
- }
public function setAction($action){
$this->action = $action;
@@ -47,10 +42,7 @@ class user_Form_BootmenuEntries extends Zend_Form
@list($key) = array_keys($this->bootoslist);
$firstbootos = $this->bootoslist[$key];
$_POST['bootosID'] = $firstbootos->getID();
- if(isset($this->kcl))
- $_POST['kclactive'] = true;
- else
- $_POST['kclactive'] = false;
+
}
$this->setName($this->action);
@@ -78,15 +70,15 @@ class user_Form_BootmenuEntries extends Zend_Form
$bootosfield->setRegisterInArrayValidator(false);
$this->addElement($bootosfield);
- $kclactive = $this->createElement('checkbox','kclactive');
+ $kclactive = $this->createElement('checkbox','kcl');
$kclactive->setAttrib('onChange', "document.getElementById('".$this->action."').submit();");
$kclactive->setLabel('Use default KCL:');
- $kclactive->setValue($_POST['kclactive']);
+ $kclactive->setValue($_POST['kcl']);
$this->addElement($kclactive);
- if($_POST['kclactive']){
- $this->addElement('textarea', 'kcl', array(
+ if($_POST['kcl']){
+ $this->addElement('textarea', 'defaultkcl', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 50)),
@@ -101,7 +93,7 @@ class user_Form_BootmenuEntries extends Zend_Form
));
}
- if($_POST['kclactive'])
+ if($_POST['kcl'])
$kcllength = 175 - strlen($this->bootoslist[$_POST['bootosID']]->getDefaultkcl());
else
$kcllength = 175;
diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml
index 5d298a5..0b4b12f 100644
--- a/application/modules/user/views/scripts/bootmenu/index.phtml
+++ b/application/modules/user/views/scripts/bootmenu/index.phtml
@@ -116,7 +116,7 @@
<div class='title'><?php echo $this->escape($bootmenuentry->getTitle()); ?></div>
<div class='subtitle'><?php echo $this->escape($bootmenuentry->getBootosID()) ?></div>
<div class='details dispnone'>
- <label>KCL</label>
+ <label>Default KCL</label>
<div class='item'><?php echo $this->escape($bootmenuentry->getKcl()); ?></div>
<label>KCL-Append</label>
<div class='item'><?php echo $this->escape($bootmenuentry->getKclappend()); ?></div>