Initial commit
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 25%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('add')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="index">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板名称</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$admin_lang==$key?'selected':''}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" id="template_editor" class="span11" style="height:500px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量说明</label>
|
||||
<div class="controls">
|
||||
<div class="div-li">网站名称:<input type="text" class="span6" value="[!--sitename--]"></div>
|
||||
<div class="div-li">页面关键字:<input type="text" class="span6" value="[!--pagekey--]"></div>
|
||||
<div class="div-li">页面描述:<input type="text" class="span6" value="[!--pagedes--]"></div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
function updateCode(){
|
||||
editor.setValue($("#template_editor").val());
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,107 @@
|
||||
<include file="Inc:head"/>
|
||||
<style>
|
||||
.control-label,b{color:green; font-weight: bold;}
|
||||
i{ color:#0081c2}
|
||||
</style>
|
||||
<div class="widget-box2" style="margin:0px;">
|
||||
|
||||
<div class="widget-content nopadding">
|
||||
|
||||
<literal>
|
||||
<cmsinfo catid="53,54" limit="20" id="array('GT',13)" checked="1" order="newstime desc">
|
||||
|
||||
</cmsinfo>
|
||||
</literal>
|
||||
|
||||
|
||||
<form class="form-horizontal" method="post" action="__SELF__" onsubmit="return save_form2(this)">
|
||||
<div class="control-group" style="font-size:14px; text-align: center; height: 40px; line-height: 40px;">标签规则</div>
|
||||
<div class="control-group">
|
||||
<div style="font-size:14px; margin-top:20px; margin-bottom:10px; margin-left: 2%;">
|
||||
<cmsinfo <b>sql</b>="" <b>table</b>="cms_news" <b>catid</b>="1,2,3" <b>checked</b>="1" <b>limit</b>="20" <b>order</b>="newstime desc" <b>附加字段</b>="附加字段值"><br>
|
||||
<a href="<literal>{$v.titleurl}</literal>"><literal>{$v.title}</literal></a><br>
|
||||
</cmsinfo>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" style="font-size:14px; text-align: center; height: 40px; line-height: 40px;">参数说明 [代表不是必填参数]</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">sql</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
支持sql语句,如果写了sql语句,后面所有参数都不起作用了(表名请使用大写前后分别加两个下划线,如:__CMS_NEWS__ 不需要加前缀)
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">*table</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
表名(不需要加前缀) <i>【注意:如果不使用sql方式,table和catid必须要定义一个,否则无法定位到数据表】</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">*catid</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
分类ID(多个分类之间用","号隔开) <i>【注意:如果不使用sql方式,table和catid必须要定义一个,否则无法定位到数据表】</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">checked</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
信息是否审核(1:审核通过 0:审核未通过) <i>【注意:非必要条件的话建议只查询审核通过的信息】</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">limit</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
条数限制(可以指定起始数,如5,10) <i>【注意:条数虽然不是必填参数,但为了节省服务器资源起见,最好带上条数限制】</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">order</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
排序(如:id desc)
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">附加字段</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
可以增加自定义字段,(如 sex="女"),支持表达式查询,如ID大于10的:id="array('GT',10)",<a href="http://document.thinkphp.cn/manual_3_2/express_query.html" target="_blank" style="color:blue;">更多语法</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">其它功能</label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
[field]带有中括号的字段为动态判断字段,如area="$_GET[area]",这里的字段值是一个$_GET变量,当$_GET[area]为空的时候程序会查询该字段为空的记录,但往往当值为空的时候表示我们不查询该字段,所以当用[area]="$_GET[area]"的时候,系统会判断$_GET[area]是否为有效值,当为空或者为0的时候则不查询
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" style="font-size:14px; text-align: center; height: 40px; line-height: 40px;">循环体说明</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><literal>{$v.}</literal></label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
所有字段的数组(需配字段名来调用,如栏目ID:<literal>{$v.catid}也可使用:{$v[catid]}</literal>数组方式。),支持函数,如时间:<literal>{$v.newstime|date="Y年m月d日",###}或 {:date("Y-m-d",$v[newstime])}</literal>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><literal>{$v.titleurl}</literal></label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
信息链接(根据栏目路径规则自动计算)
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><literal>{$no}</literal></label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
序号(从1开始)
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><literal>{$cat.}</literal></label>
|
||||
<div class="controls" style="margin-top:4px;">
|
||||
信息对应栏目的数组信息(如栏目名称:<literal>{$cat.name},也可使用:{$cat[name]}</literal>)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="submitted"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/foot"/>
|
||||
@@ -0,0 +1,110 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 25%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('editor')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="index">
|
||||
<input type="hidden" name="template_id" value="{$r.template_id}">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板名称</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" value="{$r.name}"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$key==$r[lang]?"selected":""}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" id="template_editor" class="span11" style="height:500px;">{$r.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量说明</label>
|
||||
<div class="controls">
|
||||
<div class="div-li">网站名称:<input type="text" class="span6" value="[!--sitename--]"></div>
|
||||
<div class="div-li">页面关键字:<input type="text" class="span6" value="[!--pagekey--]"></div>
|
||||
<div class="div-li">页面描述:<input type="text" class="span6" value="[!--pagedes--]"></div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
<a href="{:U('TemplateHistory/index',array('template_id'=>$r[template_id]))}" class="btn btn-primary iframe">查看历吏记录</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
function updateCode(){
|
||||
editor.setValue($("#template_editor").val());
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,80 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.table-bordered .icon-ok{ color:#468847}
|
||||
.table-bordered .icon-remove{ color:#ff0000}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
<div class="main_h1"><h1>{$pagetitle}</h1></div>
|
||||
<div class="main_add">
|
||||
<a class="btn btn-inverse" href="{:U('add')}">添加模板</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-content nopadding">
|
||||
<form method="post" action="__SELF__" onsubmit="return save_form2(this);" class="modelIndex">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">排序</th>
|
||||
<th width="5%">ID</th>
|
||||
<th width="40%">模型名称</th>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<th width="10%">语言</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th width="10%">默认</th>
|
||||
<th width="15%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<foreach name="data" item="v" >
|
||||
<tr>
|
||||
<td style="text-align: center;"><input type='text' value="{$v.sort}" name="sort[]" class="" style="width:30px;height:10px; margin:0px;"><input type='hidden' value="{$v.template_id}" name="template_id[]"></td>
|
||||
<td style="text-align: center;">{$v.template_id}</td>
|
||||
<td style="text-align: left;">{$v.name}</td>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<td class="center">{:$LANG_OPT[$v[lang]]?$LANG_OPT[$v[lang]]:'-'}</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td class="center">
|
||||
<if condition="$v.isdefault eq 1 ">
|
||||
<i class='icon-ok'></i>
|
||||
<else />
|
||||
<i class='icon-remove'></i>
|
||||
</if>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="{:U("setDefault",array("template_id"=>$v[template_id]))}" class="btn btn-success btn-mini ajax_del" confirm_info="确定要设为默认的首页吗?">设为默认</a>
|
||||
<a href="{:U("editor",array("template_id"=>$v[template_id]))}" class="btn btn-primary btn-mini">修改</a>
|
||||
<a href="{:U('delete',array("template_id"=>$v[template_id]))}" class="btn btn-danger btn-mini ajax_del">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-bottom">
|
||||
<button class="btn btn-success" onclick="$('.modelIndex').attr('action','{:U('sort')}');$('.modelIndex').submit();" type="button">修改顺序</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<include file="Inc/footer"/>
|
||||
@@ -0,0 +1,99 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 33%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('add')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="list">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板名称</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$admin_lang==$key?'selected':''}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" id="template_editor" class="span11" style="height:500px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
</div>
|
||||
<!--模板说明--><include file="Template/note/list"/><!--模板说明-->
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
function updateCode(){
|
||||
editor.setValue($("#template_editor").val());
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,102 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 25%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('editor')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="list">
|
||||
<input type="hidden" name="template_id" value="{$r.template_id}">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板名称</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" value="{$r.name}"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$key==$r[lang]?"selected":""}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" class="span11" id="template_editor" style="height:500px;">{$r.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
<a href="{:U('TemplateHistory/index',array('template_id'=>$r[template_id]))}" class="btn btn-primary iframe">查看历吏记录</a>
|
||||
</div>
|
||||
<!--模板说明--><include file="Template/note/list"/><!--模板说明-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
function updateCode(){
|
||||
editor.setValue($("#template_editor").val());
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,71 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.table-bordered .icon-ok{ color:#468847}
|
||||
.table-bordered .icon-remove{ color:#ff0000}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
<div class="main_h1"><h1>{$pagetitle}</h1></div>
|
||||
<div class="main_add">
|
||||
<a class="btn btn-inverse" href="{:U('listAdd')}">添加模板</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-content nopadding">
|
||||
<form method="post" action="__SELF__" onsubmit="return save_form2(this);" class="modelIndex">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">排序</th>
|
||||
<th width="5%">ID</th>
|
||||
<th width="40%">模板名称</th>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<th width="10%">语言</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th width="15%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<foreach name="data" item="v" >
|
||||
<tr>
|
||||
<td style="text-align: center;"><input type='text' value="{$v.sort}" name="sort[]" class="" style="width:30px;height:10px; margin:0px;"><input type='hidden' value="{$v.template_id}" name="template_id[]"></td>
|
||||
<td style="text-align: center;">{$v.template_id}</td>
|
||||
<td style="text-align: left;">{$v.name}</td>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<td class="center">{:$LANG_OPT[$v[lang]]?$LANG_OPT[$v[lang]]:'-'}</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td class="center">
|
||||
<a href="{:U("listEditor",array("template_id"=>$v[template_id]))}" class="btn btn-primary btn-mini">修改</a>
|
||||
<a href="{:U('delete',array("template_id"=>$v[template_id]))}" class="btn btn-danger btn-mini ajax_del">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-bottom">
|
||||
<button class="btn btn-success" onclick="$('.modelIndex').attr('action','{:U('sort')}');$('.modelIndex').submit();" type="button">修改顺序</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<include file="Inc/footer"/>
|
||||
@@ -0,0 +1,45 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量说明</label>
|
||||
<div class="controls">
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--sitename--]">:网站名称</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagekey--]">:页面关键字</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagedes--]">:页面描述</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--total--]">:信息统计</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--listpage--]">:分页</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--listpage_en--]">:英文分页</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--thumb--]">:缩略图</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$selfcat.xxx}</literal>">:当前栏目变量</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{:nav()}</literal>">:路径导航</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">循环体的值说明</label>
|
||||
<div class="controls">
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.title}</literal>">:标题</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.titleurl}</literal>">:链接</div>
|
||||
<div class="div-li"><input type="text" class="span6" value='<literal>{$v.newstime|date="Y年m月d日",###}</literal>'>:日期</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.views}</literal>">:点击数</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.goods}</literal>">:点赞数</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.sort}</literal>">:排序</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.catid}</literal>">:栏目ID</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.userid}</literal>">:发布者ID</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.username}</literal>">:发布者用户名</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.is_good}</literal>">:推荐级别</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.is_top}</literal>">:置顶级别</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$v.cat.xxx}</literal>">:对应栏目字段</div>
|
||||
<div class="div-li" title="默认从0开始,如果从1开始的话写:<literal>{$key+1}</literal>"><input type="text" class="span6" value="<literal>{$v.key}</literal>">:序号(从0开始)</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">循环规则</label>
|
||||
<div class="controls" style='font-weight: 900;'>
|
||||
<literal>
|
||||
<foreach name="data" item="v"><br>
|
||||
<li><a href="{$v.titleurl}">{$v.title}</a> [{$v.newstime|date="Y年m月d日",###}]</li><br>
|
||||
</foreach>
|
||||
</literal>
|
||||
<br>其中 data的值是固定的 item里的值可以改为自己需要的
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,104 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 25%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('add')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="public">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量标识</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" autocomplete="off"/> (如:公共头部)
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量名</label>
|
||||
<div class="controls">
|
||||
[!--public.<input type="text" name="myvar" class="span1" autocomplete="off"/> --] (如:header,变量就是[!--public.header--])
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$admin_lang==$key?'selected':''}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" id="template_editor" class="span11" style="height:500px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,107 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 25%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('editor')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="public">
|
||||
<input type="hidden" name="template_id" value="{$r.template_id}">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量标识</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" value="{$r.name}"/> (如:公共头部)
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量名</label>
|
||||
<div class="controls">
|
||||
[!--public.<input type="text" name="myvar" class="span1" value="{$r.myvar}"/> --] (如:header,变量就是[!--public.header--])
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$key==$r[lang]?"selected":""}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" id="template_editor" class="span11" style="height:500px;">{$r.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
<a href="{:U('TemplateHistory/index',array('template_id'=>$r[template_id]))}" class="btn btn-primary iframe">查看历吏记录</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
function updateCode(){
|
||||
editor.setValue($("#template_editor").val());
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,73 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.table-bordered .icon-ok{ color:#468847}
|
||||
.table-bordered .icon-remove{ color:#ff0000}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
<div class="main_h1"><h1>{$pagetitle}</h1></div>
|
||||
<div class="main_add">
|
||||
<a class="btn btn-inverse" href="{:U('publicAdd')}">添加模板</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-content nopadding">
|
||||
<form method="post" action="__SELF__" onsubmit="return save_form2(this);" class="modelIndex">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">排序</th>
|
||||
<th width="5%">ID</th>
|
||||
<th width="40%">模板名称</th>
|
||||
<th width="10%">模板变量名</th>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<th width="10%">语言</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th width="15%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<foreach name="data" item="v" >
|
||||
<tr>
|
||||
<td style="text-align: center;"><input type='text' value="{$v.sort}" name="sort[]" class="" style="width:30px;height:10px; margin:0px;"><input type='hidden' value="{$v.template_id}" name="template_id[]"></td>
|
||||
<td style="text-align: center;">{$v.template_id}</td>
|
||||
<td style="text-align: left;">{$v.name}</td>
|
||||
<td style="text-align: center;"><input value='[!--public.{$v.myvar}--]'></td>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<td class="center">{:$LANG_OPT[$v[lang]]?$LANG_OPT[$v[lang]]:'-'}</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td class="center">
|
||||
<a href="{:U("publicEditor",array("template_id"=>$v[template_id]))}" class="btn btn-primary btn-mini">修改</a>
|
||||
<a href="{:U('delete',array("template_id"=>$v[template_id]))}" class="btn btn-danger btn-mini ajax_del">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-bottom">
|
||||
<button class="btn btn-success" onclick="$('.modelIndex').attr('action','{:U('sort')}');$('.modelIndex').submit();" type="button">修改顺序</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<include file="Inc/footer"/>
|
||||
@@ -0,0 +1,71 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.table-bordered .icon-ok{ color:#468847}
|
||||
.table-bordered .icon-remove{ color:#ff0000}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
<div class="main_h1"><h1>{$pagetitle}</h1></div>
|
||||
<div class="main_add">
|
||||
<a class="btn btn-inverse" href="{:U('viewAdd')}">添加模板</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-content nopadding">
|
||||
<form method="post" action="__SELF__" onsubmit="return save_form2(this);" class="modelIndex">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">排序</th>
|
||||
<th width="5%">ID</th>
|
||||
<th width="40%">模板名称</th>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<th width="10%">语言</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th width="15%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<foreach name="data" item="v" >
|
||||
<tr>
|
||||
<td style="text-align: center;"><input type='text' value="{$v.sort}" name="sort[]" class="" style="width:30px;height:10px; margin:0px;"><input type='hidden' value="{$v.template_id}" name="template_id[]"></td>
|
||||
<td style="text-align: center;">{$v.template_id}</td>
|
||||
<td style="text-align: left;">{$v.name}</td>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<td class="center">{:$LANG_OPT[$v[lang]]?$LANG_OPT[$v[lang]]:'-'}</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td class="center">
|
||||
<a href="{:U("viewEditor",array("template_id"=>$v[template_id]))}" class="btn btn-primary btn-mini">修改</a>
|
||||
<a href="{:U('delete',array("template_id"=>$v[template_id]))}" class="btn btn-danger btn-mini ajax_del">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-bottom">
|
||||
<button class="btn btn-success" onclick="$('.modelIndex').attr('action','{:U('sort')}');$('.modelIndex').submit();" type="button">修改顺序</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<include file="Inc/footer"/>
|
||||
@@ -0,0 +1,122 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 25%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('add')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="view">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板名称</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$admin_lang==$key?'selected':''}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" id="template_editor" class="span11" style="height:500px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量说明</label>
|
||||
<div class="controls">
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--sitename--]">:网站名称</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagetitle--]">:页面标题</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagekey--]">:页面关键字</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagedes--]">:页面描述</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{:nav()}</literal>">:路径导航</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--preinfo--]">:上一篇</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--nextinfo--]">:下一篇</div>
|
||||
<div class="div-li"><input type="text" class="span6" value='<literal>{$r.newstime|date="Y年m月d日",###}</literal>'>:日期</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.views}</literal>">:点击数</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.goods}</literal>">:点赞数</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.sort}</literal>">:排序</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.catid}</literal>">:栏目ID</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.userid}</literal>">:发布者ID</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.username}</literal>">:发布者用户名</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.is_good}</literal>">:推荐级别</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.is_top}</literal>">:置顶级别</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.字段名}</literal>">:其它字段</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$selfcat.xxx}</literal>">:当前栏目变量</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{:htmlspecialchars_decode($r[newstext])}</literal>">:编辑器字段调用</div>
|
||||
<div class="div-li" style="clear:both;width:100%"><input type="text" class="span6" value="<literal><script src='/index.php/Home/View/getClick?catid={$r.cat.catid}&id={$r.id}'></script></literal>">:JS获取点击数(用于静态页面中动态获取)</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,130 @@
|
||||
<include file="Inc:header"/>
|
||||
<style>
|
||||
.div-li{ width: 25%; float: left; height: 40px; line-height 40px;}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="main_head">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="text-align:right; float:right"></div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget-box">
|
||||
<div class="widget-title"> <span class="icon"> <i class=" icon-align-justify"></i> </span>
|
||||
|
||||
<ul class="sub-nav">
|
||||
<li>{$pagetitle}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="widget-content nopadding">
|
||||
<form action="{:U('editor')}" method="post" class="form-horizontal" onsubmit="return this_submit(this);" >
|
||||
<input type="hidden" name="type" value="view">
|
||||
<input type="hidden" name="template_id" value="{$r.template_id}">
|
||||
<!--基本信息开始-->
|
||||
<div class="sub-nav-tab" style="display:block">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板名称</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" value="{$r.name}"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if(C('LANG_SWITCH_ON')){
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">语言</label>
|
||||
<div class="controls">
|
||||
<select name="lang">
|
||||
<option value="">请选择语言</option>
|
||||
<foreach name="LANG_OPT" item="v">
|
||||
<option value="{$key}" {$key==$r[lang]?"selected":""}>{$v}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">模板内容</label>
|
||||
<div class="controls">
|
||||
<textarea name="content" id="template_editor" class="span11" style="height:500px;">{$r.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">变量说明</label>
|
||||
<div class="controls">
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--sitename--]">:网站名称</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagetitle--]">:页面标题</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagekey--]">:页面关键字</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--pagedes--]">:页面描述</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{:nav()}</literal>">:路径导航</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--preinfo--]">:上一篇</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="[!--nextinfo--]">:下一篇</div>
|
||||
<div class="div-li"><input type="text" class="span6" value='<literal>{$r.newstime|date="Y年m月d日",###}</literal>'>:日期</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.views}</literal>">:点击数</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.goods}</literal>">:点赞数</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.sort}</literal>">:排序</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.catid}</literal>">:栏目ID</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.userid}</literal>">:发布者ID</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.username}</literal>">:发布者用户名</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.is_good}</literal>">:推荐级别</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.is_top}</literal>">:置顶级别</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$r.字段名}</literal>">:其它字段</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{$selfcat.xxx}</literal>">:当前栏目变量</div>
|
||||
<div class="div-li"><input type="text" class="span6" value="<literal>{:htmlspecialchars_decode($r[newstext])}</literal>">:编辑器字段调用</div>
|
||||
<div class="div-li" style="clear:both;width:100%"><input type="text" class="span6" value="<literal><script src='/index.php/Home/View/getClick?catid={$r.cat.catid}&id={$r.id}'></script></literal>">:JS获取点击数(用于静态页面中动态获取)</div>
|
||||
|
||||
<div class="div-li"></div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-success form_submit">提交</button>
|
||||
<button type="button" class="btn btn-danger" onclick="cancel()">返回</button>
|
||||
<a href="{:U('TemplateHistory/index',array('template_id'=>$r[template_id]))}" class="btn btn-primary iframe">查看历吏记录</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--基本信息结束-->
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Inc/footer"/>
|
||||
<include file="Inc/info_js"/>
|
||||
<!--代码编辑器插件-->
|
||||
<link rel="stylesheet" type="text/css" href="/Public/Admin/codemirror/lib/codemirror.css">
|
||||
<script src="/Public/Admin/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="/Public/Admin/codemirror/theme/abcdef.css">
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("template_editor"), {
|
||||
lineNumbers: true,
|
||||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
theme:"abcdef",
|
||||
});
|
||||
function this_submit(obj){
|
||||
$("#template_editor").val(editor.getValue());
|
||||
//这里为什么要延时的原因:因为editor.getValue()这个方法获取到代码需要时间计算的,如果不延时的话提交的是一个空值
|
||||
setTimeout(function(){
|
||||
save_form(obj);
|
||||
},200);
|
||||
return false;
|
||||
}
|
||||
function updateCode(){
|
||||
editor.setValue($("#template_editor").val());
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user