<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ViewMasterPageMain.Master" Inherits="System.Web.Mvc.ViewPage<MvcEnterprise.Models.DataSet1+ValidationTemplate>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
	<style type="text/css">
		.EditButtons {display:block}
		.Item {border:1px solid #ccc;background:#eee;cursor:move;width:auto}
		.Item:hover {background:#FC6}
		.PlaceHolder {min-height:30px}
		#FloatingPanel {border:1px solid #628D0B;background: #F2F8E6;position:fixed;z-index:9999;top:0;left:0px;width:100%;text-align:left;padding-bottom:5px;_position:absolute;_top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop : document.body.scrollTop);}
		.PanelItem {border:1px solid #87A34D;color:#000;background:#EBF4D8;cursor:move;padding:0 15px;height:36px;line-height:36px;margin:5px 0 0 5px;float:left;white-space:nowrap;}
		.PanelButton {border:1px solid #87A34D;color:#ff0000;background:#EBF4D8;cursor:pointer;padding:0 15px;height:36px;line-height:36px;margin:5px 0 0 5px;float:left;white-space:nowrap;}
		.PanelItem:hover,.PanelButton:hover {color:#fff;background:#9BBB59}
		.droppable-active {background:#FF9;padding:10px}
		.droppable-active-contentholder {background:#FC6;padding:10px}
		.droppable-hover {border:1px dotted red;}
	</style>
	<link href="../../Scripts/flora/flora.dialog.css" rel="stylesheet" type="text/css" />
	<link href="../../Scripts/flora/flora.resizable.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<script src="../../Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>
	<script src="../../Scripts/ui.core.js" type="text/javascript"></script>
	<script src="../../Scripts/ui.draggable.js" type="text/javascript"></script>
	<script src="../../Scripts/ui.droppable.js" type="text/javascript"></script>
	<script src="../../Scripts/ui.sortable.js" type="text/javascript"></script>
	<script src="../../Scripts/ui.dialog.js" type="text/javascript"></script>
	<script src="../../Scripts/ui.resizable.js" type="text/javascript"></script>
	<script src="../../Scripts/x1.js" type="text/javascript"></script>
	<%
		if (Session["QuickImg"]=="on") Session["QuickImg"]="off"; //关闭即时换图
	%>
	<div id="pageloading" style="position: absolute; left: 0; width: 100%; height: 100%;
		background: #eee; text-align: center; padding-top: 10%; z-index: 9999">
		<p>
			<img alt="" src="../../Content/images/loading_32x32.gif" /><br />
			正在加载...</p>
		<br />
		<p>如果长时间没有响应，请刷新页面</p>
	</div>
	<div id="dialog_class" style="text-align: left; display: none">
		<div>
			<span>标题文字:</span>
			<input type="text" id="evalue" /></div>
		<div>
			<span>页面名称:</span>
			<input type="text" id="pgname" />
		</div>
		<div id="divTopN" style="display: none">
			<span>显示数量:</span>
			<input type="text" id="topN" onblur="if (isNaN(this.value)||this.value.replace(/ /g,'')==''){alert('显示数量表示您想显示的记录条数。\n请输入数字。');this.focus()}" maxlength="3" />条
		</div>
		<div>
			<span>选择分类:</span>
			<select id="ACL" onchange='ACLP(this.value)'>
				<option value="Article">新闻分类</option>
				<option value="Product">产品分类</option>
				<option value="Download">下载分类</option>
			</select>
			<span id="SortList"><%= Html.DropDownList("ArticleSort", new SelectList(new CategoryService<DataSet1.ArticleSortRow, DataSet1.ValidationArticleSort>(new ArticleSortService()).CategoryList(0), "SortPath", "SortName"), new { style = "display:none" })%><%= Html.DropDownList("ProductSort", new SelectList(new CategoryService<DataSet1.ProductSortRow, DataSet1.ValidationProductSort>(new ProductSortService()).CategoryList(0), "SortPath", "SortName"), new { style = "display:none" })%><%= Html.DropDownList("DownloadSort", new SelectList(new CategoryService<DataSet1.DownloadSortRow, DataSet1.ValidationDownloadSort>(new DownloadSortService()).CategoryList(0), "SortPath", "SortName"), new { style = "display:none" })%></span>
		</div>
		<div>
			<span>显示方式:</span>
			<select id="ListViewType">
				<option value="OneImgAndList">图文简介+标题</option>
				<option value="Img">图片和标题</option>
				<option value="List">仅标题</option>
			</select>
			<select id="SortViewType">
				<option value="Popup">弹出菜单</option>
				<option value="Tree">折叠树形</option>
			</select>
		</div>
	</div>
	<div id="main">
		<%
			if (Model != null && !string.IsNullOrEmpty(Model.content))
			{
				Response.Write(Model.content);
			}
			else
			{
		%>
		<div class="MainWidth" id="MiddleContainer">
			<div id="left">
				<div class="tr">
					<div class="tl">
						<div class="tm">
						</div>
					</div>
				</div>
				<div class="mr">
					<div class="ml">
					</div>
				</div>
				<div class="br">
					<div class="bl">
						<div class="bm">
						</div>
					</div>
				</div>
			</div>
			<div id="right">
				<div class="tr">
					<div class="tl">
						<div class="tm">
						</div>
					</div>
				</div>
				<div class="mr">
					<div class="ml">
					</div>
				</div>
				<div class="br">
					<div class="bl">
						<div class="bm">
						</div>
					</div>
				</div>
			</div>
		</div>
		<%
			}
		%>
	</div>
	<div id="FloatingPanel">
		<%
		const string ModuleAddString = "<div class='EditButtons' align='right'><button onclick=if(confirm('确定要删除此模块吗?')){RemoveItem(this)}>删除</button></div>";
		var modules = new ModuleService().GetAllvisible();
		var content=string.Empty;
		foreach (var module in modules)
		{
				if (module.type=="system")
				{
					content=module.content;
				}
				else
				{
					content=module.mname + ModuleAddString;
				}
			%>
			<div class="PanelItem" title="<%=Server.HtmlEncode(module.memo)%>" content="<%=content%>"><%=module.mname%></div>
		<%}%>
		<div class="PanelButton" title="点击保存" onclick="CreateTemplate();">保存修改</div>
		<div class="PanelButton" title="重新修改" onclick="if(confirm('未保存的修改将丢失,确认重置?')){location.reload();}">重新修改</div>
	</div>
</asp:Content>