<%@ Control Language="c#" AutoEventWireup="false" Codebehind="DefaultPermissionListControl.ascx.cs" Inherits="CommunityServer.ControlPanel.FileAdmin.DefaultPermissionListControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<%@ Register TagPrefix="CA" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="CP" Namespace="CommunityServer.ControlPanel.Controls" Assembly="CommunityServer.Web" %>
<script type="text/javascript">
  
  function onCallbackError(excString)
  {
    if (confirm('<%= CommunityServer.ControlPanel.Components.ResourceManager.GetString("CP_CallBackWarning") %>')) alert(excString); 
    <%= Grid1.ClientID %>.Page(1); 
  }

  function onReset(item)
  {
     return confirm('<%= string.Format(CommunityServer.ControlPanel.Components.ResourceManager.GetString("CP_FilesAdmin_DefaultPermissionsList_ResetPermission_Warning"), "'+ item.GetMember('Name').Value +'") %>'); 
  }
  
  function resetRow(rowId)
  {
    <%= Grid1.ClientID %>.Delete(<%= Grid1.ClientID %>.GetRowFromClientId(rowId)); 
  }

</script>
<div id="GrayGrid">
	<CA:grid id="Grid1" runat="server">
	<Levels>
		<CA:gridlevel datakeyfield="RoleIDString">
			<Columns>
				<CA:gridcolumn AllowEditing="False" datafield="Name" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_Name" />
				<CA:gridcolumn columntype="CheckBox" datafield="View" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_View" align="Center" AllowEditing="True" />
				<CA:gridcolumn columntype="CheckBox" datafield="Download" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_Download" align="Center" AllowEditing="True" />
				<CA:gridcolumn columntype="CheckBox" datafield="Vote" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_Vote" align="Center" AllowEditing="True" />
				<CA:gridcolumn columntype="CheckBox" datafield="Reply" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_Reply" align="Center" AllowEditing="True" />
				<CA:gridcolumn columntype="CheckBox" datafield="Post" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_Post" align="Center" AllowEditing="True" />
				<CA:gridcolumn columntype="CheckBox" datafield="LocalAttachment" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_LocalAttachment" align="Center" AllowEditing="True" />
				<CA:gridcolumn columntype="CheckBox" datafield="RemoteAttachment" headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_RemoteAttachment" align="Center" AllowEditing="True"  />
				<CA:gridcolumn datafield="RoleIDString" visible="False" />
				<CA:gridcolumn headingtext="ResourceManager.CP_FilesAdmin_PermissionsGrid_Actions" datacellclienttemplateid="EditTemplate"
						editcontroltype="EditCommand" width="80" align="Center" Visible="False" />
			</Columns>
		</CA:gridlevel>
	</Levels>
	<clienttemplates>
		<CA:clienttemplate id="EditTemplate">
			<a href="javascript:resetRow('## DataItem.ClientId ##');">Reset</a>
		</CA:clienttemplate>
	</clienttemplates>
	</CA:grid>
</div>
<p style="FLOAT:right">
	<br>
	<cp:ResourceLinkButton id="SaveButton" runat="Server" CssClass="CommonTextButton" ResourceName="Save"></cp:ResourceLinkButton>
</p>
<p>
	<cp:ResourceLinkButton id="resetPermissions" runat="Server"  Visible="False" CssClass="CommonTextButton" ResourceName="CP_FilesAdmin_DefaultPermissionsList_ResetPermissions"></cp:ResourceLinkButton>&nbsp;
</p>
