<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="source/admin/template/style/admin.css" rel="stylesheet" type="text/css" />
<script src="include/js/jsmain.js" type="text/javascript"></script>
<script charset="utf-8" src="include/js/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="include/js/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript">
var editor;
$(function(){
	fieldsinfo();
	$("#type").change(function(){
		fieldsinfo();
	});
});
function fieldsinfo(){
	if($("#type").attr("value")==1){
		KindEditor.remove('#body');
	}
	if($("#type").attr("value")==2){
		editor = KindEditor.create('#body',{
		fileManagerJson : '<?php echo $GLOBALS["G_DY"]["url"]["url_path_base"];?>?c=uploads&a=filemanager',
		allowFileManager : true,
		filePostName : 'editor_KindEditor',filterMode : false,
		uploadJson : '<?php echo $GLOBALS["G_DY"]["url"]["url_path_base"];?>?c=uploads&isfiles=editor_KindEditor'
		});
	}
}
</script>
</head>

<body>
<div class="maintop">当前位置：<?php echo $toptxt ?></div>
<?php if($postgo){ ?>
<div class="main"><div class="oper"><a href="?c=a_labelcus">编辑标签</a><a href="?c=a_labelcus&a=add">添加标签</a></div>
	<div class="info">
    <form action="?c=a_labelcus&a=<?php echo $postgo ?>&run=1" method="post">
    <input name="id" type="hidden" value="<?php echo $d['id'] ?>" />
    <dl><dt>标签名称：</dt><dd><input name="name" type="text" class="int" value="<?php echo $d['name'] ?>" /></dd></dl>
    <dl><dt>内容格式：</dt><dd><select name="type" id="type">
      <option value="1"<?php if($d['type']==1)echo ' selected="selected"'; ?>>文本</option>
      <option value="2"<?php if($d['type']==2)echo ' selected="selected"'; ?>>带编辑器文本</option>
    </select></dd></dl>
    <dl><dt>标签内容：</dt><dd><textarea name='body' id='body' class="int" style='width:670px; height:300px;'><?php echo $d['body'] ?></textarea></dd></dl>
    <dl><dt>&nbsp;</dt><dd><input type="submit" value="提 交" class="btnbig" /></dd></dl>
    </form>
    </div>
</div>
<?php }else{ ?>
<div class="main"><div class="oper"><a href="?c=a_labelcus">编辑标签</a><a href="?c=a_labelcus&a=add">添加标签</a></div>
<table width="100%" class="tablist">
  <tr class="trbg">
    <td width="40">ID</td>
    <td>标签名称</td>
    <td>调用方法</td>
    <td width="120">操作</td>
  </tr>
<?php foreach($lists as $v){ ?>
  <tr>
    <td><?php echo $v['id']; ?></td>
    <td class="tdleft"><a href="?c=a_labelcus&a=edit&id=<?php echo $v['id']; ?>"><?php echo $v['name']; ?></a></td>
    <td class="tdleft"><?php echo "标签名称： <span style='color:#C00'>{fun labelcus(".$v['id'].",'name')}</span>&nbsp;&nbsp;标签内容： <span style='color:#C00'>{fun labelcus(".$v['id'].",'body')}</span>"; ?></td>
    <td><a href="?c=a_labelcus&a=edit&id=<?php echo $v['id']; ?>">编辑</a>&nbsp;&nbsp;<a href="?c=a_labelcus&a=del&id=<?php echo $v['id']; ?>">删除</a></td>
  </tr>
<?php } ?>
</table>
</div>
<?php } ?>
</body>
</html>
