123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954 |
- {include file='common/head.html'}
-
- <div class="layui-body">
- {if([$list])}
- <div class="layui-tab layui-tab-brief" lay-filter="tab">
- <ul class="layui-tab-title">
- <li class="layui-this" lay-id="t1">{$model_name}内容</li>
- <li lay-id="t2">{$model_name}新增</li>
- </ul>
- <div class="layui-tab-content">
- <div class="layui-tab-item layui-show">
- <form action="{url./admin/Content/index/mcode/'.get('mcode').'}" method="get" class="layui-form">
- <div class="layui-form-item nospace">
- <div class="layui-input-inline">
- {$pathinfo}
- <select name="scode">
- <option value="">全部栏目</option>
- {$search_select}
- </select>
- </div>
- <div class="layui-input-inline">
- <input type="text" name="keyword" value="{$get.keyword}" placeholder="请输入搜索关键字" class="layui-input">
- </div>
- <div class="layui-input-inline">
- <button class="layui-btn" lay-submit>搜索</button>
- <a class="layui-btn layui-btn-primary" href="{url./admin/Content/index/mcode/'.get('mcode').'}">清除搜索</a>
- </div>
- </div>
-
-
- </form>
-
- <form action="{url./admin/Content/mod}" method="post" id="contentForm" name="contentForm" class="layui-form" onkeydown="if(event.keyCode==13) return false;">
- <input type="hidden" name="formcheck" value="{$formcheck}" >
- <table class="layui-table">
- <thead>
- <tr>
- <th><input type="checkbox" class="checkbox" lay-ignore id="checkall" title="全选"></th>
- <th>ID</th>
- <th>栏目</th>
- <th>标题</th>
- <th>发布时间</th>
- <th>排序</th>
- <th>状态</th>
- <th>置顶</th>
- <th>推荐</th>
- <th>访问量</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- {foreach $contents(key,value)}
- <tr>
- <td>
- <input type="checkbox" class="checkbox checkitem" lay-ignore name="list[]" {if($value->outlink)}disabled{/if} value="[value->id]">
- <input type="hidden" name="listall[]" value="[value->id]">
- </td>
- <td>[value->id]</td>
- <td title="[value->scode]">[value->sortname]</td>
- <td title="[value->title]">
- {fun=substr_both($value->title,0,15)}
- {if($value->isheadline)}
- <span class="layui-badge layui-bg-blue">头</span>
- {/if}
- {if($value->ico)}
- <span class="layui-badge layui-bg-orange">缩</span>
- {/if}
- {if($value->pics)}
- <span class="layui-badge">图</span>
- {/if}
- {if($value->outlink)}
- <span class="layui-badge layui-bg-black">链</span>
- {/if}
- </td>
- <td>[value->date]</td>
- <td class="table-input"><input type="text" lay-ignore class="layui-input" name="sorting[]" value="[value->sorting]"></td>
- <td>
- {if($value->status)}
- <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
- {else}
- <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
- {/if}
- </td>
- <td>
- {if($value->istop)}
- <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
- {else}
- <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
- {/if}
- </td>
- <td>
- {if($value->isrecommend)}
- <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
- {else}
- <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
- {/if}
- </td>
- <td>[value->visits]</td>
- <td>
- {if(!$value->outlink)}
- {php}
- $Parser=new app\home\controller\ParserController();
- $link=$Parser->parserLink(2,$value->urlname,'content',$value->scode,$value->sortfilename,$value->id,$value->filename);
- {/php}
-
- <input type="hidden" name="urls[[value->id]]" value="{php}echo $link{/php}">
- <a href='{php}
- $link = str_replace(".html","",$link);
- echo $link;{/php}' class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
- {/if}
- {fun=get_btn_del($value->id)}
- {if(check_level('mod'))}
- <a href="{url./admin/Content/mod/mcode/'.get('mcode').'/id/'.$value->id.'}{$btnqs}" class="layui-btn layui-btn-xs" >修改</a>
- {/if}
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
-
-
- <div class="layui-inline" style="float:right">
- <select lay-filter="tourl" class="page-select" >
- <option value="" selected="">每页显示数量</option>
- <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/20}" {if(get('pagesize')==20)}selected{/if}>20条/页</option>
- <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/30}" {if(get('pagesize')==30)}selected{/if}>30条/页</option>
- <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/50}" {if(get('pagesize')==50)}selected{/if}>50条/页</option>
- <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/60}" {if(get('pagesize')==60)}selected{/if}>60条/页</option>
- <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/100}" {if(get('pagesize')==100)}selected{/if}>100条/页</option>
- <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/150}" {if(get('pagesize')==150)}selected{/if}>150条/页</option>
- <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/200}" {if(get('pagesize')==200)}selected{/if}>200条/页</option>
- </select>
- </div>
-
- <div class="layui-input-inline">
- <select name="scode">
- <option value="">请选择移动/复制到栏目</option>
- {$search_select}
- </select>
- </div>
-
- <div class="layui-btn-group">
- {if(check_level('mod'))}
- <button type="submit" name="submit" value="copy" class="layui-btn layui-btn-sm">复制</button>
- <button type="submit" name="submit" value="move" class="layui-btn layui-btn-sm">移动</button>
- {/if}
-
- {if(check_level('del'))}
- <button type="submit" name="submit" onclick="return setDelAction();" class="layui-btn layui-btn-sm">批量删除</button>
- {/if}
-
- {if(check_level('mod'))}
- <button type="submit" name="submit" value="sorting" class="layui-btn layui-btn-sm">保存排序</button>
- {if([$baidu_zz_token])}
- <button type="submit" name="submit" value="baiduzz" class="layui-btn layui-btn-sm">百度普通推送</button>
- {/if}
- {if([$baidu_ks_token])}
- <button type="submit" name="submit" value="baiduks" class="layui-btn layui-btn-sm">百度快速推送</button>
- {/if}
- {/if}
- </div>
- <script>
- function setDelAction(){
- document.contentForm.action = "{url./admin/Content/del}";
- return confirm("您确定要删除选中的内容么?");
- }
- </script>
-
- <div class="page">
- {$pagebar}
-
- </div>
- </form>
- </div>
-
- <div class="layui-tab-item">
- <form action="{url./admin/Content/add/mcode/'.get('mcode').'}" method="post" class="layui-form" lay-filter="content" id="edit">
- <input type="hidden" name="formcheck" value="{$formcheck}" >
- <div class="layui-tab">
- <ul class="layui-tab-title">
- <li class="layui-this">基本内容</li>
- <li>高级内容</li>
- </ul>
- <div class="layui-tab-content">
- <div class="layui-tab-item layui-show">
- <div class="layui-form-item">
- <label class="layui-form-label">内容栏目 <span class="layui-text-red">*</span></label>
- <div class="layui-input-block">
- <select name="scode" lay-verify="required">
- <option value="">请选择内容栏目</option>
- {$sort_select}
- </select>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">内容标题 <span class="layui-text-red">*</span></label>
- <div class="layui-input-block">
- <input type="text" name="title" required lay-verify="required" placeholder="请输入内容标题" class="layui-input">
- </div>
- </div>
-
- {foreach $extfield(key,value)}
- {if($value->type==1)} <!-- 单行文本 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <input type="text" name="[value->name]" placeholder="请输入[value->description]" class="layui-input">
- </div>
- </div>
- {/if}
-
- {if($value->type==2)}<!-- 多行文本 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <textarea name="[value->name]" class="layui-textarea" placeholder="请输入[value->description]"></textarea>
- </div>
- </div>
- {/if}
-
- {if($value->type==3)}<!-- 单选 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <div>
- {php}
- $radios=explode(',',$value->value);
- foreach ($radios as $value2) {
- echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'">';
- }
- {/php}
- </div>
- </div>
- </div>
- {/if}
-
- {if($value->type==4)}<!-- 多选 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <div>
- {php}
- $checkboxs=explode(',',$value->value);
- foreach ($checkboxs as $value2) {
- echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'">';
- }
- {/php}
- </div>
- </div>
- </div>
- {/if}
-
- {if($value->type==5)}<!-- 图片 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-inline">
- <input type="text" name="[value->name]" id="[value->name]" placeholder="请上传[value->description]" class="layui-input">
- </div>
- <button type="button" class="layui-btn upload watermark" data-des="[value->name]">
- <i class="layui-icon"></i>上传图片
- </button>
- <div id="[value->name]_box" class="pic"></div>
- </div>
- {/if}
-
- {if($value->type==10)}<!-- 多图片 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-inline">
- <input type="text" name="[value->name]" id="[value->name]" placeholder="请上传[value->description]" class="layui-input">
- </div>
- <button type="button" class="layui-btn uploads watermark" data-des="[value->name]">
- <i class="layui-icon"></i>上传多图
- </button>
- <div id="[value->name]_box" class="pic addedit"><dl></dl> <!-- 规避空内容拖动bug --></div>
- </div>
- {/if}
-
- {if($value->type==6)}<!-- 文件 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-inline">
- <input type="text" name="[value->name]" id="[value->name]" placeholder="请上传[value->description]" class="layui-input">
- </div>
- <button type="button" class="layui-btn file" data-des="[value->name]">
- <i class="layui-icon"></i>上传文件
- </button>
- </div>
- {/if}
-
- {if($value->type==7)}<!-- 日期 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <input type="text" name="[value->name]" readonly placeholder="请选择[value->description]" class="layui-input datetime">
- </div>
- </div>
- {/if}
-
- {if($value->type==8)}<!-- 编辑器 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <script type="text/plain" id="editor_[value->name]" name="[value->name]" style="width:100%;height:240px;"></script>
- <script>
- //初始化编辑器
- $(document).ready(function (e) {
- var ue = UE.getEditor('editor_[value->name]',{
- maximumWords:10000
- });
- })
- </script>
- </div>
- </div>
- {/if}
-
- {if($value->type==9)}<!-- 下拉 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <select name="[value->name]">
- {php}
- $selects=explode(',',$value->value);
- foreach ($selects as $value2) {
- echo '<option value="'.$value2.'">'.$value2.'</option>';
- }
- {/php}
- </select>
- </div>
- </div>
- {/if}
-
- {/foreach}
-
- <div class="layui-form-item">
- <label class="layui-form-label">内容</label>
- <div class="layui-input-block">
- <script type="text/plain" id="editor" name="content" style="width:100%;height:240px;"></script>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">tags</label>
- <div class="layui-input-block">
- <input type="text" name="tags" placeholder="请输入文章tag,英文逗号隔开" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">作者</label>
- <div class="layui-input-block">
- <input type="text" name="author" placeholder="请输入作者" value="{$session.realname}" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">来源</label>
- <div class="layui-input-block">
- <input type="text" name="source" placeholder="请输入来源" value="本站" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">缩略图</label>
- <div class="layui-input-inline">
- <input type="text" name="ico" id="ico" placeholder="请上传缩略图" class="layui-input">
- </div>
- <button type="button" class="layui-btn upload watermark" data-des="ico">
- <i class="layui-icon"></i>上传图片
- </button>
- <div id="ico_box" class="pic addedit"></div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">轮播多图</label>
- <div class="layui-input-inline">
- <input type="text" name="pics" id="pics" placeholder="请上传轮播多图" class="layui-input">
- </div>
- <button type="button" class="layui-btn uploads watermark" data-des="pics">
- <i class="layui-icon"></i>上传多图
- </button>
- <div id="pics_box" class="pic addedit"><dl></dl> <!-- 规避空内容拖动bug --></div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">参数</label>
- <div class="layui-input-block">
- <input type="checkbox" name="istop" value="1" title="置顶">
- <input type="checkbox" name="isrecommend" value="1" title="推荐">
- <input type="checkbox" name="isheadline" value="1" title="头条">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">浏览权限</label>
- <div class="layui-input-block">
- <select name="gid">
- <option value="">不限制</option>
- {foreach $groups(key,value)}
- <option value="[value->id]">[value->gname]</option>
- {/foreach}
- </select>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">权限类型</label>
- <div class="layui-input-block">
- <select name="gtype" id="gtype" >
- <option value="1">小于</option>
- <option value="2">小于等于</option>
- <option value="3">等于</option>
- <option value="4" selected>大于等于</option>
- <option value="5">大于</option>
- </select>
- </div>
- </div>
- </div>
-
- <div class="layui-tab-item ">
- <div class="layui-form-item">
- <label class="layui-form-label">内容副栏目</label>
- <div class="layui-input-block">
- <select name="subscode">
- <option value="">请选择内容副栏目</option>
- {$subsort_select}
- </select>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">标题颜色</label>
- <div class="layui-input-inline">
- <input type="text" name="titlecolor" placeholder="请选择标题颜色" value="#333333" class="layui-input jscolor {hash:true}">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">副标题</label>
- <div class="layui-input-block">
- <input type="text" name="subtitle" placeholder="请输入副标题" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">URL名称</label>
- <div class="layui-input-block">
- <input type="text" name="filename" placeholder="请输入URL名称,如:test,test/a/b" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">跳转外链接</label>
- <div class="layui-input-block">
- <input type="text" name="outlink" placeholder="请输入跳转外链接" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">权限不足提示</label>
- <div class="layui-input-block">
- <input type="text" name="gnote" placeholder="请输入权限不足时提示文本" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">发布时间</label>
- <div class="layui-input-inline">
- <input type="text" name="date" value="{fun=date('Y-m-d H:i:s')}" readonly placeholder="请选择发布时间" class="layui-input datetime">
- </div>
- <div class="layui-form-mid layui-word-aux">温馨提示:设置未来时间可定时发布!</div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">附件</label>
- <div class="layui-input-inline">
- <input type="text" name="enclosure" id="enclosure" placeholder="请上传附件" class="layui-input">
- </div>
- <button type="button" class="layui-btn file" data-des="enclosure">
- <i class="layui-icon"></i>上传附件
- </button>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">SEO关键字</label>
- <div class="layui-input-block">
- <input type="text" name="keywords" placeholder="请输入详情页SEO关键字" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">SEO描述</label>
- <div class="layui-input-block">
- <textarea name="description" placeholder="请输入详情页SEO描述" class="layui-textarea"></textarea>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">状态</label>
- <div class="layui-input-block">
- <input type="radio" name="status" value="1" title="显示" checked>
- <input type="radio" name="status" value="0" title="隐藏">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="layui-btn" lay-submit>立即提交</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- {/if}
-
- {if([$mod])}
-
- <div class="layui-tab layui-tab-brief" lay-filter="tab">
- <ul class="layui-tab-title">
- <li class="layui-this">{$model_name}内容修改</li>
- </ul>
- <div class="layui-tab-content">
- <div class="layui-tab-item layui-show">
- <form action="{url./admin/Content/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form" id="edit">
- <input type="hidden" name="formcheck" value="{$formcheck}" >
- <div class="layui-tab">
- <ul class="layui-tab-title">
- <li class="layui-this">基本内容</li>
- <li>高级内容</li>
- </ul>
- <div class="layui-tab-content">
- <div class="layui-tab-item layui-show">
- <div class="layui-form-item">
- <label class="layui-form-label">内容栏目 <span class="layui-text-red">*</span></label>
- <div class="layui-input-block">
- <select name="scode" lay-verify="required">
- <option value="">请选择内容栏目</option>
- {$sort_select}
- </select>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">内容标题 <span class="layui-text-red">*</span></label>
- <div class="layui-input-block">
- <input type="text" name="title" required lay-verify="required" value="{$content->title}" placeholder="请输入内容标题" class="layui-input">
- </div>
- </div>
-
- {foreach $extfield(key,value)}
- {if($value->type==1)} <!-- 单行文本 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <input type="text" name="[value->name]" value="{$content->{$value->name}}" placeholder="请输入[value->description]" class="layui-input">
- </div>
- </div>
- {/if}
-
- {if($value->type==2)}<!-- 多行文本 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <textarea name="[value->name]" class="layui-textarea" placeholder="请输入[value->description]">{php}$name=$value->name;echo str_replace('<br>', "\r\n",$this->vars['content']->$name);{/php}</textarea>
- </div>
- </div>
- {/if}
-
- {if($value->type==3)}<!-- 单选 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <div>
- {php}
- $radios=explode(',',$value->value);
- $name=$value->name;
- foreach ($radios as $value2) {
- if($this->vars['content']->$name==$value2){
- echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'" checked>';
- }else{
- echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'">';
- }
- }
- {/php}
- </div>
- </div>
- </div>
- {/if}
-
- {if($value->type==4)}<!-- 多选 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <div>
-
- {php}
- $checkboxs=explode(',',$value->value);
- $name=$value->name;
- echo '<input name="'.$value->name.'" type="hidden">';//占位清空
- $values=explode(',',$this->vars['content']->$name);
- foreach ($checkboxs as $value2) {
- if(in_array($value2,$values)){
- echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'" checked>';
- }else{
- echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'">';
- }
- }
- {/php}
- </div>
- </div>
- </div>
- {/if}
-
- {if($value->type==5)}<!-- 图片 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-inline">
- <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
- </div>
- <button type="button" class="layui-btn upload watermark" data-des="[value->name]">
- <i class="layui-icon"></i>上传图片
- </button>
- {php}$name=$value->name; {/php}
- <div id="[value->name]_box" class="pic"><dl><dt>{if([$content]->$name)}<img src='{SITE_DIR}{$content->{$value->name}}' data-url="{$content->{$value->name}}"></dt><dd>删除</dd></dl>{/if}</div>
- </div>
- {/if}
-
- {if($value->type==10)}<!-- 多图 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-inline">
- <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
- </div>
- <button type="button" class="layui-btn uploads watermark" data-des="[value->name]">
- <i class="layui-icon"></i>上传多图
- </button>
- <div id="[value->name]_box" class="pic addedit">
- <dl></dl> <!-- 规避空内容拖动bug -->
- {php}
- $name=$value->name;
- if([$content->$name]){
- $pics=explode(',',[$content->$name]);
- }else{
- $pics = array();
- }
- foreach ($pics as $key=>$value) {
- //需要留一个空,不然被解析为标签了
- echo "<dl><dt><img src='".SITE_DIR.$value."' data-url='".$value."'></dt><dd>删除</dd></dl>";
- }
- {/php}
- </div>
- </div>
-
- {/if}
-
- {if($value->type==6)}<!-- 文件 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-inline">
- <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
- </div>
- <button type="button" class="layui-btn file" data-des="[value->name]">
- <i class="layui-icon"></i>上传文件
- </button>
- </div>
- {/if}
-
- {if($value->type==7)}<!-- 日期 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <input type="text" name="[value->name]" value="{$content->{$value->name}}" readonly placeholder="请选择[value->description]" class="layui-input datetime">
- </div>
- </div>
- {/if}
-
- {if($value->type==8)}<!-- 编辑器 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- {php}
- $name=@$value->name;
- {/php}
- <script type="text/plain" id="editor_[value->name]" name="[value->name]" style="width:100%;height:240px;">{fun=decode_string([$content->$name])}</script>
- <script>
- //初始化编辑器
- $(document).ready(function (e) {
- var ue = UE.getEditor('editor_[value->name]',{
- maximumWords:10000
- });
- })
- </script>
- </div>
- </div>
- {/if}
-
- {if($value->type==9)}<!-- 下拉 -->
- <div class="layui-form-item">
- <label class="layui-form-label">[value->description]</label>
- <div class="layui-input-block">
- <select name="[value->name]">
- {php}
- $selects=explode(',',$value->value);
- $name=$value->name;
- foreach ($selects as $value2) {
- if($this->vars['content']->$name==$value2){
- echo '<option value="'.$value2.'" selected>'.$value2.'</option>';
- }else{
- echo '<option value="'.$value2.'">'.$value2.'</option>';
- }
- }
- {/php}
- </select>
- </div>
- </div>
- {/if}
-
- {/foreach}
-
- <div class="layui-form-item">
- <label class="layui-form-label">内容</label>
- <div class="layui-input-block">
- <script type="text/plain" id="editor" name="content" style="width:100%;height:240px;">{fun=decode_string([$content->content])}</script>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">tags</label>
- <div class="layui-input-block">
- <input type="text" name="tags" placeholder="请输入文章tag,英文逗号隔开" value="{$content->tags}" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">作者</label>
- <div class="layui-input-block">
- <input type="text" name="author" placeholder="请输入作者" value="{$content->author}" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">来源</label>
- <div class="layui-input-block">
- <input type="text" name="source" placeholder="请输入来源" value="{$content->source}" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">缩略图</label>
- <div class="layui-input-inline">
- <input type="text" name="ico" id="ico" value="{$content->ico}" placeholder="请上传缩略图" class="layui-input">
- </div>
- <button type="button" class="layui-btn upload watermark" data-des="ico">
- <i class="layui-icon"></i>上传图片
- </button>
- <div id="ico_box" class="pic addedit">{if([$content->ico])}<dl><dt><img src="{SITE_DIR}{$content->ico}" data-url="{$content->ico}"></dt><dd>删除</dd></dl>{/if}</div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">轮播多图</label>
- <div class="layui-input-inline">
- <input type="text" name="pics" id="pics" value="{$content->pics}" placeholder="请上传轮播多图" class="layui-input">
- </div>
- <button type="button" class="layui-btn uploads watermark" data-des="pics">
- <i class="layui-icon"></i>上传多图
- </button>
- <div id="pics_box" class="pic addedit">
- <dl></dl> <!-- 规避空内容拖动bug -->
- {php}
- if([$content->pics]){
- $pics=explode(',',[$content->pics]);
- }else{
- $pics = array();
- }
- if([$content->picstitle]){
- $picstitle=explode(',',[$content->picstitle]);
- }else{
- $picstitle = array();
- }
- foreach ($pics as $key=>$value) {
- //需要留一个空,不然被解析为标签了
- echo "<dl><dt><img src='".SITE_DIR.$value."' data-url='".$value."'></dt><dd>删除</dd><dt><input type='text' value='".$picstitle[$key ]."' name='picstitle[]' style='width:95%' /></dt></dl>";
- }
- {/php}
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">状态</label>
- <div class="layui-input-block">
- <input type="checkbox" name="istop" value="1" title="置顶" {if([$content->istop]==1)}checked{/if}>
- <input type="checkbox" name="isrecommend" value="1" title="推荐" {if([$content->isrecommend]==1)}checked{/if}>
- <input type="checkbox" name="isheadline" value="1" title="头条" {if([$content->isheadline]==1)}checked{/if}>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">浏览权限</label>
- <div class="layui-input-block">
- <select name="gid">
- <option value="">不限制</option>
- {foreach $groups(key,value)}
- <option value="[value->id]" {if([$content->gid]==$value->id)}selected="selected"{/if}>[value->gname]</option>
- {/foreach}
- </select>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">权限类型</label>
- <div class="layui-input-block">
- <select name="gtype" id="gtype" >
- <option value="1" {if([$content->gtype]==1)}selected="selected"{/if}>小于</option>
- <option value="2" {if([$content->gtype]==2)}selected="selected"{/if}>小于等于</option>
- <option value="3" {if([$content->gtype]==3)}selected="selected"{/if}>等于</option>
- <option value="4" {if([$content->gtype]==4||(![$sort->gtype]))}selected="selected"{/if}>大于等于</option>
- <option value="5" {if([$content->gtype]==5)}selected="selected"{/if}>大于</option>
- </select>
- </div>
- </div>
-
- </div>
-
- <div class="layui-tab-item ">
- <div class="layui-form-item">
- <label class="layui-form-label">内容副栏目</label>
- <div class="layui-input-block">
- <select name="subscode">
- <option value="">请选择内容副栏目</option>
- {$subsort_select}
- </select>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">标题颜色</label>
- <div class="layui-input-inline">
- <input type="text" name="titlecolor" value="{$content->titlecolor}" placeholder="请选择标题颜色" class="layui-input jscolor {hash:true}">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">副标题</label>
- <div class="layui-input-block">
- <input type="text" name="subtitle" value="{$content->subtitle}" placeholder="请输入副标题" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">URL名称</label>
- <div class="layui-input-block">
- <input type="text" name="filename" value="{$content->filename}" placeholder="请输入URL名称,如:test,test/a/b" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">跳转外链接</label>
- <div class="layui-input-block">
- <input type="text" name="outlink" value="{$content->outlink}" placeholder="请输入跳转外链接" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">权限不足提示</label>
- <div class="layui-input-block">
- <input type="text" name="gnote" value="{$content->gnote}" placeholder="请输入权限不足时提示文本" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">发布时间</label>
- <div class="layui-input-inline">
- <input type="text" name="date" value="{$content->date}" readonly placeholder="请选择发布时间" class="layui-input datetime">
- </div>
- <div class="layui-form-mid layui-word-aux">温馨提示:设置未来时间可定时发布!</div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">附件</label>
- <div class="layui-input-inline">
- <input type="text" name="enclosure" id="enclosure" value="{$content->enclosure}" placeholder="请上传附件" class="layui-input">
- </div>
- <button type="button" class="layui-btn file" data-des="enclosure">
- <i class="layui-icon"></i>上传附件
- </button>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">SEO关键字</label>
- <div class="layui-input-block">
- <input type="text" name="keywords" value="{$content->keywords}" placeholder="请输入详情页SEO关键字" class="layui-input">
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">SEO描述</label>
- <div class="layui-input-block">
- <textarea name="description" placeholder="请输入详情页SEO描述" class="layui-textarea">{$content->description}</textarea>
- </div>
- </div>
-
- <div class="layui-form-item">
- <label class="layui-form-label">状态</label>
- <div class="layui-input-block">
- <input type="radio" name="status" value="1" title="显示" {if([$content->status]==1)} checked="checked"{/if}>
- <input type="radio" name="status" value="0" title="隐藏" {if([$content->status]==0)} checked="checked"{/if}>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="layui-btn" lay-submit>立即提交</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- {fun=get_btn_back()}
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- {/if}
-
- </div>
-
- <style>.placeHolder {border:dashed 2px gray; }</style>
- <script type="text/javascript" src="{APP_THEME_DIR}/js/jquery.dragsort-0.5.2.min.js"></script>
- <script type="text/javascript">
- $("#pics_box").dragsort({
- dragSelector: "dl",
- dragSelectorExclude: "input,textarea,dd",
- dragBetween: false,
- dragEnd: saveOrder,
- placeHolderTemplate: "<dl class='placeHolder'><dt></dt></dl>"
- });
-
- function saveOrder() {
- var data = $("#pics_box dl dt img").map(function() {
- return $(this).data("url");
- }).get();
- $("input[name=pics]").val(data.join(","))
- };
-
- </script>
- <script type="text/javascript" src="{APP_THEME_DIR}/js/jscolor.js"></script>
-
- {include file='common/ueditor.html'}
- {include file='common/foot.html'}
|