<%@ Control Language="c#" AutoEventWireup="false" Codebehind="FolderPermissionListControl.ascx.cs" Inherits="CommunityServer.ControlPanel.FileAdmin.FolderPermissionListControl" 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" %>
<script type="text/javascript">
  function refreshGrid()
  {
    <%= Grid1.ClientID %>.Render(); 
  }
  
  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 style="OVERFLOW-Y:scroll;OVERFLOW-X:hidden;HEIGHT:240px"-->
	<div id="GrayGrid">
		<CA:grid id="Grid1" runat="server" ScrollPopupClientTemplateId="ScrollPopupTemplate">
			<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>
			<CA:ClientTemplate Id="ScrollPopupTemplate">
				<table cellspacing="0" cellpadding="2" border="0" class="ScrollPopup">
				<tr>
					<td><div style="font-size:10px;font-family: MS Sans Serif;text-overflow:ellipsis;overflow:hidden;width:130px;"><nobr>## DataItem.GetMember("Name").Value ##</nobr></div></td>
				</tr>
				</table>
			</CA:ClientTemplate>
			</clienttemplates>
		</CA:grid>
	</div>
<!--/div-->
