Commit 04f11a8eab4a6ff71bf858a572a9e19e45b319ba
1 parent
13d4757c
Templates for permission management
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3505 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
202 additions
and
0 deletions
templates/ktcore/manage_folder_permissions.smarty
0 → 100644
| 1 | +{literal} | ||
| 2 | +<style> | ||
| 3 | +td.true { background-color: #aaffaa; text-align: centre } | ||
| 4 | +td.false { background-color: #ffaaaa; text-align: centre } | ||
| 5 | +.edit { display: none; } | ||
| 6 | +.view { display: block; } | ||
| 7 | + | ||
| 8 | +.tablebutton { | ||
| 9 | + margin: 0em; | ||
| 10 | + margin-right: 1em; | ||
| 11 | + border: 1px solid #cccccc; | ||
| 12 | +} | ||
| 13 | +.activebutton { | ||
| 14 | + background-color: #eeeeff; | ||
| 15 | +} | ||
| 16 | +.inactivebutton { | ||
| 17 | + background-color: #ffeeee; | ||
| 18 | +} | ||
| 19 | +</style> | ||
| 20 | +{/literal} | ||
| 21 | +<script language="javascript" src="/thirdpartyjs/MochiKit/Base.js"> | ||
| 22 | +<script language="javascript" src="/thirdpartyjs/MochiKit/Iter.js"> | ||
| 23 | +<script language="javascript" src="/thirdpartyjs/MochiKit/DOM.js"> | ||
| 24 | +<h2>Folder permissions</h2> | ||
| 25 | + | ||
| 26 | +{ if $edit } | ||
| 27 | +<div style="text-align: right"> | ||
| 28 | +<span class="tablebutton activebutton"> | ||
| 29 | +<a href="javascript:MochiKit.DOM.showElement('view'); MochiKit.DOM.hideElement('edit');">View</a> | ||
| 30 | +</span> | ||
| 31 | +<span class="tablebutton inactivebutton"> | ||
| 32 | +<a href="javascript:MochiKit.DOM.showElement('edit'); MochiKit.DOM.hideElement('view');">Edit</a> | ||
| 33 | +</span> | ||
| 34 | +</div> | ||
| 35 | +{ /if } | ||
| 36 | +<div class="view" id="view"> | ||
| 37 | +<table class="pretty" cellspacing="0" cellpadding="0" border="0" width="100%"> | ||
| 38 | +<thead> | ||
| 39 | +<tr> | ||
| 40 | +<th>Group</th> | ||
| 41 | +{ foreach item=oPerm from=$permissions } | ||
| 42 | +<th title="{$oPerm->sName}">{$oPerm->sHumanName}</th> | ||
| 43 | +{ /foreach } | ||
| 44 | +</tr> | ||
| 45 | +</thead> | ||
| 46 | +<tbody> | ||
| 47 | +{ foreach item=oGroup from=$groups } | ||
| 48 | +<td>{$oGroup->getID()} / {$oGroup->getName()}</td> | ||
| 49 | + { assign var=iGroupID value=$oGroup->getID() } | ||
| 50 | + { foreach item=oPerm from=$permissions } | ||
| 51 | + { assign var=iPermID value=$oPerm->getID() } | ||
| 52 | + { assign var=bHasPerm value=$aMapPermissionGroup[$iPermID][$iGroupID] } | ||
| 53 | +{ if $bHasPerm } | ||
| 54 | +<td class="true">True</td> | ||
| 55 | +{ else } | ||
| 56 | +<td class="false">False</td> | ||
| 57 | +{ /if } | ||
| 58 | + { /foreach } | ||
| 59 | +</tr> | ||
| 60 | +{ /foreach } | ||
| 61 | +</tbody> | ||
| 62 | +</table> | ||
| 63 | + | ||
| 64 | +<div style="text-align: center; padding-top: 2px"> | ||
| 65 | +<span style="border: 1px solid #cccccc; background-color: #ffeeee; | ||
| 66 | +padding: 2px; padding-right: 1em; padding-left: 1em"> | ||
| 67 | +{ if $inherited } | ||
| 68 | +Inherited from {$inherited} | ||
| 69 | +[<a | ||
| 70 | +href="{$smarty.server.PHP_SELF}?action=copyPermissions&fFolderID={$iFolderID}">Copy</a>] | ||
| 71 | +{ else } | ||
| 72 | +[<a | ||
| 73 | +href="{$smarty.server.PHP_SELF}?action=inheritPermissions&fFolderID={$iFolderID}">Use | ||
| 74 | +parent's permissions</a>] | ||
| 75 | +{ /if } | ||
| 76 | +</span> | ||
| 77 | +</div> | ||
| 78 | +</div> | ||
| 79 | + | ||
| 80 | +{ if $edit } | ||
| 81 | +<div class="edit" id="edit"> | ||
| 82 | +<form method="POST"> | ||
| 83 | +<input type="hidden" name="action" value="update"> | ||
| 84 | +<input type="hidden" name="fFolderID" value="{$iFolderID}"> | ||
| 85 | +<table class="pretty" cellspacing="0" cellpadding="0" border="0" width="100%"> | ||
| 86 | +<thead> | ||
| 87 | +<tr> | ||
| 88 | +<th>Group</th> | ||
| 89 | +{ foreach item=oPerm from=$permissions } | ||
| 90 | +<th title="{$oPerm->sName}">{$oPerm->sHumanName}</th> | ||
| 91 | +{ /foreach } | ||
| 92 | +</tr> | ||
| 93 | +</thead> | ||
| 94 | +<tbody> | ||
| 95 | +{ foreach item=oGroup from=$groups } | ||
| 96 | +<td>{$oGroup->getID()} / {$oGroup->getName()}</td> | ||
| 97 | + { assign var=iGroupID value=$oGroup->getID() } | ||
| 98 | + { foreach item=oPerm from=$permissions } | ||
| 99 | + { assign var=iPermID value=$oPerm->getID() } | ||
| 100 | + { assign var=bHasPerm value=$aMapPermissionGroup[$iPermID][$iGroupID] } | ||
| 101 | +{ if $bHasPerm } | ||
| 102 | +<td class="true"><input type="checkbox" name="foo[{$iPermID}][group][]" | ||
| 103 | +value="{$iGroupID}" checked="true"></td> | ||
| 104 | +{ else } | ||
| 105 | +<td class="false"><input type="checkbox" name="foo[{$iPermID}][group][]" | ||
| 106 | +value="{$iGroupID}"></td> | ||
| 107 | +{ /if } | ||
| 108 | + { /foreach } | ||
| 109 | +</tr> | ||
| 110 | +{ /foreach } | ||
| 111 | +</tbody> | ||
| 112 | +</table> | ||
| 113 | + | ||
| 114 | +<input type="submit" name="submit" value="Update"> | ||
| 115 | +</form> | ||
| 116 | +</div> | ||
| 117 | +{ /if } | ||
| 118 | + | ||
| 119 | +<h2>User permissions</h2> | ||
| 120 | + | ||
| 121 | +<div> | ||
| 122 | +<table class="pretty" cellspacing="0" cellpadding="0" border="0" width="100%"> | ||
| 123 | +<thead> | ||
| 124 | +<tr> | ||
| 125 | +<th>User</th> | ||
| 126 | +{ foreach item=oPerm from=$permissions } | ||
| 127 | +<th title="{$oPerm->sName}">{$oPerm->sHumanName}</th> | ||
| 128 | +{ /foreach } | ||
| 129 | +</tr> | ||
| 130 | +</thead> | ||
| 131 | +<tbody> | ||
| 132 | +{ foreach item=oUser from=$users } | ||
| 133 | +<td>{$oUser->getID()} / {$oUser->getName()}</td> | ||
| 134 | + { assign var=iUserID value=$oUser->getID() } | ||
| 135 | + { foreach item=oPerm from=$permissions } | ||
| 136 | + { assign var=iPermID value=$oPerm->getID() } | ||
| 137 | + { assign var=bHasPerm value=$aMapPermissionUser[$iPermID][$iUserID] } | ||
| 138 | +{ if $bHasPerm } | ||
| 139 | +<td class="true">True</td> | ||
| 140 | +{ else } | ||
| 141 | +<td class="false">False</td> | ||
| 142 | +{ /if } | ||
| 143 | + { /foreach } | ||
| 144 | +</tr> | ||
| 145 | +{ /foreach } | ||
| 146 | +</tbody> | ||
| 147 | +</table> | ||
| 148 | +</div> |
templates/ktcore/manage_permissions.smarty
0 → 100644
| 1 | +<h2>Existing permissions</h2> | ||
| 2 | +<table class="pretty" cellspacing="0" cellpadding="0" border="0"> | ||
| 3 | +<thead> | ||
| 4 | +<tr> | ||
| 5 | +<th>Permission</th> | ||
| 6 | +<th>Human Name</th> | ||
| 7 | +<th colspan="2">Manage</th> | ||
| 8 | +</tr> | ||
| 9 | +</thead> | ||
| 10 | +{ foreach item=oPerm from=$permissions } | ||
| 11 | +<tr class="{cycle values="odd,even"}"> | ||
| 12 | +<td> | ||
| 13 | +{ $oPerm->sName } | ||
| 14 | +</td> | ||
| 15 | +<td> | ||
| 16 | +{ $oPerm->sHumanName } | ||
| 17 | +</td> | ||
| 18 | +{ if $oPerm->bBuiltIn == true } | ||
| 19 | +<td colspan="2"> | ||
| 20 | +Built-in | ||
| 21 | +</td> | ||
| 22 | +{ else } | ||
| 23 | +<td> | ||
| 24 | +Edit | ||
| 25 | +</td> | ||
| 26 | +<td> | ||
| 27 | +<a | ||
| 28 | +href="{$smarty.server.PHP_SELF}?action=deletePermission&id={$oPerm->getId()}">Delete</a> | ||
| 29 | +</td> | ||
| 30 | +{ /if } | ||
| 31 | +</tr> | ||
| 32 | +{ /foreach } | ||
| 33 | +</table> | ||
| 34 | + | ||
| 35 | +<h2>Create a new permission</h2> | ||
| 36 | + | ||
| 37 | +<form> | ||
| 38 | +<input type="hidden" name="action" value="newPermission"> | ||
| 39 | +<table> | ||
| 40 | +<tr> | ||
| 41 | +<td>Name:</td> | ||
| 42 | +<td><input type="text" name="name" value="custom."></td> | ||
| 43 | +</tr> | ||
| 44 | +<tr> | ||
| 45 | +<td>Human name:</td> | ||
| 46 | +<td><input type="text" name="human_name" value="Custom: "></td> | ||
| 47 | +</tr> | ||
| 48 | +<tr> | ||
| 49 | +<td colspan="2" align="right"> | ||
| 50 | +<input type="submit" name="submit" value="Create"> | ||
| 51 | +</td> | ||
| 52 | +</tr> | ||
| 53 | +</table> | ||
| 54 | +</form> |