summaryrefslogtreecommitdiffstats
path: root/application/modules/user/forms/LinkRight.php
diff options
context:
space:
mode:
authorBjörn Geiger2011-04-08 13:20:06 +0200
committerBjörn Geiger2011-04-08 13:20:06 +0200
commitfb9e5f028899f8205541fe86d7eb9c5e12c4a5ad (patch)
treebd1864cd6dcd4668ba9131b04bf6490ef9e803b3 /application/modules/user/forms/LinkRight.php
parenthighlight in Bootmenu gefixt und das default-Bootmenu bekomtm kein Link zum s... (diff)
downloadpbs2-fb9e5f028899f8205541fe86d7eb9c5e12c4a5ad.tar.gz
pbs2-fb9e5f028899f8205541fe86d7eb9c5e12c4a5ad.tar.xz
pbs2-fb9e5f028899f8205541fe86d7eb9c5e12c4a5ad.zip
Auch beim hinzufügen von weiteren Rechten nun Checkboxliste
Diffstat (limited to 'application/modules/user/forms/LinkRight.php')
-rw-r--r--application/modules/user/forms/LinkRight.php45
1 files changed, 35 insertions, 10 deletions
diff --git a/application/modules/user/forms/LinkRight.php b/application/modules/user/forms/LinkRight.php
index 54aacd6..80cfb1d 100644
--- a/application/modules/user/forms/LinkRight.php
+++ b/application/modules/user/forms/LinkRight.php
@@ -3,29 +3,54 @@
class user_Form_LinkRight extends Zend_Form
{
private $rightlist;
- private $roleID;
public function setRightlist($rightlist){
$this->rightlist = $rightlist;
}
- public function setRoleID($roleID){
- $this->roleID = $roleID;
- }
-
public function init()
{
- $this->setName("LinkRight");
+ $this->setName("LinkRights");
$this->setMethod('post');
- $rightfield = $this->createElement('select','rightID',array('label'=> 'Right: ','required' => true,'multioptions'=> $this->rightlist));
- $rightfield->setRegisterInArrayValidator(false);
- $this->addElement($rightfield);
+ $sform = new Zend_Form_SubForm(array('legend' => 'Rights:'));
+
+ $sform->addElement('button', 'checkAll', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Check All',
+ 'class' => 'leftbutton',
+ 'onclick' => "checkAllCheckBoxes();",
+ ));
+
+ $sform->addElement('button', 'uncheckAll', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Uncheck All',
+ 'onclick' => "uncheckAllCheckBoxes();",
+ ));
+
+ if(count($this->rightlist) > 0) {
+ foreach($this->rightlist as $rightcategory => $rights) {
+ foreach($rights as $rightID => $rightTitle) {
+ $element = $this->createElement('checkbox', "$rightID", array(
+ 'label' => $rightTitle . ':',
+ 'belongsTo' => 'rights',
+ ));
+ $elements[] = $rightID;
+ $sform->addElement($element);
+ }
+ $sform->addDisplayGroup($elements, "$rightcategory", array("legend" => $rightcategory . ":"));
+ unset($elements);
+ }
+ }
+
+ $this->addSubForm($sform, 'rights');
$this->addElement('submit', 'link', array(
'required' => false,
'ignore' => true,
- 'label' => 'Add',
+ 'label' => 'Add Rights',
));
$this->addElement('button', 'cancel', array(