diff options
| author | Björn Geiger | 2011-04-11 10:59:36 +0200 |
|---|---|---|
| committer | Björn Geiger | 2011-04-11 10:59:36 +0200 |
| commit | 8159b6bb65b9b69a7a2ef737d4fa11a5232c10f1 (patch) | |
| tree | 1fb0d122e396cd24d80022fef260d5b2aff4a259 /application/modules/user/views | |
| parent | Super Admin hat wieder alle Rechte (diff) | |
| download | pbs2-8159b6bb65b9b69a7a2ef737d4fa11a5232c10f1.tar.gz pbs2-8159b6bb65b9b69a7a2ef737d4fa11a5232c10f1.tar.xz pbs2-8159b6bb65b9b69a7a2ef737d4fa11a5232c10f1.zip | |
ACL im RoleController
Diffstat (limited to 'application/modules/user/views')
| -rw-r--r-- | application/modules/user/views/scripts/role/index.phtml | 27 | ||||
| -rw-r--r-- | application/modules/user/views/scripts/role/show.phtml | 19 |
2 files changed, 35 insertions, 11 deletions
diff --git a/application/modules/user/views/scripts/role/index.phtml b/application/modules/user/views/scripts/role/index.phtml index 2fb27bc..baee6e4 100644 --- a/application/modules/user/views/scripts/role/index.phtml +++ b/application/modules/user/views/scripts/role/index.phtml @@ -2,14 +2,20 @@ if($this->userIDsNamespace['groupID']) { ?> <h1>Roles</h1> - <?php echo $this->searchform; ?> - <?php echo $this->formButton('addrole', 'Add Role', array( + <?php + echo $this->searchform; + if($this->addRight) echo $this->formButton('addrole', 'Add Role', array( 'onclick' => 'self.location="/user/role/add"', - 'class' => 'addbutton'))?> + 'class' => 'addbutton')); + ?> <table> <tr> <th>Title <span class='code'>title</span></th> - <th colspan=3>Actions</th> + <?php + if($this->detailsRight || $this->editRight || $this->deleteRight) { + echo '<th colspan=3>Actions</th>'; + } + ?> </tr> <?php $count = 0; @@ -18,6 +24,8 @@ if($this->userIDsNamespace['groupID']) { <tr <?php if($role['roleID'] == $this->userIDsNamespace['roleID']) echo 'class="selectedEntry"'; else echo 'class="entry"'; ?>> <td><?php echo $role['title'] ?></td> + <?php if($this->detailsRight) { + ?> <td class='action'><a href="<?php echo $this->url( array( @@ -28,6 +36,10 @@ if($this->userIDsNamespace['groupID']) { ), 'default', true) ?>"> <img src='/media/img/show.png' alt='Show Group' /></a></td> + <?php + } + if($this->editRight) { + ?> <td class='action'><a href="<?php echo $this->url( array( @@ -38,6 +50,10 @@ if($this->userIDsNamespace['groupID']) { ), 'default', true) ?>"> <img src='/media/img/edit.png' alt='Edit Group' /></a></td> + <?php + } + if($this->deleteRight) { + ?> <td class='action'><a href="<?php echo $this->url( array( @@ -49,6 +65,9 @@ if($this->userIDsNamespace['groupID']) { 'default', true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a> </td> + <?php + } + ?> </tr> <?php $count++; diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml index 8194353..e91c106 100644 --- a/application/modules/user/views/scripts/role/show.phtml +++ b/application/modules/user/views/scripts/role/show.phtml @@ -9,13 +9,13 @@ if($this->roleID) { <h1>Role Details</h1> <?php } - ?> - <?php echo $this->formButton('deleterole', 'Delete', array( + if($this->deleteRight) echo $this->formButton('deleterole', 'Delete', array( 'onclick' => 'self.location="/user/role/delete/roleID/' . $this->role->getID() .'"', - 'class' => 'rightbutton'))?> - <?php echo $this->formButton('editrole', 'Edit', array( + 'class' => 'rightbutton')); + if($this->editRight) echo $this->formButton('editrole', 'Edit', array( 'onclick' => 'self.location="/user/role/edit/roleID/' . $this->role->getID() .'"', - 'class' => 'rightbutton'))?> + 'class' => 'rightbutton')); + ?> <span class="clear"></span> <table> <tr> @@ -33,7 +33,7 @@ if($this->roleID) { <h2>Rights:</h2> <?php if($this->rightsAvailable === true) { - echo $this->formButton('linkright', 'Add Rights', array( + if($this->addRightToRoleRight) echo $this->formButton('linkright', 'Add Rights', array( 'onclick' => 'self.location="/user/role/linkright/roleID/' . $this->role->getID() .'"', 'class' => 'addbutton'))?> <br /> @@ -51,7 +51,7 @@ if($this->roleID) { <tr> <th>Title</th> <th>Description</th> - <th>Remove</th> + <?php if($this->removeRightOfRoleRight) echo '<th>Remove</th>'; ?> </tr> <?php @@ -60,6 +60,8 @@ if($this->roleID) { <tr class="entry"> <td><?php echo $right->getTitle(); ?></td> <td><?php echo $right->getDescription(); ?></td> + <?php if($this->removeRightOfRoleRight) { + ?> <td class='action'><a href="<?php echo $this->url( array( @@ -71,6 +73,9 @@ if($this->roleID) { 'default', true) ?>"> <img src='/media/img/delete.png' alt='Remove Right' /></a> </td> + <?php + } + ?> </tr> <?php } |
