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

SCSI/ASPI

开发平台:

Others

  1. <%@ Page language="c#" Inherits="Discuz.Web.Admin.smilegrid" Codebehind="forum_smilegrid.aspx.cs" %>
  2. <%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
  3. <%@ Register TagPrefix="uc1" TagName="PageInfo" Src="../UserControls/PageInfo.ascx" %>
  4. <%@ Import NameSpace="Discuz.Common"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html>
  7. <head>
  8. <title>论坛图标文件列表</title>
  9. <link href="../styles/datagrid.css" type="text/css" rel="stylesheet" />
  10. <script type="text/javascript" src="../js/common.js"></script>
  11. <link href="../styles/dntmanager.css" type="text/css" rel="stylesheet" />  
  12. <script type="text/javascript">
  13. function validate()
  14. {
  15. var str = ",<%=ViewState["code"]%>";
  16. var count = 2;
  17. while(true)
  18. {
  19. if( document.getElementById("id" + count) != null)
  20. {
  21. for(var i = count - 1; i >= 1; i--)
  22. {
  23. if(!document.getElementById("id" + i).checked) continue;
  24. if(!document.getElementById("id" + count).checked) continue;
  25. if(document.getElementById("code" + i).value == document.getElementById("code" + count).value)
  26. {
  27. Message("第" + i + "行的代码名称与第" + count + "行相同");
  28. return false;
  29. }
  30. }
  31. count++;
  32. }
  33. else
  34. break;
  35. }
  36. for(var i = 1;;i++)
  37. {
  38. if(document.getElementById("id" + i) == null)
  39. {
  40. Message("没有要提交的数据!");
  41. return false;
  42. }
  43. if(document.getElementById("id" + i).checked) break;
  44. }
  45. for(var i = 1;; i++)
  46. {
  47. if(document.getElementById("id" + i) == null)
  48. return true;
  49. else
  50. {
  51. if(document.getElementById("code" + i).value == "")
  52. {
  53. Message("第" + i + "行的代码名称为空!");
  54. document.getElementById("code" + i).focus();
  55. return;
  56. }
  57. if(document.getElementById("id" + i).checked)
  58. {
  59. if(str.indexOf("," + document.getElementById("code" + i).value + ",") >= 0)
  60. {
  61. Message("第" + i + "行的代码名称与原有的代码名称相同");
  62. return false;
  63. }
  64. if(isNaNEx(document.getElementById("order" + i).value))
  65. {
  66. Message("第" + i + "行为非零数字");
  67. return false;
  68. }
  69. }
  70. }
  71. }
  72. }
  73. function Message(m)
  74. {
  75. document.getElementById("success").style.display = 'none';
  76. document.getElementById("SubmitButton").disabled = false;
  77. alert(m);
  78. }
  79. function isNaNEx(str)
  80. {
  81. return !(/^d+$/.test(str));
  82. }
  83. function CheckSelect(form)
  84. {
  85. for (var i=0;i<form.elements.length;i++)
  86. {
  87. var e = form.elements[i];
  88. if (e.name != 'chkall' && e.name =='id')
  89. e.checked = form.chkall.checked;
  90. }
  91. }
  92. function checkFileList(form)
  93. {
  94. var i = 1;
  95. while(true)
  96. {
  97. if(form.elements["id" + i] == null)
  98. break;
  99. form.elements["id" + i].checked = form.cfile.checked;
  100. i++;
  101. }
  102. }
  103. </script>
  104. <meta http-equiv="X-UA-Compatible" content="IE=7" />
  105. </head>
  106. <body>
  107. <form id="Form1" method="post" runat="server"><br>
  108. <uc1:PageInfo id="info1" runat="server" Icon="Information"
  109. Text="显示顺序须为整数, 代码和文件名最大长度将为30. "></uc1:PageInfo>
  110. <cc1:datagrid id="smilesgrid" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged" OnSortCommand="Sort_Grid" IsFixConlumnControls="true" pagesize="10">
  111. <Columns>
  112. <asp:TemplateColumn HeaderText="<input title='选中/取消' onclick='CheckSelect(this.form)' type='checkbox' name='chkall' id='chkall' />">
  113. <HeaderStyle Width="20px" />
  114. <ItemTemplate>
  115. <input id="id" onclick="checkedEnabledButton(this.form,'id','DelRec')" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.id").ToString()%>" name="id" />
  116. <%# smilesgrid.LoadSelectedCheckBox(DataBinder.Eval(Container, "DataItem.id").ToString())%>
  117. </ItemTemplate>
  118. </asp:TemplateColumn>
  119. <asp:BoundColumn DataField="ID" SortExpression="id" HeaderText="图标id" Visible="false" ></asp:BoundColumn>
  120. <asp:BoundColumn DataField="type" SortExpression="type" HeaderText="类型" Visible="false"></asp:BoundColumn>
  121. <asp:BoundColumn DataField="code" SortExpression="code" HeaderText="代码" ><headerstyle width="20%"/></asp:BoundColumn>
  122. <asp:BoundColumn DataField="displayorder" SortExpression="displayorder" HeaderText="显示顺序"><headerstyle width="20%"/></asp:BoundColumn>
  123. <asp:BoundColumn DataField="url" SortExpression="url" HeaderText="文件名"><headerstyle width="40%"/></asp:BoundColumn>
  124. <asp:TemplateColumn HeaderText="图片">
  125. <ItemTemplate>
  126. <asp:Label id=Label4 runat="server" Text='<%# PicStr(DataBinder.Eval(Container, "DataItem.url").ToString()) %>'>
  127. </asp:Label>
  128. </ItemTemplate>
  129. </asp:TemplateColumn>
  130. </Columns>
  131. </cc1:datagrid>
  132. <p style="text-align:right;">
  133. <cc1:Button id="EditSmile" runat="server" Text="保存表情信息修改"></cc1:Button>&nbsp;&nbsp;
  134. <cc1:Button id="DelRec" runat="server" Text=" 删 除 " ButtonImgUrl="../images/del.gif" Enabled="false" OnClientClick="if(!confirm('你确认要删除所选的表情码吗?')) return false;"></cc1:Button>&nbsp;&nbsp;
  135. <button type="button" class="ManagerButton" onclick="javascript:window.location.href='forum_addsmile.aspx?typeid=<%=DNTRequest.GetInt("typeid",0)%>';">
  136. <img src="../images/add.gif" /> 上传表情
  137. </button>&nbsp;&nbsp;
  138. <button type="button" class="ManagerButton" id="Button3" onclick="window.location='forum_smiliemanage.aspx';"><img src="../images/arrow_undo.gif"/> 返 回 </button>
  139. </p>
  140. <div class="ManagerForm">
  141. <fieldset>
  142. <legend style="background:url(../images/icons/icon49.jpg) no-repeat 6px 50%;">增加现有表情</legend>
  143. <table class="ntcplist" >
  144. <tr>
  145. <td>
  146. <table class="datalist" cellspacing="0" rules="all" border="1" id="Table1" style="border-collapse:collapse;">
  147. <tr class="category">
  148.   <td width="5%" nowrap="nowrap" style="border-color:#EAE9E1;border-width:1px;border-style:solid;">
  149. <input type="checkbox" name="cfile" onclick="checkFileList(this.form)"/>
  150.   </td>
  151.   <td width="25%" nowrap="nowrap" style="border-color:#EAE9E1;border-width:1px;border-style:solid;">代码</td>
  152.   <td width="25%" nowrap="nowrap" style="border-color:#EAE9E1;border-width:1px;border-style:solid;">显示顺序</td>
  153.   <td width="35%" nowrap="nowrap" style="border-color:#EAE9E1;border-width:1px;border-style:solid;">文件名</td>
  154.   <td width="10%" nowrap="nowrap" style="border-color:#EAE9E1;border-width:1px;border-style:solid;">图片</td>
  155. </tr>
  156. <asp:Literal ID="fileinfoList" Runat="server" />
  157. <tr><td align="center" colspan="5"><br /><cc1:Button id="SubmitButton" runat="server" Text=" 提 交 " ValidateForm="true"></cc1:Button></td></tr>
  158. </table>
  159. </td>
  160. </tr>
  161. </table>
  162. </fieldset>
  163. </div>
  164. </form>
  165. <%=footer%>
  166. </body>
  167. </html>