<?php include 'header.tpl.php';?>
<div class="pMenu">
<li class="sel"><a href="javascript:frmExecute('');">管理</a></li>
<?php if($obj_ctl_limit->chk_act("add_article")){?><li><a href="javascript:frmExecute('add_article');"><b><font color="#3A77D4">添加文章</font></b></a></li><?php }?>
<?php if($obj_ctl_limit->chk_act("add_folder")){?><li><a href="javascript:frmExecute('add_folder');">添加目录</a></li><?php }?>
<li><span onclick="div_show_hide('objSearch');" style="cursor:hand">查找</span></li>
<li><a href="javascript:frmSet('list_style','dir');frmSet('me_folder_id','0');frmExecute('');">按目录查看</a></li>
<li class="info"><a href="javascript:inc_show_help(213);" style="color:#ff0000">帮助</a></li>
</div>

<div class="pSearchDiv" id="objSearch" style="display:<?php if($get_issearch!="1")echo "none"?>">
<table class="sTab">
<tr><td>目录：<select name="s_folder_id"><option value="0">不限</option><?php echo $str_selfolder;?></select>　名称或关键字：<input type="text" name="s_title" value="<?php echo $get_s_title?>">　修改日期：<input type="text" name="s_updatetime1" value="<?echo $get_s_updatetime1?>" size=10 onblur="chkNoDateToNow('s_updatetime1');"><A href="javascript:setday(document.frmMain.s_updatetime1);"><img id=dimg1 src="../images/calendar.gif" width="34" height="21"align=absMiddle border=0></a> 到 <input type="text" name="s_updatetime2" value="<?php echo $get_s_updatetime2?>" size=10 onblur="chkNoDateToNow('s_updatetime2');"><A href="javascript:setday(document.frmMain.s_updatetime2);"><img id=dimg2 src="../images/calendar.gif" width="34" height="21"align=absMiddle border=0></a>　<input type="button" name="s_btnok" value="查找" class="pBtn" onclick="frmExecute('')"> 　<input type="button" name="s_btnok" value="清空" class="pBtn" onclick="meSearchClear();frmExecute('');"></td></tr>
</table>
</div>
<div class="pArticleTopPath">
路径：<?php echo $folder_path;?>
</div>
<table class='pTableArticle'>
	<?php foreach($arr_article as $item){ ?>
<tr class='pTabRow'>
	<td class='pTabCol' width="30"><input type='checkbox' name='articleid[]' value='<?php echo $item['article_id'];?>'></td><td class='pTabCol'ondblclick="window.open('<?echo $item['article_path']?>','_blank');"><img src="../images/file.jpg" >&nbsp;<a href="<?php echo WEB_URL;?>/index.php?apppath=<?php echo $this_app['path']?>&app=<?php echo $this_app['app']?>&id=<?php echo $item["article_id"];?>" target="_blank"><?php echo $item['article_title'];?></a>　<font style="color:#888888"><?php echo $item["article_attribute"];?></font></td>
	<td class='pTabCol' onmousedown="frmSet('id','<?php echo $item['article_id'];?>')" width="150">
		<?php if($obj_ctl_limit->chk_act("edit")){?><img src="../images/b_edit.png" onclick="javascript:frmExecute('edit_article');" class="pImgbtn" title="编辑"><?php }?>
		<?php if($obj_ctl_limit->chk_act("del")){?>　<img src="../images/b_drop.png" onclick="javascript:frmExecute('del_article');" class="pImgbtn" title="删除"><?php }?>
	</td></tr>
	<?php }?>
</table>
<div class="pPage">
<?php echo $page_split_page?>
</div>
<div class="pFootAct"><li><input type='checkbox' name='articleidall' value='1' onclick="checkbox_selall(this.form,'articleidall','articleid');checkbox_selall(this.form,'articleidall','folderid');">全选　<select name="selact" onchange="me_change(this.value);">
	<option value="">--操作--</option>
	<?php if($obj_ctl_limit->chk_act("attribute")){?><option value="attribute">设置属性</option><?php }?>
	<?php if($this_channel["channel_savehtml"]==1){?><option value="html_frame">生成HTML</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("del")){?><option value="del_sel">删除</option><?php }?>
	</select>&nbsp;<span id="id_attribute" style="display:none"><?php foreach($arr_article_attribute as $item){?>
<input type="checkbox" name="attribute_val[]" value="<?php echo $item?>"><?php echo $item;?><?php }?></span>
	&nbsp;<input type="button" name="btnExe" value="执行" onclick="frmExecute(frmMain.selact.value);" class="pBtn">
	　　　<input type="button" name="btncopy" value="复制" onclick="articlecopy()" class="pBtn">　<input type="button" name="btncut" value="剪贴" onclick="articlecut()" class="pBtn">  <span id="id_paste_folder" style="display:none">要粘贴到的目录：<?php echo $str_paste_folder;?></span>　<input type="button" name="btnpaste" value="粘贴" onclick="me_showpaste();" class="pBtn" <?php if($get_folderids==""&&$get_articleids=="")echo "disabled"?>>
	<br><br><font color="#ff8800">(提示：生成html 时，如果没选择，则行把所有文件，如果选择目录，则生成该目录下所有文件)</font>
	</li>
</div>
<script>
function me_change(msgx){
	obj_x=document.getElementById("id_attribute");
	if(msgx=="attribute"){
		obj_x.style.display="";
	}else{
		obj_x.style.display="none";
	}
}
function me_showpaste(){
	if(document.frmMain.btnpaste.value!="确定"){
		document.getElementById("id_paste_folder").style.display="";
		document.frmMain.btnpaste.value="确定";
	}else{
		str_val=document.getElementById("paste_folder").value;
		arr_x=str_val.split(",");
		if(arr_x[1]){
			document.frmMain.me_folder_id.value=arr_x[1];
			frmExecute('paste');
		}
	}
}
function articlecopy()
{
	var folderids="";
	folderids=checkbox_get_val(document.frmMain,"folderid");
	articleids=checkbox_get_val(document.frmMain,"articleid");
	if(folderids==""&&articleids==""){
		alert('请选择要复制的文件或文件夹！');
		return false;
	}
	document.frmMain.btnpaste.disabled=false;
	document.frmMain.folderids.value=folderids;
	document.frmMain.articleids.value=articleids;
	document.frmMain.article_act.value="copy";
	alert("成功复制！");
}
function articlecut()
{
	var folderids="";
	folderids=checkbox_get_val(document.frmMain,"folderid");
	articleids=checkbox_get_val(document.frmMain,"articleid");
	if(folderids==""&&articleids==""){
		alert('请选择要剪贴的文件或文件夹！');
		return false;
	}
	document.frmMain.btnpaste.disabled=false;
	document.frmMain.folderids.value=folderids;
	document.frmMain.articleids.value=articleids;
	document.frmMain.article_act.value="cut";
	alert("成功剪贴！");
}

</script>
<?php include 'footer.tpl.php';?>		
