<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Admin/AdminMain.Master" Inherits="System.Web.Mvc.ViewPage<MvcEnterprise.Models.DataSet1+ModuleRow>" %>

<asp:Content ID="Content0" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/Admin.js" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Content/fckeditor/fckeditor.js")%>" type="text/javascript"></script>
    <%Html.EnableClientValidation(); %>
	<script type="text/javascript">
		function changeCodeView() {
			$("#codeView").hide();
			$("#content").show().css({ width: "99%", height: "400px" });
			$("#content___Frame").remove();
			$("form").removeAttr("_FCKOriginalSubmit").removeAttr("submit");
			if (!$("#content").text().startsWith("<!--code-->")) {
				$("#content").text("<!--code-->" + $("#content").text());
			}
		}
	</script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    编辑模块
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <%= Html.ActionLink("返回列表","ModuleList") %></div>
    <hr />
    <% using (Html.BeginForm()) {%>
    <div style="display:none">
        <%--模块类型--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.type) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.type) %> <%= Html.DisplayToolTipFor(model => model.type) %> <%= Html.ValidationMessageFor(model => model.type) %></span>
    </div>
    <div>
        <%--模块名称--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.mname) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.mname) %> <%= Html.DisplayToolTipFor(model => model.mname) %> <%= Html.ValidationMessageFor(model => model.mname) %></span>
        <%--是否显示--%>
        <span>&nbsp;<%= Html.LabelFor(model => model.ViewFlag) %>：<%= Html.CheckBoxFor(model => model.ViewFlag) %> <%= Html.DisplayToolTipFor(model => model.ViewFlag) %></span>
    </div>
    <div>
        <%--显示顺序--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Sequence) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Sequence, new { value = 0}) %> <%= Html.DisplayToolTipFor(model => model.Sequence) %> <%= Html.ValidationMessageFor(model => model.Sequence) %></span>
    </div>
    <div>
        <%--备注说明--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.memo) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.memo) %> <%= Html.DisplayToolTipFor(model => model.memo) %> <%= Html.ValidationMessageFor(model => model.memo) %></span>
		<%if (!Model.content.StartsWith("<!--code-->")) { %>
		<input type="button" name="codeView" id="codeView" value="代码模式" onclick = "changeCodeView();" />
		<% } %>
    </div>
    <div>
        <%----%>
        <%= Html.HiddenFor(model=>model.ID) %>
    </div>
    <div>
        <%--模块内容--%>
		<% if (Model.content.StartsWith("<!--code-->")) { %>
        <%= Html.TextAreaFor(model => model.content, new { style = "width:99%;height:400px" })%>
        <%= Html.ValidationMessageFor(model => model.content) %>
		<% } else { %>
        <%= Html.FckEditorFor(model => model.content)%>
        <%= Html.ValidationMessageFor(model => model.content) %>
		<% } %>
    </div>
    <p><input type="submit" value="保 存" /> <input type="submit" value="另存为" onclick="$('#ID').val('');" /></p>
    <% } %>
</asp:Content>