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

SCSI/ASPI

开发平台:

Others

  1. <%@ Page language="c#" Inherits="Discuz.Web.Admin.forumstree" Codebehind="forum_forumstree.aspx.cs" %>
  2. <%@ Register TagPrefix="uc1" TagName="PageInfo" Src="../UserControls/PageInfo.ascx" %>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  4. <html>
  5. <head id="Head1">
  6. <title>移动版块</title>
  7. <script type="text/javascript" src="../js/common.js"></script>
  8. <link href="../styles/dntmanager.css" type="text/css" rel="stylesheet" />
  9. <style type=text/css>
  10. body {
  11. overflow-x:auto;
  12. }
  13. .contral{
  14. font-size:12px;
  15. cursor:default;
  16. margin:0 auto;
  17. }
  18. .contral input{
  19. font-size:12px;
  20. cursor:hand;
  21. valign:middle;
  22. }
  23. .treenode_move {
  24. position:absolute;
  25. width:200px;
  26. line-height:18px;
  27. filter:alpha(opacity=50);
  28. opacity:0.5;
  29. z-index:110;
  30. display:none;
  31. padding-left:20px;
  32. background:url('../images/folder.gif') no-repeat 0px 0px;
  33. }
  34. .treenode_0_noselected{
  35. height:4px;
  36. line-height:4px;
  37. overflow:hidden;
  38. z-index:100;
  39. border: 0px #ffffff solid;
  40. }
  41. .treenode_0_over{
  42. background-color: #c0ddfc;
  43. height:6px;
  44. line-height:6px;
  45. overflow:hidden;
  46. z-index:100;
  47. border: 0px #933456 solid;
  48. }
  49. .treenode_selected{
  50. line-height:15px;
  51. z-index:100;
  52. background-color: #c0ddfc;
  53. color:#ffffff;
  54. border: 0px #0A246A solid;
  55. }
  56. .treenode_noselected{
  57. line-height:15px;
  58. z-index:100;
  59. border: 0px #ffffff solid;
  60. }
  61. .treenode_over{
  62. line-height:15px;
  63. background-color: #c0ddfc;
  64. color:#ffffff;
  65. cursor:poiter;
  66. z-index:100;
  67. border: 0px #4963A9 solid;
  68. }
  69. </style>
  70. <script type="text/javascript">
  71. var treeID = null;
  72. function tree(treeID,treeNodes,funName){
  73. var fid = 0;
  74. var treeType = 0;
  75. var layer = 0;
  76. var parentidlist = "";
  77. var title = "";
  78. var lastDiv = null;
  79. this.id = treeID;
  80. this.drag = false;
  81. this.dragObj = null;
  82. this.oldClass = "";
  83. this.fid = 0;
  84. this.treeType = 0;
  85. this.layer = 0;
  86. this.parentidlist = "";
  87. this.title = ""
  88. this.lastDiv = null
  89. this.getPos=function(el,sProp){
  90. var iPos = 0;
  91. while (el!=null) {
  92. iPos+=el["offset" + sProp];
  93. el = el.offsetParent;
  94. }
  95. return iPos;
  96. }
  97. this.getETarget = function(e){
  98. if (!e){return null;}
  99. if (!e.srcElement && !e.target){return null;}
  100. obj = e.srcElement ? e.srcElement : e.target;
  101. if (obj == null){return null};
  102. while (obj.getAttribute("treetype") == null && obj.tagName != "BODY" && obj.tagName != "HTML"){
  103. obj = obj.parentNode;
  104. if(obj == null){break;}
  105. }
  106. return obj;
  107. }
  108. //鼠标按下
  109. this.onmousedown = function(e){
  110. if (!e){return false;}
  111. if (this.dragObj){
  112. this.dragObj.className = "noselected";
  113. }
  114. this.dragObj = this.getETarget(e);
  115. if (!this.dragObj){return;}
  116. if (!this.dragObj.getAttribute("treetype")){return;}
  117. var mX = e.x ? e.x : e.pageX;
  118. var mY = e.y ? e.y : e.pageY;
  119. this.drag = true;
  120. this.dragObj.className = "treenode_selected";
  121. this.oldClass = "treenode_selected";
  122. var textContent = this.dragObj.textContent ? this.dragObj.textContent : this.dragObj.innerText; 
  123. textContent = textContent.replace("添加","");
  124. textContent = textContent.replace("编辑","");
  125. textContent = textContent.replace("删除","");
  126. textContent = textContent.replace("移动","");
  127. textContent = textContent.replace("特殊用户","");
  128. textContent = textContent.replace("主题分类","");
  129. textContent = textContent.replace("复制论坛设置","");
  130. this.ShowMove(mX,mY,textContent );
  131. treeID = this;
  132. document.onmousedown = function(){return false};
  133. document.onmousemove = function(e){
  134. if (tree==null){
  135. return;
  136. }
  137. treeID.document_onmousemove(e);
  138. }
  139. alignElWithMouse(mX,mY);
  140. };
  141. this.onmouseup = function(e){this.document_onmouseup(e)};
  142. this.onmouseover = function(e){
  143. if (this.drag){
  144. this.oldClass = this.getETarget(e).className;
  145. if (this.getETarget(e).getAttribute("treeType")==1){
  146. this.getETarget(e).className = "treenode_over";
  147. }
  148. else{
  149. this.getETarget(e).className = "treenode_0_over";
  150. }
  151. }
  152. var mX = e.x ? e.x : e.pageX;
  153. var mY = e.y ? e.y : e.pageY;
  154. alignElWithMouse(mX,mY)
  155. };
  156. this.onmouseout = function(e){
  157. if (this.drag){
  158. this.getETarget(e).className = this.oldClass;
  159. if (this.dragObj.id == this.getETarget(e).id){
  160. this.findObj(this.id + "_treenode_move").style.display="block";
  161. }
  162. }
  163. };
  164. this.init = function(){
  165. document.write("n<div id="" + this.id + "_control" class="contral">");
  166. document.write("n<div id = "" + this.id + "_treenode_move" class="treenode_move"></div>")
  167. document.write("n<div id = "" + this.id + "_line"></div>")
  168. document.write("n<div class="treenode_0" style="display:none;" id = "" + this.id + "_treenode_0" onmouseup="" + this.id + ".onmouseup(event);" onmouseover="" + this.id + ".onmouseover(event)" onmouseout="" + this.id + ".onmouseout(event)"></div>")
  169. document.write("n<div class="treenode_1" style="display:none;" id = "" + this.id + "_treenode" onmousedown="" + this.id + ".onmousedown(event);" onmouseup="" + this.id + ".onmouseup(event);" onmouseover="" + this.id + ".onmouseover(event)" onmouseout="" + this.id + ".onmouseout(event)"></div>");
  170. for(i=0;i<treeNodes.length;i++){
  171. var nodeStr = "";
  172. for(treeNode in treeNodes[i]){
  173. nodeStr += treeNode + "="" + escape(treeNodes[i][treeNode]) + "" ";
  174. }
  175. document.write("n<div class="treenode_0_noselected" id = "" + this.id + "_treenode" + i + "_0" index="" + i + "" treetype="0" ");
  176. document.write(nodeStr);
  177. document.write("onmouseup="" + this.id + ".onmouseup(event);" onmouseover="" + this.id + ".onmouseover(event)" onmouseout="" + this.id + ".onmouseout(event)">");
  178. if (i>0){
  179. document.write(treeNodes[i].linetitle);
  180. }
  181. document.write("</div>");
  182. document.write("n<div class="treenode_noselected" id = "" + this.id + "_treenode" + i + "" index="" + i + "" treetype="1" ");
  183. document.write(nodeStr);
  184. if(treeNodes[i].layer =='0')
  185. {
  186.  document.write("onmousedown="" + this.id + ".onmousedown(event);" onmouseup="" + this.id + ".onmouseup(event);" onmouseover="" + this.id + ".onmouseover(event)" onmouseout="" + this.id + ".onmouseout(event)">" + treeNodes[i].subject + (treeNodes[i].istrade == 1 ? "<span style='color:#f00;font-weight:bold;'>(交易版)</span>" : "") + " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=../images/cal_nextMonth.gif> &nbsp;<a href="#" class="TopicButton"  type="button" onclick="javascript:window.location.href='forum_AddForums.aspx?fid="+treeNodes[i].fid+"';"><img src="../images/add.gif"/>添加</a><a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='" + (treeNodes[i].istrade == 1 ? "forum_editmall" : "forum_editforums") + ".aspx?fid="+treeNodes[i].fid+"';"><img src="../images/submit.gif"/>编辑</a><a href="#" class="TopicButton" type="button" onclick="javascript:if(confirm('您要删除该项吗?')){success.style.display = 'block';HideOverSels('success');window.location.href='forum_delforums.aspx?fid=" + treeNodes[i].fid + (treeNodes[i].istrade == "1" ? "&istrade=1" : "") + "';}"><img src="../images/del.gif" />删除</a><a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='forum_forumsmove.aspx?currentfid="+treeNodes[i].fid+"';"><img src="../images/move.gif"/>移动</a></div>");
  187. }
  188. else
  189. {
  190.  document.write("onmousedown="" + this.id + ".onmousedown(event);" onmouseup="" + this.id + ".onmouseup(event);" onmouseover="" + this.id + ".onmouseover(event)" onmouseout="" + this.id + ".onmouseout(event)">" + treeNodes[i].subject + (treeNodes[i].istrade == 1 ? "<span style='color:#f00;font-weight:bold;'>(交易版)</span>" : "") + " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=../images/cal_nextMonth.gif>&nbsp;<a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='forum_AddForums.aspx?fid="+treeNodes[i].fid+"';"><img src="../images/add.gif"/>添加</a><a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='" + (treeNodes[i].istrade == 1 ? "forum_editmall" : "forum_editforums") + ".aspx?fid="+treeNodes[i].fid+"';"><img src="../images/submit.gif"/>编辑</a><a href="#" class="TopicButton" type="button" onclick="javascript:if(confirm('您要删除该项吗?')){success.style.display = 'block';HideOverSels('success');window.location.href='forum_delforums.aspx?fid="+treeNodes[i].fid + (treeNodes[i].istrade == "1" ? "&istrade=1" : "") + "';}"><img src="../images/del.gif" />删除</a><a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='forum_forumsmove.aspx?currentfid="+treeNodes[i].fid+"';"><img src="../images/move.gif" />移动</a><a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='forum_editforums.aspx?fid="+treeNodes[i].fid+"&tabindex=3';"><img src="../images/topictype.gif"/>特殊用户</a><a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='forum_editforums.aspx?fid="+treeNodes[i].fid+"&tabindex=4';"><img src="../images/topictype.gif"/>主题分类</a><a href="#" class="TopicButton" type="button" onclick="javascript:window.location.href='forum_forumbatchset.aspx?fid="+treeNodes[i].fid+"';"><img src="../images/nav/guide.gif"/>复制论坛设置</a></div>");
  191. }
  192. }
  193. }
  194. document.write("n</div>");
  195. this.findObj = function(objname){
  196. if (document.getElementById(objname)){
  197. return document.getElementById(objname);
  198. }
  199. else if(document.getElementsByName(objname)){
  200. return document.getElementsByName(objname)
  201. }
  202. else{
  203. return null;
  204. }
  205. }
  206. this.HideMove = function(){
  207. if (this.findObj(this.id + "_treenode_move").style.display!="none"){
  208. this.findObj(this.id + "_treenode_move").style.display="none";
  209. }
  210. }
  211. this.ShowMove = function(mX ,mY,innerHTML){
  212. this.findObj(this.id + "_treenode_move").innerHTML = innerHTML;
  213. this.findObj(this.id + "_treenode_move").style.left =(mX + 10) + "px";
  214. this.findObj(this.id + "_treenode_move").style.top = (mY) + "px";
  215. }
  216. this.SetMove = function(e,mX,mY){
  217. this.findObj(this.id + "_treenode_move").style.left =(mX + 10) + "px";
  218. this.findObj(this.id + "_treenode_move").style.top = (mY) + "px";
  219. }
  220. //document事件
  221. this.document_onmouseup = function(e){
  222. if (this.drag){
  223. this.drag = false;
  224. try{
  225. this.getETarget(e).className = this.oldClass;
  226. index = this.getETarget(e).getAttribute("index");
  227. eval(funName+ "(treeNodes[index],treeNodes[this.dragObj.getAttribute("index")],this.getETarget(e).getAttribute("treetype"))");
  228. }
  229. catch(e){}
  230. this.HideMove();
  231. treeID = null;
  232. document.onmousedown = function(){return true};
  233. document.onmousemove = function(){null;};
  234. }
  235. }
  236. document.onmouseup = new Function(this.id + ".document_onmouseup();");
  237. this.document_onmousemove = function(e){
  238. e= e ? e : window.event;
  239. var mX = e.x ? e.x : e.pageX;
  240. var mY = e.y ? e.y : e.pageY;
  241. this.SetMove(e,mX,mY);
  242. }
  243. this.document_onselectstart = function(){
  244. return !this.drag;
  245. }
  246. document.onselectstart = new Function("return " + this.id + ".document_onselectstart ();");
  247. this.init();
  248. if(this.findObj(this.id+"_treenode0"))
  249. {
  250. //alert(this.findObj(this.id+"_treenode0").id);
  251. //this.findObj(this.id+"_treenode0").className='treenode_selected';
  252. }
  253. }
  254. </script>
  255. <script type="text/javascript">
  256. function reSetTree(objN, objO, treetype)
  257. {
  258. if (objN.fid == objO.fid)
  259.    return;
  260.    //alert("将 " + objO.name + "(fid:" + objO.fid + ")" + (treetype == 1 ? " 插入到 " : " 移动到 ") + objN.name + "(fid:" + objN.fid + ")" + (treetype == 1 ? " 下" : " 之前"));
  261. var message = '您是否要将版块"' + objO.name + '"移动到版块"' + objN.name + '"';
  262. if (treetype == 1)
  263. {
  264. message += '子版下吗 ?';
  265. }
  266. else
  267. {
  268. message += '之前吗 ?';
  269. }
  270. if (confirm(message))
  271. {
  272. var objnparentidlist = ',' + objN.parentidlist + ',';
  273. if (objnparentidlist.indexOf(',' + objO.fid + ',') < 0)
  274. {
  275. success.style.display = 'block';
  276. HideOverSels('success');
  277. window.location.href = 'forum_forumstree.aspx?currentfid=' + objO.fid + '&targetfid=' + objN.fid + '&isaschildnode=' + treetype;
  278. }
  279. else
  280. {
  281. alert('不能将当前分类或版块作为其子版块的版块');
  282. }
  283. }
  284. }
  285. </script>
  286. <script type="text/javascript">
  287. function netscapeMouseMove(e) {
  288.  if(e.screenY>(document.body.offsetHeight-10))
  289.  {
  290.  window.scrollTo(e.screenX, e.screenY+1000);
  291.  }
  292.  if(e.screenY<10)
  293.  {
  294.  window.scrollTo(e.screenX, e.screenY-1000);
  295.  }
  296.  
  297. }
  298. function microSoftMouseMove()
  299. {
  300.  if(window.event.y>(document.body.offsetHeight-10))
  301.  {
  302.  window.scrollTo(window.event.x, window.event.y+1000);
  303.  }
  304.  if(window.event.y<10)
  305.  {
  306.  window.scrollTo(window.event.x, window.event.y-1000);
  307.  }
  308. }
  309. var countdown=1;
  310. var countup=1;
  311. function alignElWithMouse(x,y)
  312. {
  313. }
  314. </script>
  315. <meta http-equiv="X-UA-Compatible" content="IE=7" />
  316. </head>
  317. <script type="text/javascript" src="../js/common.js"></script>
  318. <body style="overflow:scroll;">
  319. <form id="Form1" runat="server" >
  320. <div style="clear:both;position:relative">
  321. <uc1:PageInfo id="info1" runat="server" Icon="Information"
  322. Text="<li>支持鼠标拖拽</li><li>如需批量设置版块,请设置完一个版块后选择&quot;复制论坛设置&quot;</li>"></uc1:PageInfo>
  323. <div class="Navbutton" style=" margin:0 auto; text-align:center;">
  324. <table width="100%">
  325. <tr>
  326. <td width="100%">
  327. <asp:Label id="ShowTreeLabel" runat="server"></asp:Label>
  328. </td>
  329. </tr>
  330. </table>
  331. <br />
  332. <br />
  333. </div>
  334. </div>
  335. </form>
  336. <%=footer%>
  337. </body>
  338. </html>