<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<title>标签源码管理</title>
		<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="../static/web/css/admin.css">
		<link rel="stylesheet" href="css/codemirror.css">
		<script src="../static/web/js/jquery.min.js"></script>
		<script src="../static/web/js/bootstrap.min.js"></script>
		<script src="js/codemirror.js"></script>
		<script src="js/mode/xml/xml.js"></script>
		<script src="js/mode/javascript/javascript.js"></script>
		<script src="js/mode/css/css.js"></script>
		<script src="js/mode/php/php.js"></script>
		<script src="js/mode/clike/clike.js"></script>
		<script src="js/mode/htmlmixed/htmlmixed.js"></script>
		<script src="js/main.js"></script>
	</head>
	<body>
		<form method="POST" action="tpl.php" name=form1 onSubmit="return Post()">
			<input type="hidden" name="actiondo" value="<?php echo $action;?>">
			<input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>">
			<input type="hidden" name="action" value="savetagfile">
			<table cellpadding="3" cellspacing="1" align="center" class="table maintable my-3">
				<tr>
					<td bgcolor="#f5f5f5" colspan="2"><?php echo $title;?></td>
				</tr>
				<tr>
					<td colspan="2">
						<div class="alert alert-info mb-0">请先作好备份标签源码文件在进行修改，如果二次修改错误会导致标签无法解析。标签文件名为：标签名.lib.php接口函数定义为：function lib_标签名(&$ctag,&$refObj)，返回值是结果字符串，修改标签时为了防止出错，您也可以修改它的名称同时修改文件名和函数名，这样等同继承了原来标签的代码建立一个新的标签</div>
					</td>
				</tr>
				<tr>
					<td width="260">文件名称</td>
					<td>
						<input name="filename" value="<?php echo $filename;?>" class="admin-input-lg">
						<span>（不可以用“..”符号表示路径）</span>
					</td>
				</tr>
				<tr>
					<td colspan="2" class="p-0"><textarea id="content" name="content" class="admin-textarea-xl"><?php echo $democode;?></textarea></td>
				</tr>
				<tr>
					<td bgcolor="#f5f5f5" colspan="2" align="center">
						<button type="submit" name="B1" class="btn btn-success btn-sm">保存</button>
						<button type="button" name="B4" class="btn btn-outline-success btn-sm" onclick="javascript:history.go(-1);">返回</button>
					</td>
				</tr>
			</table>
		</form>
		<script>
			function Post() {
				if (document.form1.filename.value == "") {
					ShowMsg("文件名不能为空");
					document.form1.filename.focus();
					return false;
				}
			}
		</script>
		<script>
			var editor = CodeMirror.fromTextArea(document.getElementById('content'), {
				lineNumbers: true,
				lineWrapping: true,
				mode: 'text/x-php'
			});
		</script>
	</body>
</html>