<?php die;?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<title><!--{$smarty.const.MICE_TITLE}--></title>
<base href="<!--{$smarty.const.MICE_URL}--><!--{$smarty.const.MICE_TPL}-->/admin/" />
<link href="css/Default.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
var baseurl = '<!--{$smarty.const.MICE_URL}--><!--{$smarty.const.MICE_TPL}-->/admin/';
//alert(<!--{$filecategoryid}-->);
</script>
<script type="text/javascript" src="js/Main.js"></script>
<script language="javascript"> 
  function copyToClipboard(txt) {
      if(window.clipboardData) {
              window.clipboardData.clearData();   
              window.clipboardData.setData("Text", txt);   
			  alert(txt+"\n文件地址复制成功");
      } else if(navigator.userAgent.indexOf("Opera") != -1) {
           alert("您所用的浏览器暂不支持JS复制功能\n请直接复制文本框中的内容");   
      } else if (window.netscape) {   
           try {   
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
           } catch (e) {   
                alert("被浏览器拒绝！\n请直接复制文本框内的内容\n或\n在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");   
           }   
           var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);   
           if (!clip)   
                return;   
           var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);   
           if (!trans)   
                return;   
           trans.addDataFlavor('text/unicode');   
           var str = new Object();   
           var len = new Object();   
           var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);   
           var copytext = txt;   
           str.data = copytext;   
           trans.setTransferData("text/unicode",str,copytext.length*2);   
           var clipid = Components.interfaces.nsIClipboard;   
           if (!clip)   
                return false;   
           clip.setData(trans,null,clipid.kGlobalClipboard);   
           alert("复制成功\n"+txt);
      }
 }
</script>
<script language="JavaScript">
function add(){
	var diag = new Dialog("Diag1");
    
	diag.Width = 450;
	diag.Height = 460;
	diag.Title = "图片上传";
	diag.URL = "<!--{$create}--><!--{$filecategoryid}-->";
	diag.OKEvent = upload;	
	diag.show();
}

function upload(){
	$D.close();
	location.href = location.href;
}

function edit(){
	var arr = $("contentlist").$T("input");

	for(var i=0;i<arr.length;i++){
		var c = arr[i];
		if(c.$A("value")>0){
			if($("checkbox["+c.$A("value")+"]").checked){
				eid=c.$A("value");
			}
		}
	}

	if(!eid){
		Dialog.alert( "请先选择要编辑的文件！" ) ;
		return;
	}

	editid(eid);
}

function editid(eid){
	if(!eid){
		Dialog.alert( "请先选择要编辑的文件！" ) ;
		return;
	}

	var diag = new Dialog("Diag1");
	diag.Width = 420;
	diag.Height = 200;
	diag.Title = "编辑图片";
	diag.URL = "<!--{$edit}-->"+eid;
	diag.RequstURL = "<!--{$update}-->";
	diag.OKEvent = function(){
		var dc = $DW.Form.getData("editfile");
		Server.sendRequest(diag.RequstURL,dc,Application.RequstAlert);
	};
	diag.onLoad = function(){
		$DW.$("title").focus();
	};
	diag.show();
}

function preview(){
	var arr = $("contentlist").$T("input");
	var flag = true;

	for(var i=0;i<arr.length;i++){
		var c = arr[i];
		if(c.$A("value")>0){
			if($("checkbox["+c.$A("value")+"]").checked){
				window.open(c.$A("url"));
				flag = false;
			}
		}
	}

	if(flag){
		Dialog.alert( "请先选择要预览的文件！" ) ;
	}
	
	return;
}

function del(){
	var arr = $("contentlist").$T("input");
	var flag = true;

	for(var i=0;i<arr.length;i++){
		var c = arr[i];
		if(c.$A("value")>0){
			if($("checkbox["+c.$A("value")+"]").checked){
				Dialog.confirm("确认删除选中的文件吗？",function(){
					document.form1.action="<!--{$delete}-->";
					document.form1.submit();
				});
				flag = false;
				return;
			}
		}
	}

	if(flag){
		Dialog.alert( "请先选择要删除的文件！" ) ;
	}

	return ;
}

</script>

