<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/template/js/admin.js"></script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">栏目管理</a></li>
		</ul>
	</div>
	<div class="main">
		<fieldset>
		<legend>操作提示</legend>
		1：栏目排序必须为数字型；2：栏目名称不能为空。
		</fieldset>
		<table cellspacing="0" class="datalist" id="list">
		<tr>
			<th width="67" class="firstcol">排序</th>
			<th width="48">ID</th>
			<th width="250">栏目名称</th>
			<th width="180">名称调用</th>
			<th width="59">类型</th>
			<th width="80">状态</th>
			<th width="300">管理</th>
		</tr>
		<form action="" method="post" name="myform">
		<input type="hidden" name="do_submit" value="1" />
		<?php if($category){foreach($category as $_category){if(in_array($_category['id'],$_categorypriv) || $_roleid==1){?>
		<tr>
		  <td width="67" align="center"><input type="text" size="2" name="categoryorderby[<?php echo $_category['id'];?>]" value="<?php echo $_category['orderby'];?>" /></td>
			<td width="48" align="center"><?php echo $_category['id'];?></td>
	      <td width="250" align="left"><input type="text" size="15" name="categoryname[<?php echo $_category['id'];?>]" value="<?php echo $_category['categoryname'];?>" /></td>
		  <td width="180" align="center"><input type="text" size="25" readonly="1" ondblclick="javascript:copy('{{getCategoryname(<?php echo $_category['id'];?>)}}');"  value="{{getCategoryname(<?php echo $_category['id'];?>)}}" /></td>
			<td width="59" align="center"><?php echo $_category['ispage']?'<font color="#666666">单页</font>':'普通';?></td>
			<td width="80" align="center"><?php echo $_category['isshow']?'启用 <a href="'.ADMIN_FILE.'?file=content&action=category_lock&isshow=0&id='.$_category['id'].'"><u>禁用</u></a>':'<font color="#666666">禁用</font> <a href="'.ADMIN_FILE.'?file=content&action=category_lock&isshow=1&id='.$_category['id'].'"><u>启用</u></a>';?></td>
			<td width="300" align="center"><?php if($_category['ispage']){echo '<font color="#666666">添加栏目</font>';}else{?><a href="<?php echo ADMIN_FILE;?>?file=content&action=category_add&modelid=<?php echo $_category['modelid'];?>&parentid=<?php echo $_category['id'];?>"><u>添加栏目</u></a><?php }?> &nbsp;<?php if($_category['ispage']){echo '<font color="#666666">添加单页</font>';}else{?><a href="<?php echo ADMIN_FILE;?>?file=content&action=page_add&parentid=<?php echo $_category['id'];?>"><u>添加单页</u></a><?php }?> &nbsp;<a href="<?php echo ADMIN_FILE;?>?file=content&action=<?php echo $_category['ispage']?'page_edit':'category_edit';?>&id=<?php echo $_category['id'];?>"><u>配置</u></a> &nbsp;<a href="javascript:confirmUrl('确实要删除栏目 <?php echo $_category['categoryname'];?> 吗?该操作不可逆!','<?php echo ADMIN_FILE;?>?file=content&action=category_delete&id=<?php echo $_category['id'];?>')"><u>删除</u></a></td>
		</tr>
		<?php 
		tree ($_category['id']);
		}}?>
		<tr>
			<td colspan="7" align="left">
			<input type="button" onclick="this.form.submit();" class="submit" value="配置栏目" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="7">目前尚未添加任何栏目...</td></tr>	
		<?php }?>
		</table>
	</div>
</div>
</body>
</html>