From 281a9a40960403b4483af33eec5cebab10e32684 Mon Sep 17 00:00:00 2001
From: Simon
Date: Mon, 18 Apr 2011 12:42:30 +0200
Subject: Role Controller geƤndert
---
.../modules/user/views/scripts/role/index.phtml | 138 ++++++++++-----------
.../modules/user/views/scripts/role/show.phtml | 10 +-
2 files changed, 69 insertions(+), 79 deletions(-)
(limited to 'application/modules/user/views/scripts')
diff --git a/application/modules/user/views/scripts/role/index.phtml b/application/modules/user/views/scripts/role/index.phtml
index edf03eb..580238f 100644
--- a/application/modules/user/views/scripts/role/index.phtml
+++ b/application/modules/user/views/scripts/role/index.phtml
@@ -1,6 +1,4 @@
-userIDsNamespace['groupID']) {
- ?>
+
roleList)==0)
-echo "There are no roles" ?> roleList as $k => $role): ?>
-userIDsNamespace['roleID'])
-$class= 'highlight checked';
-?>
-
- userIDsNamespace['roleID']) { ?>
-
+
+roleList)==0)
+ echo "There are no roles" ?>
+roleList as $i => $grouproleList): ?>
+ $role): ?>
-
-
detailsRight) {?>
-

editRight) { ?>
-

deleteRight) { ?>
-

-
-
-
-
-
-
-
-
- getID() == $this->membership->getRoleID())
+ $class= 'highlight checked';
+ ?>
+
+ getID() != $this->userIDsNamespace['roleID']) { ?>
+
+
+
+
detailsRight) {?>
+

editRight && $this->membership->getGroupID() == $role->getGroupID()) { ?>
+

deleteRight && $this->membership->getGroupID() == $role->getGroupID()) { ?>
+

-?>
-
+
+
+
getTitle();?>
+
getDescription(); ?>
+
+
+
+
-
-pagination;
-}
-?>
+pagination; ?>
diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml
index 43ae781..765153f 100644
--- a/application/modules/user/views/scripts/role/show.phtml
+++ b/application/modules/user/views/scripts/role/show.phtml
@@ -9,10 +9,10 @@ if($this->roleID) {
Role Details
deleteRight) echo $this->formButton('deleterole', 'Delete', array(
+ if($this->deleteRight && $this->roleID == $this->userIDsNamespace['roleID']) echo $this->formButton('deleterole', 'Delete', array(
'onclick' => 'self.location="/user/role/delete/roleID/' . $this->role->getID() .'"',
'class' => 'rightbutton'));
- if($this->editRight) echo $this->formButton('editrole', 'Edit', array(
+ if($this->editRight && $this->roleID == $this->userIDsNamespace['roleID']) echo $this->formButton('editrole', 'Edit', array(
'onclick' => 'self.location="/user/role/edit/roleID/' . $this->role->getID() .'"',
'class' => 'rightbutton'));
?>
@@ -38,7 +38,7 @@ if($this->roleID) {
Rights:
rightsAvailable === true) {
- if($this->addRightToRoleRight) {
+ if($this->addRightToRoleRight && $this->roleID == $this->userIDsNamespace['roleID']) {
echo $this->formButton('linkright', 'Add Rights', array(
'onclick' => 'self.location="/user/role/linkright/roleID/' . $this->role->getID() .'"',
'class' => 'addbutton'))?>
@@ -48,7 +48,7 @@ if($this->rightsAvailable === true) {
if(count($this->rightsList)==0) {
echo "There are no Rights to display.";
} else {
- if($this->removeRightOfRoleRight) echo $this->formButton('deleteallrights', 'Delete All Rights', array(
+ if($this->removeRightOfRoleRight && $this->roleID == $this->userIDsNamespace['roleID']) echo $this->formButton('deleteallrights', 'Delete All Rights', array(
'onclick' => 'self.location="/user/role/unlinkright/rightrolesID/' . $this->roleID . '-all"',
'class' => 'rightbutton'));?>
@@ -63,7 +63,7 @@ if(count($this->rightsList)==0) {
foreach($rights as $right):
?>
-
removeRightOfRoleRight) {
+
removeRightOfRoleRight && $this->roleID == $this->userIDsNamespace['roleID']) {
?>
role->getID() .'"',
'class' => 'rightbutton'));
- if($this->editRight && $this->roleID == $this->userIDsNamespace['roleID']) echo $this->formButton('editrole', 'Edit', array(
+ if($this->editRight && $this->role->getGroupID() == $this->membership->getGroupID())
+ echo $this->formButton('editrole', 'Edit', array(
'onclick' => 'self.location="/user/role/edit/roleID/' . $this->role->getID() .'"',
'class' => 'rightbutton'));
?>
@@ -38,7 +40,7 @@ if($this->roleID) {
Rights:
rightsAvailable === true) {
- if($this->addRightToRoleRight && $this->roleID == $this->userIDsNamespace['roleID']) {
+ if($this->addRightToRoleRight && $this->role->getGroupID() == $this->membership->getGroupID()) {
echo $this->formButton('linkright', 'Add Rights', array(
'onclick' => 'self.location="/user/role/linkright/roleID/' . $this->role->getID() .'"',
'class' => 'addbutton'))?>
@@ -48,7 +50,8 @@ if($this->rightsAvailable === true) {
if(count($this->rightsList)==0) {
echo "There are no Rights to display.";
} else {
- if($this->removeRightOfRoleRight && $this->roleID == $this->userIDsNamespace['roleID']) echo $this->formButton('deleteallrights', 'Delete All Rights', array(
+ if($this->removeRightOfRoleRight && $this->role->getGroupID() == $this->membership->getGroupID())
+ echo $this->formButton('deleteallrights', 'Delete All Rights', array(
'onclick' => 'self.location="/user/role/unlinkright/rightrolesID/' . $this->roleID . '-all"',
'class' => 'rightbutton'));?>
@@ -63,7 +66,7 @@ if(count($this->rightsList)==0) {
foreach($rights as $right):
?>
-
removeRightOfRoleRight && $this->roleID == $this->userIDsNamespace['roleID']) {
+
removeRightOfRoleRight && $this->role->getGroupID() == $this->membership->getGroupID()) {
?>