<!-- manage permissions template -->
<script type="text/javascript" src="{$template}/scripts/js/functions.permissions.js"></script>
<script type="text/javascript" src="{$template}/scripts/js/jquery.crypt.js"></script>
<script type="text/javascript">
{$jsonPermissions}
{$jsonGroups}
{$jsonUsers}
var $j = jQuery.noConflict();
var template = '{$template}';
$j(document).ready(function(){
var loading = '<img src="{$templates}/images/loading.gif" width="20" height="20" alt="Loading content..." title="Loading content..." />';
$j('.sub-form').live('submit', function(){
$j('#tabsConfig .ui-tabs-panel:visible').html(loading);
$j.ajax({
data: $j(this).serialize(),
type: $j(this).attr('method'),
url: $j(this).attr('action'),
success: function(response) {
$j('#tabsConfig .ui-tabs-panel:visible').html(response);
}
});
return false;
});
$j("#autoPermissions").autocomplete(permissions, {
minChars: 0,
width: 550,
max: 40,
matchContains: "word",
autoFill: true,
callBack: queryPermissions,
formatItem: function(row, i, max) {
return i + "/" + max + ": " + row.txtObjectName + " :: " + row.txtObjectID + " :: " + row.txtObjectOwner;
},
formatMatch: function(row, i, max) {
return row.txtObjectName + " :: " + row.txtObjectID + " :: " + row.txtObjectOwner;
},
formatResult: function(row) {
return row.txtObjectName + " :: " + row.txtObjectID + " :: " + row.txtObjectOwner;
}
});
});
</script>
<form action="{$URL}" method="post" class="sub-form" id="permissions">
<fieldset>
<legend>Manage object permissions
<a href="javascript:popUp('help/help.html','800','800')" title="Need help?"><img src="{$template}/images/icons/icon-info.png" alt="{$TITLE} Help"></a>
</legend>
{$error}
<div title="Search existing objects">
Existing permissions objects
<input type="text" id="autoPermissions" title="Search existing permissions objects?" style="width: 30%" value="Search permissions objects?" onclick="this.value=''" onblur="if(this.value==''){this.value='Search permissions objects?'}">
<a href="formAdvPermissionsSearch.php" class="windowSearchPermissions" id="windowSearchPermissions" title="Search existing permissions objects?" onclick="Modalbox.show(this.href, {title: this.title, width: 800}); return false;"><img src="{$template}/images/icons/icon-search.png" title="Search existing permissions objects?" alt="Search existing permissions objects?"></a><hr />
</div>
<div>
<table border="0" width="100%" cellspacing="5">
<tr align="left">
<td class="txt" nowrap title="Object name" nowrap><b>Name:</b></td>
<td><input type="text" name="txtObjectName" id="txtObjectName" value="{$txtObjectName}" style="width: 100%" onchange="$j('#txtObjectID').val($j('#txtObjectName').crypt({method:'md5'}));"></td>
<td class="copywrite">{$txtObjectNameErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Object owner" nowrap><b>Owner:</b></td>
<td><input type="text" name="txtObjectOwner" id="txtObjectOwner" value="{$txtObjectOwner}" style="width: 100%"></td>
<td class="copywrite">{$txtObjectOwnerErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Object resource id" nowrap><b>Resource ID:</b></td>
<td><input type="text" name="txtObjectID" id="txtObjectID" value="{$txtObjectID}" style="width: 100%"></td>
<td class="copywrite">{$txtObjectIDErr}</td>
</tr>
<tr>
<td colspan="3">
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr align="center">
<td title="Add new group?" align="left" width="25"><a href="#" onclick="javascript:addEmptyGroupRow('gperms',document.getElementById('gperms').rows.length,'Group',groups,template)" title="Add new group?"><img src="{$template}/images/icons/icon-add.png" alt="Add new group?" title="Add new group?"></a></td>
<td title="Group name" width="30%"><strong>Group</strong></td>
<td title="Read permissions"><strong>Read permissions</strong></td>
<td title="Write permissions"><strong>Write permissions</strong></td>
<td> </td>
</tr>
<tr>
<td colspan="7">
<table border="0" width="100%" class="auth-form txt" id="gperms">
<!-- dynamic group objects -->
{$groups}
</table>
</td>
<tr>
</table>
</td>
</tr>
<tr>
<td colspan="3">
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr align="center">
<td title="Add new user?" align="left" width="25"><a href="#" onclick="javascript:addEmptyUserRow('uperms',document.getElementById('uperms').rows.length,'User',users,template)" title="Add new user?"><img src="{$template}/images/icons/icon-add.png" alt="Add new user?" title="Add new user?"></a></td>
<td title="user name" width="30%"><strong>User</strong></td>
<td title="Read permissions"><strong>Read permissions</strong></td>
<td title="Write permissions"><strong>Write permissions</strong></td>
<td> </td>
</tr>
<tr>
<td colspan="7">
<table border="0" width="100%" class="auth-form txt" id="uperms">
<!-- dynamic user objects -->
{$users}
</table>
</td>
<tr>
</table>
</td>
</tr>
</table>
</div>
<div align="center">
<input type="hidden" id="cmd" name="cmd" />
<input type="submit" id="myForm" name="addObject" title="Add new object" value="Add new object" onclick="$j('#cmd').val($j(this).attr('name'))" />
<input type="submit" id="myForm" name="editObject" title="Edit object" value="Edit object" onclick="$j('#cmd').val($j(this).attr('name'))" />
<input type="submit" id="myForm" name="delObject" title="Delete object" value="Delete object" onclick="$j('#cmd').val($j(this).attr('name'))" />
</div>
</fieldset>
</form>
<!-- end manage permissions template -->