diff options
Diffstat (limited to 'application/modules/user/views')
| -rw-r--r-- | application/modules/user/views/scripts/role/index.phtml | 138 | ||||
| -rw-r--r-- | application/modules/user/views/scripts/role/show.phtml | 10 |
2 files changed, 69 insertions, 79 deletions
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 @@ -<?php -if($this->userIDsNamespace['groupID']) { - ?> + <h1>Roles</h1> <?php echo $this->searchform; @@ -9,82 +7,74 @@ if($this->userIDsNamespace['groupID']) { 'class' => 'addbutton')); ?> <div class='searchvars'> -<div class='head'>Available searchfilter:</div> -<div class='code'>title</div> -<div class='code'>description</div> + <div class='head'>Available searchfilter:</div> + <div class='code'>title</div> + <div class='code'>description</div> </div> -<div class='listelement'><?php -if(count($this->roleList)==0) -echo "There are no roles" ?> <?php foreach($this->roleList as $k => $role): ?> -<?php -$class=''; -if($role['roleID'] == $this->userIDsNamespace['roleID']) -$class= 'highlight checked'; -?> - <div class='element<?php echo " $class";?>'> - <?php if($role['roleID'] != $this->userIDsNamespace['roleID']) { ?> - <div class='number'> - <div class='smallnumber'>Role</div> - <?php echo $role['roleID']; ?> - </div> +<div class='listelement'> +<?php if(count($this->roleList)==0) + echo "There are no roles" ?> +<?php foreach($this->roleList as $i => $grouproleList): ?> + <?php foreach($grouproleList as $k => $role): ?> <?php - } - ?> - <div class='content'> - <div class='actions'><?php if($this->detailsRight) {?> - <a href="<?php echo $this->url( - array( - 'module' => 'user', - 'controller' => 'role', - 'action' => 'show', - 'roleID' => $role['roleID'] - ), - 'default', - true) ?>"> <img src='/media/img/show.png' alt='Show Group' /></a> <?php - } - if($this->editRight) { ?> - <a href="<?php echo $this->url( - array( - 'module' => 'user', - 'controller' => 'role', - 'action' => 'edit', - 'roleID' => $role['roleID'] - ), - 'default', - true) ?>"> <img src='/media/img/edit.png' alt='Edit Group' /></a> <?php - } -if($this->deleteRight) { ?> - <a href="<?php echo $this->url( - array( - 'module' => 'user', - 'controller' => 'role', - 'action' => 'delete', - 'roleID' => $role['roleID'] - ), - 'default', - true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a> - -<?php } ?> -</div> -<div class='title'><?php echo $role['title'] ?></div> - <?php if($role['description']) { - ?> -<div class='subtitle'><?php echo $role['description']; ?></div> - <?php - } else { - ?> -<div class='subtitle'> </div> - <?php - } + $class=''; + if($role->getID() == $this->membership->getRoleID()) + $class= 'highlight checked'; + ?> + <div class='element<?php echo " $class";?>'> + <?php if($role->getID() != $this->userIDsNamespace['roleID']) { ?> + <div class='number'> + <div class='smallnumber'>Role</div> + <?php echo $role->getID(); ?> + </div> + <?php + } + ?> + <div class='content'> + <div class='actions'><?php if($this->detailsRight) {?> + <a href="<?php echo $this->url( + array( + 'module' => 'user', + 'controller' => 'role', + 'action' => 'show', + 'roleID' => $role->getID() + ), + 'default', + true) ?>"> <img src='/media/img/show.png' alt='Show Group' /></a> <?php + } + if($this->editRight && $this->membership->getGroupID() == $role->getGroupID()) { ?> + <a href="<?php echo $this->url( + array( + 'module' => 'user', + 'controller' => 'role', + 'action' => 'edit', + 'roleID' => $role->getID() + ), + 'default', + true) ?>"> <img src='/media/img/edit.png' alt='Edit Group' /></a> <?php + } + if($this->deleteRight && $this->membership->getGroupID() == $role->getGroupID()) { ?> + <a href="<?php echo $this->url( + array( + 'module' => 'user', + 'controller' => 'role', + 'action' => 'delete', + 'roleID' => $role->getID() + ), + 'default', + true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a> -?></div> -<div class='clear'></div> + <?php } ?> + </div> + <div class='title'><?php echo "[".$i."] ";?><?php echo $role->getTitle();?></div> + <div class='subtitle'><?php echo $role->getDescription(); ?> </div></div> + <div class='clear'></div> + </div> + <?php endforeach ?> +<?php endforeach ?> </div> -<?php endforeach ?></div> -<?php echo $this->pagination; -} -?> +<?php echo $this->pagination; ?> <br /> <br /> 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) { <h1>Role Details</h1> <?php } - if($this->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) { <h2>Rights:</h2> <?php if($this->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'));?> <br /> @@ -63,7 +63,7 @@ if(count($this->rightsList)==0) { foreach($rights as $right): ?> <div class='element'> -<div class='content'><?php if($this->removeRightOfRoleRight) { +<div class='content'><?php if($this->removeRightOfRoleRight && $this->roleID == $this->userIDsNamespace['roleID']) { ?> <div class='actions'><a href="<?php echo $this->url( |