<script language="JavaScript">
function onTreeClick(ele)
{
	//
	//document.alform.submit();
	//window.navigate("<!--{$category}-->"+cid);
	var cid=ele.getAttribute("cid");
	window.location.href="<!--{$category}-->"+cid;
	//window.open("<!--{$category}-->"+cid,"_MainArea");
	//window.event.returnValue = false;
	//alert("<!--{$category}-->"+cid);
}
</script>
</head>
<body>
<input type="hidden" id="CatalogID">
<input type="hidden" id="ListType" value='${ListType}'>
<table width="100%" border="0" cellspacing="6" cellpadding="0"
	style="border-collapse: separate; border-spacing: 6px;">
	<tr valign="top">
		<td>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="blockTable">
			<tr>
				<td width="65%" style="padding:6px 10px;" class="blockTd">
				 <div style="float: left;"><img src="imgs/Icons/icon018a1.gif" />文件列表</div><div style="float: right; white-space: nowrap;vertical-align:middle;">
				<a href='javascript:void(0);' class='micePushBtn' tabindex='-1' id='BtnAdd' onClick="add();"><img src="imgs/Icons/icon003a2.gif" width="20" height="20" /><b>上传&nbsp;</b></a> 
				<a href='javascript:void(0);' class='micePushBtn' tabindex='-1' id='BtnEdit' onClick="edit();return false;"><img src="imgs/Icons/icon003a4.gif" width="20" height="20" /><b>编辑&nbsp;</b></a> 
				<a href='javascript:void(0);' micetype='micePushBtn' class='micePushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnPreview' onClick="preview();return false;" priv="article_browse" ><img src="imgs/Icons/icon003a15.gif" width="20" height="20" /><b>预览&nbsp;</b></a> 
				<a href='javascript:void(0);' micetype='micePushBtn' class='micePushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnDel' onClick="del();return false;" priv="article_modify" ><img src="imgs/Icons/icon003a3.gif" width="20" height="20" /><b>删除&nbsp;</b></a></div>
				</td>
			</tr>
			<form action="<!--{$index}-->" method="post" id="form1" name="form1">
			<tr>
				<td style="padding:2px 10px;">&nbsp;&nbsp;<input name='filecategoryid' id='filecategoryid' type="hidden" value="<!--{$filecategoryid}-->">
				<input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>&nbsp;全选&nbsp;
				从:&nbsp;<input name="sdate" id="sdate" type="text" class="input1" size="14" micetype="Date" style="font-family: Arial; font-size: 10px;" value="<!--{$sdate}-->"/>&nbsp;到:&nbsp;
				<input name="edate" id="edate" type="text" class="input1" size="14" micetype="Date" style="font-family: Arial; font-size: 10px;" value="<!--{$edate}-->"/>&nbsp;
				关键字&nbsp;<input name='keywords' id='keywords' type="text" size="25" value="<!--{$keywords}-->" onblur="if(this.value=='') this.value='标题或简介中的部分文字';" onfocus="if(this.value=='标题或简介中的部分文字') this.value='';">&nbsp;<select name='orders' id='orders'>
									<option value='cd' <!--{if $orders eq "cd"}-->selected<!--{/if}-->>上传时间降序</option>		
									<option value='ca' <!--{if $orders eq "ca"}-->selected<!--{/if}-->>上传时间升序</option>
							  </select>&nbsp;&nbsp;<input type="submit" value="查 找">		
				</td>				
			</tr>
			<tr>
				<td style="padding-top:2px;padding-left:6px;padding-right:6px;padding-bottom:2px;">
<table width="100%" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF" id="contentlist">
<tr><td colspan="8">
<ul class="img-wrapper" style="height:190px; overflow:hidden; display:block; margin:0;">
<!--{foreach from=$filers item=rs name=counter}-->
	<li>
	<dl>
		<dt><a href='javascript:void(0);' hidefocus><em><img src='<!--{$smarty.const.MICE_URL}--><!--{$rs->getFilename()}-->' title='<!--{$rs->getTitle()}-->' border='0' onClick="window.open('<!--{$smarty.const.MICE_URL}--><!--{$rs->getFilename()}-->')"></em></a></dt>
		<dd><em><label><input name="checkbox[<!--{$rs->getFileId()}-->]" id="checkbox[<!--{$rs->getFileId()}-->]" type="checkbox" value="<!--{$rs->getFileId()}-->" url="<!--{$smarty.const.MICE_URL}--><!--{$rs->getFilename()}-->"><!--{$rs->getTitle()}--></label></em><a href='javascript:void(0);'><img src='imgs/Images/icon_zoomout.gif' alt='view' title='预览' onClick="window.open('<!--{$smarty.const.MICE_URL}--><!--{$rs->getFilename()}-->')"></a><a href='javascript:void(0);'><img src='imgs/Images/icon_edit15.gif' alt='edit' title='编辑' onClick="editid('<!--{$rs->getFileId()}-->');"></a><a href='<!--{$delete}--><!--{$rs->getFileId()}-->'><img src='imgs/Images/icon_delete15.gif' title='删除'></a><a href='javascript:void(0);'><img src='imgs/Images/icon_url.gif' alt='delete' title='复制URL' onClick="copyToClipboard('<!--{$smarty.const.MICE_URL}--><!--{$rs->getFilename()}-->');"></a></dd>
	</dl>
	</li>
	<!--{if $smarty.foreach.counter.iteration == 4}-->
	</ul><ul class="img-wrapper" style="height:190px; overflow:hidden; display:block; margin:0;">
	<!--{/if}-->	
<!--{/foreach}-->
</ul>
</td></tr>
<tr>
<td colspan="8" align="left" id="_PageBar_list"><div style='float:right;font-family:Tahoma'><!--{$pager}--></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr > 
		<td height="30" valign='middle'>
			<div id='_PageBar_buttom' class="pageBarWrap" style="padding-top:6px;clear:both;bottom:0px; height:30px; line-height:30px;"><div class="pageBar" style='float:right;font-family:Tahoma'></div><div style='float:left;font-family:Tahoma'>
			<a href='javascript:void(0);' class='micePushBtn' tabindex='-1' id='BtnAdd' onClick="add();"><img src="imgs/Icons/icon003a2.gif" width="20" height="20" /><b>上传&nbsp;</b></a> 
			<a href='javascript:void(0);' class='micePushBtn' tabindex='-1' id='BtnEdit' onClick="edit();return false;"><img src="imgs/Icons/icon003a4.gif" width="20" height="20" /><b>编辑&nbsp;</b></a> 
			<a href='javascript:void(0);' micetype='micePushBtn' class='micePushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnPreview' onClick="preview();return false;" priv="article_browse" ><img src="imgs/Icons/icon003a15.gif" width="20" height="20" /><b>预览&nbsp;</b></a> 
			<a href='javascript:void(0);' micetype='micePushBtn' class='micePushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnDel' onClick="del();return false;" priv="article_modify" ><img src="imgs/Icons/icon003a3.gif" width="20" height="20" /><b>删除&nbsp;</b></a></div></div>
		</td>
	</tr>
</table>
</td>
			</tr>
		</table>
		</td>
	</tr>
	</form>
</table>
</body>
</html>