managemainmenu.aspx
上传用户:wenllgg125
上传日期:2020-04-09
资源大小:7277k
文件大小:6k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. <%@ Page Language="C#" CodeBehind="managemainmenu.aspx.cs" Inherits="Discuz.Web.Admin.managemainmenu" %>
  2. <%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
  3. <%@ Register Src="../UserControls/PageInfo.ascx" TagName="PageInfo" TagPrefix="uc1" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <html>
  6. <head>
  7.     <title>主菜单管理</title>
  8.     <link href="../styles/datagrid.css" type="text/css" rel="stylesheet" />
  9.     <link href="../styles/dntmanager.css" type="text/css" rel="stylesheet" />        
  10.     <link href="../styles/modelpopup.css" type="text/css" rel="stylesheet" />
  11.     <script type="text/javascript" src="../js/modalpopup.js"></script>
  12.     <script type="text/javascript" src="../js/common.js"></script>
  13.     <script type="text/javascript">
  14.         function newMenu()
  15.         {
  16.             document.getElementById("opt").innerHTML = "新建主菜单";
  17.             document.getElementById("menuid").value = "0";
  18.             document.getElementById("mode").value = "new";
  19.             document.getElementById("menutitle").value = "";
  20.             document.getElementById("defaulturl").value = "";
  21.             BOX_show('neworeditmainmenu');
  22.         }
  23.         function editMenu(menuid,menutitle,defaulturl)
  24.         {
  25.             document.getElementById("opt").innerHTML = "编辑主菜单";
  26.             document.getElementById("menuid").value = menuid;
  27.             document.getElementById("mode").value = "edit";
  28.             document.getElementById("menutitle").value = menutitle;
  29.             document.getElementById("defaulturl").value = defaulturl;
  30.             BOX_show('neworeditmainmenu');
  31.         }
  32.         function chkSubmit()
  33.         {
  34.             if(document.getElementById("menutitle").value == "")
  35.             {
  36.                 alert("主菜单名称不能为空!");
  37.                 document.getElementById("menutitle").focus();
  38.                 return false;
  39.             }
  40.             if(document.getElementById("defaulturl").value == "")
  41.             {
  42.                 if(!confirm("您确认要将默认展现页面地址置空吗?"))
  43.                 {
  44.                     document.getElementById("defaulturl").focus();
  45.                     return false;
  46.                 }
  47.             }
  48.             document.getElementById("form1").submit();
  49.             return true;
  50.         }
  51.     </script>
  52. <meta http-equiv="X-UA-Compatible" content="IE=7" />
  53. </head>
  54. <body>
  55.     <form id="form1" runat="server">
  56.     <uc1:PageInfo ID="info1" runat="server" Icon="information" Text="<li>主菜单项必须在其下没有子菜单时才可删除!</li><li>编辑完菜单后必须点击<b>生成菜单</b>按钮才能使编辑生效!</li><li>建议在编辑菜单前先进入<b>备份管理</b>中对当前未编辑的菜单进行备份,如果修改不当还可以从备份中恢复!</li>" />
  57.     <cc1:datagrid id="DataGrid1" runat="server">
  58.        <Columns>
  59.             <asp:BoundColumn DataField="id" HeaderText="序号" readonly="true"></asp:BoundColumn>
  60.         <asp:BoundColumn DataField="title" HeaderText="主菜单名称"></asp:BoundColumn>
  61.             <asp:BoundColumn DataField="defaulturl" HeaderText="默认展现页面地址"><ItemStyle HorizontalAlign="left" /></asp:BoundColumn>
  62.             <asp:BoundColumn DataField="system" HeaderText="系统菜单" readonly="true"></asp:BoundColumn>
  63.               <asp:TemplateColumn HeaderText="操作">
  64.                 <ItemTemplate>
  65.                     <a href="javascript:;" onclick="editMenu('<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>','<%# DataBinder.Eval(Container, "DataItem.title").ToString() %>','<%# DataBinder.Eval(Container, "DataItem.defaulturl").ToString() %>');">编辑</a>&nbsp;
  66.                     <%# DataBinder.Eval(Container, "DataItem.delitem").ToString()%>&nbsp;
  67.                     <a href="managesubmenu.aspx?menuid=<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>">管理子菜单</a>
  68.                 </ItemTemplate>
  69.               </asp:TemplateColumn>
  70.           </Columns>
  71.     </cc1:datagrid>
  72.     <p style="text-align:right;">
  73.         <button type="button" class="ManagerButton" id="Button2" onclick="newMenu();"><img src="../images/add.gif"/> 新 建 </button>
  74.         <button type="button" class="ManagerButton" id="Button3" onclick="window.location='managemenubackupfile.aspx';"><img src="../images/zip.gif"/>备份管理</button>
  75.         <cc1:Button ID="createMenu" runat="server" Text="生成菜单"></cc1:Button>         
  76.     </p>
  77.         <div id="BOX_overlay" style="background: #000; position: absolute; z-index:100; filter:alpha(opacity=50);-moz-opacity: 0.6;opacity: 0.6;"></div>
  78.         <div id="neworeditmainmenu" style="display: none; background :#fff; padding:10px; border:1px solid #999; width:400px;">
  79.             <div class="ManagerForm">
  80.     <fieldset>
  81.     <legend id="opt" style="background:url(../images/icons/icon53.jpg) no-repeat 6px 50%;">新建主菜单</legend>
  82.     <table cellspacing="0" cellPadding="4" class="tabledatagrid" width="80%">
  83.         <tr>
  84.     <td width="30%">
  85.         主菜单名称:
  86.         <input type="hidden" id="menuid" name="menuid" value="0" />
  87.         <input type="hidden" id="mode" name="mode" value="" />
  88.     </td>
  89.     <td width="70%"><input id="menutitle"  name="menutitle" type="text" maxlength="8" size="10"class="FormBase" onfocus="this.className='FormFocus';" onblur="this.className='FormBase';" /></td>
  90.     </tr>
  91.     <tr>
  92.     <td>默认展现<br />页面地址:</td>
  93.     <td><input id="defaulturl" name="defaulturl" type="text" maxlength="100" size="30" class="FormBase" onfocus="this.className='FormFocus';" onblur="this.className='FormBase';" /></td>
  94.     </tr>
  95.     <tr>
  96.         <td colspan="2" align="center">
  97.             <button type="button" class="ManagerButton" id="AddNewRec" onclick="chkSubmit();"><img src="../images/add.gif"/> 提 交 </button>&nbsp;&nbsp;
  98.             <button type="button" class="ManagerButton" id="Button1" onclick="BOX_remove('neworeditmainmenu');"><img src="../images/state1.gif"/> 取 消 </button>
  99.         </td>
  100.     </tr>
  101.     </table>
  102.     </fieldset>
  103.     </div>
  104.         </div>
  105.     </form>
  106.     <div id="setting" />
  107.     <%=footer%>
  108. </body>
  109. </html>