<%@ Page language="c#" Codebehind="share.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.share" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<% @ Import Namespace="Webdisk" %>
		<link href="<%=xml.GetStyle()%>" rel="stylesheet" type="text/css">
			<script language="javascript">
function getRbGroupValue(rbGroup)
{
	for(var i=0;i<rbGroup.length;i++)
	{
		if(rbGroup[i].checked)	return rbGroup[i].value;
	}
	return false;
}
function shareuser(url)
{
window.open(url,'','scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no,width=1000,height=500');
}
function Result() 
{ 
    var kind=document.getElementById("kind1");
	if (kind.value=='不指定')
	{
		document.all("kind2").length=0;
　　　　document.all("kind2").options.add(new Option('不指定','不指定'));
	}
	else Webdisk.share.GetKind2All(kind.value,get_Result_CallBack);
}

function get_Result_CallBack(response)
{
    if (response.value != null)
    {
        document.all("kind2").length=0;　　　　            
　　　　var ds = response.value;
        if(ds != null && typeof(ds) == "object" && ds.Tables != null)
        {                    
            for(var i=0; i<ds.Tables[0].Rows.length; i++)
　　　　    {
　　　　        var name=ds.Tables[0].Rows[i].rootkind1;
　　　　　　    var id=ds.Tables[0].Rows[i].rootkind3;
　　　　　　    document.all("kind2").options.add(new Option(name,id));
　　　　    }
			if (document.all("kind2").options.length==0) document.all("kind2").options.add(new Option("不指定","0"));
			document.all.hidkind.value=document.all.kind2.value;
        }
    }                
    return
}
function EditOpt()
{
	Webdisk.share.EditOpt(document.all.overshare.checked);
}
			</script>
	</HEAD>
	<body topmargin="0">
		<form id="Form1" method="post" runat="server">
			<FONT face="宋体"></FONT><FONT face="宋体"></FONT>
			<br>
			<TABLE cellSpacing="0" cellPadding="0" width="98%" align="center">
				<TR>
					<TD width="5" background="pics/wenbenkuan_02.gif"><IMG height="5" src="pics/wenbenkuan_01.gif" width="5"></TD>
					<TD width="874" background="pics/wenbenkuan_02.gif"><IMG height="5" src="pics/wenbenkuan_02.gif" width="5"></TD>
					<TD><IMG height="5" src="pics/wenbenkuan_03.gif" width="5"></TD>
				</TR>
				<TR>
					<TD background="pics/wenbenkuan_04.gif">&nbsp;</TD>
					<TD class="tablebg" background="pics/wenbenkuan_05.gif"><TABLE width="100%">
							<TR>
								<TD width="100%" class="tabletop"><img src="pics/filesys.gif" width="18" height="18" align="absMiddle">
									目录和文件共享&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1);"><img src="pics/link_back.gif" border="0" align="absMiddle"></a></TD>
							</TR>
							<TR class="tablebg">
								<TD><table width="100%" border="0">
										<tr>
											<td>以下是您共享的目录和文件：</td>
											<td align="right"><INPUT id="overshare" type="checkbox" CHECKED name="overshare" runat="server" onChange="EditOpt();">
												<label for="overshare">
													<font color="#0000ff">覆盖子目录及文件的共享设置</font></label></td>
										</tr>
										<tr>
											<td colspan="2"><asp:label id="Label1" runat="server"></asp:label></td>
										</tr>
									</table>
									<table width="100%" border="0">
										<tr>
											<td width="100%">请指定共享权限：</td>
										</tr>
										<tr>
											<td>
												<input name="shareopt" type="radio" id="click0" onClick="javascript:document.all.Panel1.style.display='none';document.all.Panel2.style.display='none';document.all.Panel3.style.display='none';document.all.Panel5.style.display='none';"
													value="0" checked runat="server">
												<LABEL for="click0">不共享</LABEL>
												<input id="click1" type="radio" name="shareopt" value="1" onClick="javascript:document.all.Panel1.style.display='';document.all.Panel2.style.display='none';document.all.Panel3.style.display='';document.all.Panel5.style.display='';"
													runat="server">
												<LABEL for="click1">共享给好友</LABEL>
												<input id="click2" type="radio" name="shareopt" value="2" onClick="javascript:document.all.Panel1.style.display='';document.all.Panel2.style.display='none';document.all.Panel3.style.display='';document.all.Panel5.style.display='none';"
													runat="server">
												<LABEL for="click2">所有人可见</LABEL>
												<input id="click3" type="radio" name="shareopt" value="3" onClick="javascript:document.all.Panel1.style.display='none';document.all.Panel2.style.display='';document.all.Panel3.style.display='';document.all.Panel5.style.display='none';"
													runat="server">
												<LABEL for="click3">指定人可见</LABEL></td>
										</tr>
									</table>
									<TABLE width="100%" border="0" id="Panel3" runat="server" style="DISPLAY:none">
										<TR>
											<TD width="100%" height="14">共享大类：
												<select id="kind1" onchange="Result();" name="kind1" runat="server">
												</select>
												共享小类：
												<select id="kind2" name="kind2" runat="server" onChange="document.all.hidkind.value=this.value">
													<option value="不指定" selected>不指定</option>
												</select>
												<INPUT id="hidkind" style="WIDTH: 13px; HEIGHT: 22px" type="hidden" size="1" name="hidkind"
													runat="server">
											</TD>
										</TR>
										<TR>
											<TD width="100%">可设定文件夹查看密码(对文件无效)： <INPUT class="kuan" id="TextBox3" type="text" size="15" name="TextBox3" runat="server"></TD>
										</TR>
									</TABLE>
									<TABLE width="100%" border="0" id="Panel1" runat="server" style="DISPLAY:none">
										<TR>
											<TD width="49%">指定特殊权限：<asp:CheckBox id="CheckBox3" runat="server" Text="可添加"></asp:CheckBox>
												<asp:CheckBox id="CheckBox4" runat="server" Text="可修改（覆盖）"></asp:CheckBox>
												<asp:CheckBox id="CheckBox5" runat="server" Text="可删除"></asp:CheckBox></TD>
										</TR>
									</TABLE>
									<TABLE width="100%" border="0" id="Panel5" runat="server" style="DISPLAY:none">
										<TR>
											<TD width="100%">可以指定共享给某组好友：<asp:CheckBoxList id="friendteam" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"></asp:CheckBoxList></TD>
										</TR>
									</TABLE>
									<TABLE id="Panel2" runat="server" width="100%" border="0" style="DISPLAY:none">
										<TR>
											<TD width="33%">以下是有列表权限的用户：</TD>
											<TD width="33%">以下是有添加权限的用户：</TD>
											<TD width="33%">以下是有修改权限的用户：</TD>
										</TR>
										<TR>
											<TD>
												<asp:listbox id="ListBox1" runat="server" Width="190px"></asp:listbox><BR>
												<BR>
												<INPUT class="btn" id="Button5" onClick="javascript:shareuser('search_user.aspx?addtype=1');"
													type="button" value="添加" name="Button5"> &nbsp;&nbsp; <INPUT class="btn" id="Button6" type="button" value="移除" name="Button6" runat="server" onserverclick="Button6_ServerClick">
												&nbsp;&nbsp;&nbsp; <INPUT class="btn" id="Button11" onClick="javascript:if (document.all.ListBox1.value!='') shareuser('userinfo.aspx?username='+document.all.ListBox1.value);"
													type="button" value="用户信息" name="Button11">
											</TD>
											<TD vAlign="top">
												<asp:listbox id="ListBox2" runat="server" Width="190px"></asp:listbox><BR>
												<BR>
												<INPUT class="btn" id="Button7" onClick="javascript:shareuser('search_user.aspx?addtype=2');"
													type="button" value="添加" name="Button7">&nbsp;&nbsp; <INPUT class="btn" id="Button8" type="button" value="移除" name="Button8" runat="server" onserverclick="Button8_ServerClick">&nbsp;
												<INPUT class="btn" id="Button12" onClick="javascript:if (document.all.ListBox2.value!='') shareuser('userinfo.aspx?username='+document.all.ListBox2.value);"
													type="button" value="用户信息" name="Button12"></FONT></TD>
											<TD vAlign="top"><asp:ListBox ID="ListBox3" runat="server" Width="190px"></asp:ListBox>
												<br>
												<br>
												<input class="btn" id="Button1" onClick="javascript:shareuser('search_user.aspx?addtype=3');"
													type="button" value="添加" name="Button1"> &nbsp;&nbsp; <input class="btn" id="Button2" type="button" value="移除" name="Button2" runat="server" onserverclick="Button2_ServerClick">
												&nbsp;&nbsp;&nbsp; <input class="btn" id="Button13" onClick="javascript:if (document.all.ListBox3.value!='') shareuser('userinfo.aspx?username='+document.all.ListBox3.value);"
													type="button" value="用户信息" name="Button13"></TD>
										</TR>
										<TR>
											<TD>以下是有删除权限的用户：</TD>
											<TD colspan="2" vAlign="top">以下是有下载权限的用户：</TD>
										</TR>
										<TR>
											<TD><asp:ListBox ID="ListBox4" runat="server" Width="190px"></asp:ListBox>
												<br>
												<br>
												<input class="btn" id="Button10" onClick="javascript:shareuser('search_user.aspx?addtype=4');"
													type="button" value="添加" name="Button10"> &nbsp;&nbsp; <input class="btn" id="Button4" type="button" value="移除" name="Button4" runat="server" onserverclick="Button4_ServerClick">
												&nbsp; <input class="btn" id="Button14" onClick="javascript:if (document.all.ListBox4.value!='') shareuser('userinfo.aspx?username='+document.all.ListBox4.value);"
													type="button" value="用户信息" name="Button14"></TD>
											<TD colspan="2" vAlign="top"><asp:ListBox ID="ListBox5" runat="server" Width="190px"></asp:ListBox>
												<br>
												<br>
												<input class="btn" id="Button9" onClick="javascript:shareuser('search_user.aspx?addtype=5');"
													type="button" value="添加" name="Button9"> &nbsp;&nbsp; <input class="btn" id="Button15" type="button" value="移除" name="Button9" runat="server" onserverclick="Button15_ServerClick">
												&nbsp; <input class="btn" id="Button16" onClick="javascript:if (document.all.ListBox5.value!='') shareuser('userinfo.aspx?username='+document.all.ListBox5.value);"
													type="button" value="用户信息" name="Button9"></TD>
										</TR>
									</TABLE>
									<br>
									<div align="center">
										<INPUT class="btn" id="Button3" type="button" value="完成设置" name="Button3" runat="server" onserverclick="Button3_ServerClick">
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input class="btn" onClick="javascript:history.go(-1);" type="button" value="返回前页" name="Submit">
										<INPUT id="Hidden1" type="hidden" name="Hidden1" runat="server" style="WIDTH: 23px; HEIGHT: 22px"
											size="1"> <INPUT id="type" style="WIDTH: 24px; HEIGHT: 22px" type="hidden" size="1" name="type" runat="server">
									</div>
								</TD>
							</TR>
						</TABLE>
					</TD>
					<TD width="5" background="pics/wenbenkuan_06.gif"><IMG height="5" src="pics/wenbenkuan_06.gif" width="5"></TD>
				</TR>
				<TR>
					<TD background="pics/wenbenkuan_08.gif"><IMG height="5" src="pics/wenbenkuan_07.gif" width="5"></TD>
					<TD background="pics/wenbenkuan_08.gif"><IMG height="5" src="pics/wenbenkuan_08.gif" width="5"></TD>
					<TD><IMG height="5" src="pics/wenbenkuan_09.gif" width="5"></TD>
				</TR>
			</TABLE>
			<P></P>
		</form>
		<script>
	if (getRbGroupValue(document.all.shareopt)=="1")
	{
		javascript:document.all.Panel1.style.display='';document.all.Panel2.style.display='none';document.all.Panel3.style.display='';document.all.Panel5.style.display='';
	}
	else if (getRbGroupValue(document.all.shareopt)=="2")
	{
		javascript:document.all.Panel1.style.display='';document.all.Panel2.style.display='none';document.all.Panel3.style.display='';document.all.Panel5.style.display='none';
	}
	else if (getRbGroupValue(document.all.shareopt)=="3")
	{
		javascript:document.all.Panel1.style.display='none';document.all.Panel2.style.display='';document.all.Panel3.style.display='';document.all.Panel5.style.display='none';
	}
		</script>
	</body>
</HTML>
