<%@ Page language="c#" Inherits="Discuz.ForumPage.Admin.shortcut" Codebehind="shortcut.aspx.cs" %>
<%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<%@ Import NameSpace="Discuz.Common"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>shortcut</title>
		<link href="../styles/dntmanager.css" type="text/css" rel="stylesheet">   
		<script language="javascript" src="../js/common.js"></script>
		<script language="javascript1.2" type="text/javascript">		
       
    var currentid=0;
    var bar=0;
    var filenameliststr='<%=filenamelist%>';
    var filenamelist=new Array();
    filenamelist= filenameliststr.split('|');
    function runstatic()
    {  
         if(filenamelist[currentid]!="")
         {
		 document.getElementById('Layer5').innerHTML =  '<br /><table><tr><td valign=top><img border=\"0\" src=\"../images/ajax_loading.gif\"  /></td><td valign=middle style=\"font-size: 14px;\" >正在更新'+filenamelist[currentid]+'.htm模板, 请稍等...<BR /></td></tr></table><BR />';
         document.getElementById('Layer5').style.witdh='350';
         document.getElementById('success').style.witdh='400';
         document.getElementById('success').style.display ="block"; 
       
         getReturn('updatesingletemplate.aspx?path='+document.getElementById('Templatepath').value+'&filename='+filenamelist[currentid]);
         currentid++;
         }
         else//filenamelist.count<=currentid
         {
            document.getElementById('Layer5').innerHTML="<br />模板更新成功, 请稍等...";
            document.getElementById('success').style.display = "block";
		    count(); 
		    document.getElementById('Form1').submit();
         }
   }
   
   function count()
   { 
		bar=bar+2;
		if (bar<99) {setTimeout("count()",100);} 
		else { document.getElementById('success').style.display ="none"; } 
   }
   
   function run()
   {
      bar=0;
      document.getElementById('Layer5').innerHTML="<BR /><table><tr><td valign=top><img border=\"0\" src=\"../images/ajax_loading.gif\"  /></td><td valign=middle style=\"font-size: 14px;\" >正在提交数据, 请稍等...<BR /></td></tr></table><BR />";
      document.getElementById('success').style.display = "block";
      setInterval('runstatic()',5000); //每次提交时间为6秒
   }
   
   function validateform(theform)
   {
      document.getElementById('Form1').submit();
 	  return true;
   }
   
   function validate(theform)
   {
      if(document.getElementById('createtype').checked)
      {
          run();
          return false;
      }
      else
      {
 	      return true;
	  }
   }
    
   </script>
		
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<table class="table1" cellSpacing="0" cellPadding="4" width="100%" border="0">
				<TBODY>
					<tr>
						<td class="td1" width="50%"><b>编辑用户:</b></td>
						<td class="td1"><cc1:textbox ID="Username" runat="server" RequiredFieldType="暂无校验" width="200"></cc1:textbox></td>
						<td class="td1"><cc1:Button ID="EditUser" runat="server" Text="提 交"></cc1:Button></td>
					</tr>
					<tr>
						<td class="td2"><b>编辑论坛:</b></td>
						<td class="td2"><cc1:dropdowntreelist ID="forumid" runat="server"></cc1:dropdowntreelist></td>
						<td class="td2"><cc1:Button ID="EditForum" runat="server" Text="提 交"></cc1:Button></td>
					</tr>
					<tr>
						<td class="td1"><b>编辑用户组:</b></td>
						<td class="td1"><cc1:dropdownlist id="Usergroupid" runat="server"></cc1:dropdownlist></td>
						<td class="td1"><cc1:Button id="EditUserGroup" runat="server" Text="提 交"></cc1:Button></td>
					</tr>
					<tr>
						<td class="td2"><b>更新缓存:</b></td>
						<td class="td2"></td>
						<td class="td2"><cc1:Button id="UpdateCache" runat="server" Text="提 交"></cc1:Button></td>
					</tr>
					<tr>
						<td class="td1"><b>生成模板:</b></td>
						<td class="td1"><cc1:dropdownlist id="Templatepath" runat="server"></cc1:dropdownlist> <input type="checkbox" id="createtype" name="createtype" >降低CPU占用</td>
						<td class="td1"><cc1:Button id="CreateTemplate" runat="server" Text="提 交" ValidateForm="true"></cc1:Button></td>
					</tr>
					<tr>
						<td class="td2"><b>更新论坛统计:</b></td>
						<td class="td2">&nbsp;
						</td>
						<td class="td2"><cc1:Button id="UpdateForumStatistics" runat="server" Text="提 交"></cc1:Button></td>
					</tr>
					<tr>
						<td class="td1" colspan="3">
						<button type="button" class="ManagerButton" onclick="javascript:window.open('http://nt.discuz.net/whatsnew/index.aspx?ver=<%=Utils.GetAssemblyVersion()%>&dbtype=0','','');" ><img src="../images/checkver.gif"/>检测官方最新版本</button>
						&nbsp;&nbsp;<button type="button" class="ManagerButton" onclick="javascript:window.open('http://nt.discuz.net/doc/ui/','','');"><img src="../images/checkver.gif"/>访问官方文档中心</button>
						&nbsp;&nbsp;<button type="button" class="ManagerButton" onclick="javascript:window.open('http://nt.discuz.net/','','');" ><img src="../images/checkver.gif"/>访问官方论坛</button></td>
					</tr>
					<tr>
						<td class="td2" colspan="3" height="10"><iframe  width="100%" height="100px" id="checkveriframe" framespacing="0px" style="border-width: 0px;"  frameborder="0px"  noResize ></iframe></td>
					</tr>
				</TBODY>
			</table>
		</form>
		<%=footer%>
	</body>
</HTML>
