<?php include 'header.tpl.php';?>
<script>
function meOpendir(msgdir){
	frmSet("folder_path",msgdir);
	frmExecute('');
}
function meEdidDir(msgname){
	var obj_x=document.getElementById("id_folder_name");
	var strcontent="<div style='float:left;padding:10px;line-height:30px'>目录：<input type='hidden' id='id_folder_oldname' name='folder_oldname' value='"+msgname+"'><input type='text' id='id_folder_name' name='folder_name' value='"+msgname+"'><br><br>";
	strcontent+="<input type='button' name='btnSaveFun' value='确定' onclick=\"meSaveDir();\"></div>";
	if(obj_x){
		var obj_x2=document.getElementById("id_folder_oldname");
		obj_x.value=msgname;
		obj_x2.value=msgname;
	}
	dialog_show_cont("mefunname",strcontent,"修改目录",400,100);
}
function meSaveDir(){
	var obj_x=document.getElementById("id_folder_name");
	var obj_x2=document.getElementById("id_folder_oldname");
	if(obj_x2.value!="" && obj_x.value==""){
		alert("表输入目录名称！");
		return false;
	}
	document.frmMain.folder_name.value=obj_x.value;
	document.frmMain.folder_oldname.value=obj_x2.value;
	frmExecute("save_folder");
}
</script>
<div class="pMenu">
<li class="sel"><a href="javascript:frmExecute('');">管理</a></li>
<?php if($obj_ctl_limit->chk_act("edit")){?><li><a href="javascript:frmSet('filename','');frmExecute('edit');">添加模板</a></li><?php }?>
<?php if($obj_ctl_limit->chk_act("save_folder")){?><li><a href="javascript:meEdidDir('');">添加目录</a></li><?php }?>
<li class="info"><a href="javascript:inc_show_help(222);" style="color:#ff0000">帮助</a></li>
</div>
<div class="pArticleTopPath">
路径：<?php echo $this_folder_path;?>
</div>
<table class='pTableArticle'>
	<?php foreach($arr_dir as $item){ ?>
<tr class='pTabRow' id="id_row_<?php echo $item["name"]?>" onmouseover="admin_row_mouseover('<?php echo $item["name"];?>')" onmouseout="admin_row_mouseout('<?php echo $item["name"];?>');">
	<td class='pTabCol' width="30"><input type='checkbox' name='dirid[]' value='dir_<?php echo $item['name'];?>'></td><td class='pTabCol' ondblclick="meOpendir('<?php echo $get_folder_path."/".$item['name'];?>');"><img src="../images/folder.gif"> <?php echo $item['name'];?></td>
	<td class='pTabCol' width="150">
	<a href="javascript:meOpendir('<?php echo $get_folder_path."/".$item["name"];?>');">打开</a>&nbsp;
		<?php if($obj_ctl_limit->chk_act("save_folder")){?><img src="../images/b_edit.png" onclick="javascript:meEdidDir('<?php echo $item["name"];?>');" class="pImgbtn" title="编辑"><?php }?>
		<?php if($obj_ctl_limit->chk_act("del")){?>　<img src="../images/b_drop.png" onclick="javascript:frmSet('folder_name','<?php echo $item["name"];?>');frmExecute('del_folder');" class="pImgbtn" title="删除"><?php }?>
	</td></tr>
	<?php }?>
	<?php foreach($arr_file as $item){ ?>
<tr class='pTabRow' id="id_row_<?php echo $item["app"]?>" onmouseover="admin_row_mouseover('<?php echo $item["app"];?>')" onmouseout="admin_row_mouseout('<?php echo $item["app"];?>');">
	<td class='pTabCol' width="30"><input type='checkbox' name='fileid[]' value='<?php echo $item['app'];?>'></td><td class='pTabCol'ondblclick="window.open('<?echo $item['app']?>','_blank');"><img src="../images/file.jpg" >&nbsp;<a href="<?php echo WEB_URL;?>/index.php?apppath=<?php echo $item['path']?>&app=<?php echo $item['app']?>" target="_blank"><?php echo $item['name'];?></a></td>
	<td class='pTabCol' width="150">
		<?php if($obj_ctl_limit->chk_act("edit")){?><img src="../images/b_edit.png" onclick="javascript:frmSet('filename','<?php echo $item['name'];?>');frmExecute('edit');" class="pImgbtn" title="编辑"><?php }?>
		<?php if($obj_ctl_limit->chk_act("del")){?>　<img src="../images/b_drop.png" onclick="javascript:frmSet('filename','<?php echo $item["name"];?>');frmExecute('del_file');" class="pImgbtn" title="删除"><?php }?>
	</td></tr>
	<?php }?>
</table>
<?php include 'footer.tpl.php';?>		
