diff options
| author | michael pereira | 2011-04-08 15:20:55 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-08 15:20:55 +0200 |
| commit | 7067b772abaf370fb9b73c33e4b92d4dfbc5b2cf (patch) | |
| tree | 6d901d595c04b9b5156b6803bfb2fbcb2785273c /application/modules/user/forms | |
| parent | kcl gefixt (diff) | |
| parent | Footer ist wieder an der Box (diff) | |
| download | pbs2-7067b772abaf370fb9b73c33e4b92d4dfbc5b2cf.tar.gz pbs2-7067b772abaf370fb9b73c33e4b92d4dfbc5b2cf.tar.xz pbs2-7067b772abaf370fb9b73c33e4b92d4dfbc5b2cf.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/modules/user/forms')
| -rw-r--r-- | application/modules/user/forms/LinkRight.php | 45 | ||||
| -rw-r--r-- | application/modules/user/forms/RoleAdd.php | 16 |
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( |
