summaryrefslogtreecommitdiffstats
path: root/application/modules/user/forms
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules/user/forms')
-rw-r--r--application/modules/user/forms/LinkRight.php45
-rw-r--r--application/modules/user/forms/RoleAdd.php16
2 files changed, 51 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(
diff --git a/application/modules/user/forms/RoleAdd.php b/application/modules/user/forms/RoleAdd.php
index 5968b47..d165701 100644
--- a/application/modules/user/forms/RoleAdd.php
+++ b/application/modules/user/forms/RoleAdd.php
@@ -32,6 +32,21 @@ class user_Form_RoleAdd extends Zend_Form
));
$sform = new Zend_Form_SubForm(array('legend' => 'Rights:'));
+
+ $sform->addElement('button', 'checkAll', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Check All',
+ 'class' => 'leftbutton',
+ 'onclick' => "checkAllCheckBoxes(new Array('inheritance'));",
+ ));
+
+ $sform->addElement('button', 'uncheckAll', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Uncheck All',
+ 'onclick' => "uncheckAllCheckBoxes(new Array('inheritance'));",
+ ));
if(count($this->rightlist) > 0) {
foreach($this->rightlist as $rightcategory => $rights) {
foreach($rights as $rightID => $rightTitle) {
@@ -46,6 +61,7 @@ class user_Form_RoleAdd extends Zend_Form
unset($elements);
}
}
+
$this->addSubForm($sform, 'rights');
$this->addElement('checkbox', 'inheritance', array(