<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>刀客建站系统   管理中心  - 区块列表</title>
<%{include file="header.html"}%>
</head>
<body>
<h1>

<span class="action-span1"><a href="index.php?act=index.default_page">刀客建站系统   管理中心</a>  - 区块列表 &nbsp;&nbsp;<a href="index.php?act=help.get&h=template_settemplate&width=450"  class="jTip"  name="我希望获得更多帮助"><img src='images/help.png'></a></span>
<span class="action-span"><a href="index.php?act=template_set.settemplate">设置当前模板</a></span>
<span class="action-span"><a href="index.php?act=template_set.addblock">添加自定义区块</a></span>
<span style='float:right;margin-right:10px;'><img src='images/top_help.gif'><a href="http://sitepub.cn/help"> 帮助 </a></span>
<span style='float:right;margin-right:10px;'><img src='images/top_forum.gif'><a href="http://bbs.sitepub.cn"> 论坛 </a></span>
<div style="clear:both"></div>
</h1>
<div class="list-div">
<%{foreach from=$out.block_type_arr item=v key=k name=a}%>
<table width="100%" style='margin-bottom:30px;' >
	<tr ><th colspan=4  style='background:#F4FBE1'><b><%{$v.name|escape:html}%></b>&nbsp;&nbsp; <a href="index.php?act=template_set.addblock&block_type=<%{$k}%>">添加区块</a></th></tr>
	<%{if $out.block_type_res.$k}%>
	<tr>
    <th>区块名称</th>
    <th>库文件</th>
    <th>添加 / 修改时间</th>
    <th>操作</th>
  </tr>
	<%{foreach from=$out.block_type_res.$k item=v1 key=k1}%>
  	<tr>
		<td align=center><%{$v1.block_name|escape:html}%></td>
		<td align=center><%{$v1.lib_file}%> </td>
		<td align=center><%{$v1.update_time|date_format:"%Y-%m-%d %H:%I:%S"}%></td>
		<td align=center><a href="index.php?act=template_set.edit_block&block_id=<%{$v1.block_id}%>">编辑</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick='del_block(<%{$v1.block_id}%>,this)'>删除</a>&nbsp;&nbsp;</td>
	</tr>
	<%{/foreach}%>
	<%{/if}%>
</table>
<%{/foreach}%>
</div>
<script>
function del_block(block_id,obj)
{
	if(!window.confirm('确定删除该区块?该操作无法恢复!')){
		return false;	
	}
	$.ajax({
		url		:		"index.php?act=template_set.del_block&block_id="+block_id+"&is_ajax=1",
		dataType	:		"json",
		type		:		"GET",
		success	:		function(json){
			if(json=='ok'){
				alert('删除成功');
				$(obj).parent().parent().remove();
			}
		}
	});

}
</script>
</body>
</html>



