Tag.aspx
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:5k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" Inherits="CuteEditor.EditorUtilityPage" %>
  2. <%@ Import Namespace="System.Xml"%>
  3. <script runat="server">
  4. override protected void OnInit(EventArgs args)
  5. {
  6. if(Context.Request.QueryString["IsFrame"]==null)
  7. {
  8. string FrameSrc="Tag.Aspx?IsFrame=1&"+Request.ServerVariables["QUERY_STRING"];
  9. CuteEditor.CEU.WriteDialogOuterFrame(Context,"[[Tag]]",FrameSrc);
  10. Context.Response.End();
  11. }
  12. base.OnInit(args);
  13. }
  14. </script>
  15. <script runat="server">
  16. public bool IsTagPattern(string tagname,string pattern)
  17. {
  18. if(pattern=="*")return true;
  19. tagname=tagname.ToLower();
  20. pattern=pattern.ToLower();
  21. if(tagname==pattern)return true;
  22. foreach(string str in pattern.Split(",;|/".ToCharArray()))
  23. {
  24. if(str=="*")return true;
  25. if(str==tagname)return true;
  26. if(str=="-"+tagname)return false;
  27. }
  28. return false;
  29. }
  30. public string GetTagDisplayName(string tagname)
  31. {
  32. switch(tagname.ToLower())
  33. {
  34. case "img":
  35. return "[[Image]]";
  36. case "object":
  37. return "[[ActiveXObject]]";
  38. case "table":
  39. case "inserttable":
  40. return "[["+tagname+"]]";
  41. default:
  42. return tagname;
  43. }
  44. }
  45. bool nocancel=false;
  46. </script>
  47. <%
  48. if(Context.Request.QueryString["NoCancel"]=="True")
  49. nocancel=true;
  50. string tagName=Context.Request.QueryString["Tag"];
  51. string tabName=Context.Request.QueryString["Tab"];
  52. XmlDocument doc=new XmlDocument();
  53. doc.Load(Server.MapPath("tag.config"));
  54. string tabcontrol=null;
  55. string tabtext="";
  56. %>
  57. <html xmlns="http://www.w3.org/1999/xhtml">
  58. <head>
  59. <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.1)" />
  60. <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.1)" />
  61. <link href="Load.ashx?type=style&file=dialog.css" type="text/css" rel="stylesheet" />
  62. <!--[if IE]>
  63. <link href="Load.ashx?type=style&file=IE.css" type="text/css" rel="stylesheet" />
  64. <![endif]-->
  65. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogHead.js"></script>
  66. <%if(nocancel){%>
  67. <script type="text/javascript">
  68. var OxO3f50=["nocancel"]; top[OxO3f50[0x0]]=true ;
  69. </script>
  70. <%}else{%>
  71. <script type="text/javascript">
  72. var OxOc490=["nocancel"]; top[OxOc490[0x0]]=false ;
  73. </script>
  74. <%}%>
  75. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=Dialog_TagHead.js"></script>
  76. <title></title>
  77. </head>
  78. <body style="border-width:0px;padding-top:4px;padding-left:4px;padding-right:4px;;margin:0px;">
  79. <span style="font-size:10pt;font-family:Tahoma; font-weight:bold;TEXT-TRANSFORM: capitalize">
  80. <%=GetTagDisplayName(tagName)%>
  81. </span>
  82. <fieldset id="controlparent" style="width:100%; height:386px; padding-left:7px; padding-right:7px; padding-bottom:7px;">
  83. <legend align="right">
  84. <table>
  85. <tr>
  86. <td id="menu">
  87. <%
  88. int index=0;
  89. foreach(XmlElement xe in doc.DocumentElement.SelectNodes("add"))
  90. {
  91. string tab=xe.GetAttribute("tab");
  92. if(IsTagPattern(tagName,xe.GetAttribute("pattern")))
  93. {
  94. bool isactive=(index==0&&(tabName==null||tabName==""))||(string.Compare(tab,tabName,true)==0);
  95. if(isactive)
  96. {
  97. tabcontrol=xe.GetAttribute("control");
  98. tabtext=xe.GetAttribute("text");
  99. }
  100. %>
  101. <a class='<%=isactive?"ActiveTabNav":"TabNav"%>' tabindex="-1" href='<%=CuteEditor.EditorUtility.ReplaceParam(Request.RawUrl,"Tab",tab)%>'>
  102. <span style="white-space:nowrap;" >
  103. <%=xe.GetAttribute("text")%>
  104. </span>
  105. </a>
  106. <%
  107. index++;
  108. }
  109. }
  110. %>
  111. </td>
  112. </tr>
  113. </table>
  114. </legend>
  115. <%
  116. if(tabcontrol!=null)
  117. {
  118. try
  119. {
  120. Control ctrl=LoadControl("Tag//"+tabcontrol);
  121. holder1.Controls.Add(ctrl);
  122. }
  123. catch
  124. {
  125. if(Context.Request.QueryString["_err"]=="2")
  126. throw;
  127. %>
  128. <iframe style="width:378;height:333" src='<%=Context.Request.RawUrl+"&_err=2"%>'>
  129. </iframe>
  130. <%
  131. }
  132. }
  133. %>
  134. <asp:PlaceHolder id="holder1" Runat="server"></asp:PlaceHolder>
  135. </fieldset>
  136. <div style="text-align:right;padding-top:8px;padding-bottom:2px;padding-right:12px;">
  137. <input type="button" id="btn_editinwin" value="[[EditHtml]]" />
  138. &nbsp;&nbsp;&nbsp;
  139. <input type="button" id="btnok" value="[[OK]]" style="width:80px"/>&nbsp;
  140. <input type="button" id="btncc" value="[[Cancel]]" style="width:80px"/>
  141. </div>
  142. </body>
  143. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogFoot.js"></script>
  144. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=Dialog_TagFoot.js"></script>
  145. </html>