心理咨询网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

content.html 49KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. {include file='common/head.html'}
  2. <div class="layui-body">
  3. {if([$list])}
  4. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  5. <ul class="layui-tab-title">
  6. <li class="layui-this" lay-id="t1">{$model_name}内容</li>
  7. <li lay-id="t2">{$model_name}新增</li>
  8. </ul>
  9. <div class="layui-tab-content">
  10. <div class="layui-tab-item layui-show">
  11. <form action="{url./admin/Content/index/mcode/'.get('mcode').'}" method="get" class="layui-form">
  12. <div class="layui-form-item nospace">
  13. <div class="layui-input-inline">
  14. {$pathinfo}
  15. <select name="scode">
  16. <option value="">全部栏目</option>
  17. {$search_select}
  18. </select>
  19. </div>
  20. <div class="layui-input-inline">
  21. <input type="text" name="keyword" value="{$get.keyword}" placeholder="请输入搜索关键字" class="layui-input">
  22. </div>
  23. <div class="layui-input-inline">
  24. <button class="layui-btn" lay-submit>搜索</button>
  25. <a class="layui-btn layui-btn-primary" href="{url./admin/Content/index/mcode/'.get('mcode').'}">清除搜索</a>
  26. </div>
  27. </div>
  28. </form>
  29. <form action="{url./admin/Content/mod}" method="post" id="contentForm" name="contentForm" class="layui-form" onkeydown="if(event.keyCode==13) return false;">
  30. <input type="hidden" name="formcheck" value="{$formcheck}" >
  31. <table class="layui-table">
  32. <thead>
  33. <tr>
  34. <th><input type="checkbox" class="checkbox" lay-ignore id="checkall" title="全选"></th>
  35. <th>ID</th>
  36. <th>栏目</th>
  37. <th>标题</th>
  38. <th>发布时间</th>
  39. <th>排序</th>
  40. <th>状态</th>
  41. <th>置顶</th>
  42. <th>推荐</th>
  43. <th>访问量</th>
  44. <th>操作</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. {foreach $contents(key,value)}
  49. <tr>
  50. <td>
  51. <input type="checkbox" class="checkbox checkitem" lay-ignore name="list[]" {if($value->outlink)}disabled{/if} value="[value->id]">
  52. <input type="hidden" name="listall[]" value="[value->id]">
  53. </td>
  54. <td>[value->id]</td>
  55. <td title="[value->scode]">[value->sortname]</td>
  56. <td title="[value->title]">
  57. {fun=substr_both($value->title,0,15)}
  58. {if($value->isheadline)}
  59. <span class="layui-badge layui-bg-blue">头</span>
  60. {/if}
  61. {if($value->ico)}
  62. <span class="layui-badge layui-bg-orange">缩</span>
  63. {/if}
  64. {if($value->pics)}
  65. <span class="layui-badge">图</span>
  66. {/if}
  67. {if($value->outlink)}
  68. <span class="layui-badge layui-bg-black">链</span>
  69. {/if}
  70. </td>
  71. <td>[value->date]</td>
  72. <td class="table-input"><input type="text" lay-ignore class="layui-input" name="sorting[]" value="[value->sorting]"></td>
  73. <td>
  74. {if($value->status)}
  75. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
  76. {else}
  77. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
  78. {/if}
  79. </td>
  80. <td>
  81. {if($value->istop)}
  82. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
  83. {else}
  84. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
  85. {/if}
  86. </td>
  87. <td>
  88. {if($value->isrecommend)}
  89. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
  90. {else}
  91. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
  92. {/if}
  93. </td>
  94. <td>[value->visits]</td>
  95. <td>
  96. {if(!$value->outlink)}
  97. {php}
  98. $Parser=new app\home\controller\ParserController();
  99. $link=$Parser->parserLink(2,$value->urlname,'content',$value->scode,$value->sortfilename,$value->id,$value->filename);
  100. {/php}
  101. <input type="hidden" name="urls[[value->id]]" value="{php}echo $link{/php}">
  102. <a href='{php}
  103. $link = str_replace(".html","",$link);
  104. echo $link;{/php}' class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
  105. {/if}
  106. {fun=get_btn_del($value->id)}
  107. {if(check_level('mod'))}
  108. <a href="{url./admin/Content/mod/mcode/'.get('mcode').'/id/'.$value->id.'}{$btnqs}" class="layui-btn layui-btn-xs" >修改</a>
  109. {/if}
  110. </td>
  111. </tr>
  112. {/foreach}
  113. </tbody>
  114. </table>
  115. <div class="layui-inline" style="float:right">
  116. <select lay-filter="tourl" class="page-select" >
  117. <option value="" selected="">每页显示数量</option>
  118. <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/20}" {if(get('pagesize')==20)}selected{/if}>20条/页</option>
  119. <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/30}" {if(get('pagesize')==30)}selected{/if}>30条/页</option>
  120. <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/50}" {if(get('pagesize')==50)}selected{/if}>50条/页</option>
  121. <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/60}" {if(get('pagesize')==60)}selected{/if}>60条/页</option>
  122. <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/100}" {if(get('pagesize')==100)}selected{/if}>100条/页</option>
  123. <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/150}" {if(get('pagesize')==150)}selected{/if}>150条/页</option>
  124. <option value="{url./admin/Content/index/mcode/'.get('mcode').'/pagesize/200}" {if(get('pagesize')==200)}selected{/if}>200条/页</option>
  125. </select>
  126. </div>
  127. <div class="layui-input-inline">
  128. <select name="scode">
  129. <option value="">请选择移动/复制到栏目</option>
  130. {$search_select}
  131. </select>
  132. </div>
  133. <div class="layui-btn-group">
  134. {if(check_level('mod'))}
  135. <button type="submit" name="submit" value="copy" class="layui-btn layui-btn-sm">复制</button>
  136. <button type="submit" name="submit" value="move" class="layui-btn layui-btn-sm">移动</button>
  137. {/if}
  138. {if(check_level('del'))}
  139. <button type="submit" name="submit" onclick="return setDelAction();" class="layui-btn layui-btn-sm">批量删除</button>
  140. {/if}
  141. {if(check_level('mod'))}
  142. <button type="submit" name="submit" value="sorting" class="layui-btn layui-btn-sm">保存排序</button>
  143. {if([$baidu_zz_token])}
  144. <button type="submit" name="submit" value="baiduzz" class="layui-btn layui-btn-sm">百度普通推送</button>
  145. {/if}
  146. {if([$baidu_ks_token])}
  147. <button type="submit" name="submit" value="baiduks" class="layui-btn layui-btn-sm">百度快速推送</button>
  148. {/if}
  149. {/if}
  150. </div>
  151. <script>
  152. function setDelAction(){
  153. document.contentForm.action = "{url./admin/Content/del}";
  154. return confirm("您确定要删除选中的内容么?");
  155. }
  156. </script>
  157. <div class="page">
  158. {$pagebar}
  159. </div>
  160. </form>
  161. </div>
  162. <div class="layui-tab-item">
  163. <form action="{url./admin/Content/add/mcode/'.get('mcode').'}" method="post" class="layui-form" lay-filter="content" id="edit">
  164. <input type="hidden" name="formcheck" value="{$formcheck}" >
  165. <div class="layui-tab">
  166. <ul class="layui-tab-title">
  167. <li class="layui-this">基本内容</li>
  168. <li>高级内容</li>
  169. </ul>
  170. <div class="layui-tab-content">
  171. <div class="layui-tab-item layui-show">
  172. <div class="layui-form-item">
  173. <label class="layui-form-label">内容栏目 <span class="layui-text-red">*</span></label>
  174. <div class="layui-input-block">
  175. <select name="scode" lay-verify="required">
  176. <option value="">请选择内容栏目</option>
  177. {$sort_select}
  178. </select>
  179. </div>
  180. </div>
  181. <div class="layui-form-item">
  182. <label class="layui-form-label">内容标题 <span class="layui-text-red">*</span></label>
  183. <div class="layui-input-block">
  184. <input type="text" name="title" required lay-verify="required" placeholder="请输入内容标题" class="layui-input">
  185. </div>
  186. </div>
  187. {foreach $extfield(key,value)}
  188. {if($value->type==1)} <!-- 单行文本 -->
  189. <div class="layui-form-item">
  190. <label class="layui-form-label">[value->description]</label>
  191. <div class="layui-input-block">
  192. <input type="text" name="[value->name]" placeholder="请输入[value->description]" class="layui-input">
  193. </div>
  194. </div>
  195. {/if}
  196. {if($value->type==2)}<!-- 多行文本 -->
  197. <div class="layui-form-item">
  198. <label class="layui-form-label">[value->description]</label>
  199. <div class="layui-input-block">
  200. <textarea name="[value->name]" class="layui-textarea" placeholder="请输入[value->description]"></textarea>
  201. </div>
  202. </div>
  203. {/if}
  204. {if($value->type==3)}<!-- 单选 -->
  205. <div class="layui-form-item">
  206. <label class="layui-form-label">[value->description]</label>
  207. <div class="layui-input-block">
  208. <div>
  209. {php}
  210. $radios=explode(',',$value->value);
  211. foreach ($radios as $value2) {
  212. echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'">';
  213. }
  214. {/php}
  215. </div>
  216. </div>
  217. </div>
  218. {/if}
  219. {if($value->type==4)}<!-- 多选 -->
  220. <div class="layui-form-item">
  221. <label class="layui-form-label">[value->description]</label>
  222. <div class="layui-input-block">
  223. <div>
  224. {php}
  225. $checkboxs=explode(',',$value->value);
  226. foreach ($checkboxs as $value2) {
  227. echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'">';
  228. }
  229. {/php}
  230. </div>
  231. </div>
  232. </div>
  233. {/if}
  234. {if($value->type==5)}<!-- 图片 -->
  235. <div class="layui-form-item">
  236. <label class="layui-form-label">[value->description]</label>
  237. <div class="layui-input-inline">
  238. <input type="text" name="[value->name]" id="[value->name]" placeholder="请上传[value->description]" class="layui-input">
  239. </div>
  240. <button type="button" class="layui-btn upload watermark" data-des="[value->name]">
  241. <i class="layui-icon">&#xe67c;</i>上传图片
  242. </button>
  243. <div id="[value->name]_box" class="pic"></div>
  244. </div>
  245. {/if}
  246. {if($value->type==10)}<!-- 多图片 -->
  247. <div class="layui-form-item">
  248. <label class="layui-form-label">[value->description]</label>
  249. <div class="layui-input-inline">
  250. <input type="text" name="[value->name]" id="[value->name]" placeholder="请上传[value->description]" class="layui-input">
  251. </div>
  252. <button type="button" class="layui-btn uploads watermark" data-des="[value->name]">
  253. <i class="layui-icon">&#xe67c;</i>上传多图
  254. </button>
  255. <div id="[value->name]_box" class="pic addedit"><dl></dl> <!-- 规避空内容拖动bug --></div>
  256. </div>
  257. {/if}
  258. {if($value->type==6)}<!-- 文件 -->
  259. <div class="layui-form-item">
  260. <label class="layui-form-label">[value->description]</label>
  261. <div class="layui-input-inline">
  262. <input type="text" name="[value->name]" id="[value->name]" placeholder="请上传[value->description]" class="layui-input">
  263. </div>
  264. <button type="button" class="layui-btn file" data-des="[value->name]">
  265. <i class="layui-icon">&#xe67c;</i>上传文件
  266. </button>
  267. </div>
  268. {/if}
  269. {if($value->type==7)}<!-- 日期 -->
  270. <div class="layui-form-item">
  271. <label class="layui-form-label">[value->description]</label>
  272. <div class="layui-input-block">
  273. <input type="text" name="[value->name]" readonly placeholder="请选择[value->description]" class="layui-input datetime">
  274. </div>
  275. </div>
  276. {/if}
  277. {if($value->type==8)}<!-- 编辑器 -->
  278. <div class="layui-form-item">
  279. <label class="layui-form-label">[value->description]</label>
  280. <div class="layui-input-block">
  281. <script type="text/plain" id="editor_[value->name]" name="[value->name]" style="width:100%;height:240px;"></script>
  282. <script>
  283. //初始化编辑器
  284. $(document).ready(function (e) {
  285. var ue = UE.getEditor('editor_[value->name]',{
  286. maximumWords:10000
  287. });
  288. })
  289. </script>
  290. </div>
  291. </div>
  292. {/if}
  293. {if($value->type==9)}<!-- 下拉 -->
  294. <div class="layui-form-item">
  295. <label class="layui-form-label">[value->description]</label>
  296. <div class="layui-input-block">
  297. <select name="[value->name]">
  298. {php}
  299. $selects=explode(',',$value->value);
  300. foreach ($selects as $value2) {
  301. echo '<option value="'.$value2.'">'.$value2.'</option>';
  302. }
  303. {/php}
  304. </select>
  305. </div>
  306. </div>
  307. {/if}
  308. {/foreach}
  309. <div class="layui-form-item">
  310. <label class="layui-form-label">内容</label>
  311. <div class="layui-input-block">
  312. <script type="text/plain" id="editor" name="content" style="width:100%;height:240px;"></script>
  313. </div>
  314. </div>
  315. <div class="layui-form-item">
  316. <label class="layui-form-label">tags</label>
  317. <div class="layui-input-block">
  318. <input type="text" name="tags" placeholder="请输入文章tag,英文逗号隔开" class="layui-input">
  319. </div>
  320. </div>
  321. <div class="layui-form-item">
  322. <label class="layui-form-label">作者</label>
  323. <div class="layui-input-block">
  324. <input type="text" name="author" placeholder="请输入作者" value="{$session.realname}" class="layui-input">
  325. </div>
  326. </div>
  327. <div class="layui-form-item">
  328. <label class="layui-form-label">来源</label>
  329. <div class="layui-input-block">
  330. <input type="text" name="source" placeholder="请输入来源" value="本站" class="layui-input">
  331. </div>
  332. </div>
  333. <div class="layui-form-item">
  334. <label class="layui-form-label">缩略图</label>
  335. <div class="layui-input-inline">
  336. <input type="text" name="ico" id="ico" placeholder="请上传缩略图" class="layui-input">
  337. </div>
  338. <button type="button" class="layui-btn upload watermark" data-des="ico">
  339. <i class="layui-icon">&#xe67c;</i>上传图片
  340. </button>
  341. <div id="ico_box" class="pic addedit"></div>
  342. </div>
  343. <div class="layui-form-item">
  344. <label class="layui-form-label">轮播多图</label>
  345. <div class="layui-input-inline">
  346. <input type="text" name="pics" id="pics" placeholder="请上传轮播多图" class="layui-input">
  347. </div>
  348. <button type="button" class="layui-btn uploads watermark" data-des="pics">
  349. <i class="layui-icon">&#xe67c;</i>上传多图
  350. </button>
  351. <div id="pics_box" class="pic addedit"><dl></dl> <!-- 规避空内容拖动bug --></div>
  352. </div>
  353. <div class="layui-form-item">
  354. <label class="layui-form-label">参数</label>
  355. <div class="layui-input-block">
  356. <input type="checkbox" name="istop" value="1" title="置顶">
  357. <input type="checkbox" name="isrecommend" value="1" title="推荐">
  358. <input type="checkbox" name="isheadline" value="1" title="头条">
  359. </div>
  360. </div>
  361. <div class="layui-form-item">
  362. <label class="layui-form-label">浏览权限</label>
  363. <div class="layui-input-block">
  364. <select name="gid">
  365. <option value="">不限制</option>
  366. {foreach $groups(key,value)}
  367. <option value="[value->id]">[value->gname]</option>
  368. {/foreach}
  369. </select>
  370. </div>
  371. </div>
  372. <div class="layui-form-item">
  373. <label class="layui-form-label">权限类型</label>
  374. <div class="layui-input-block">
  375. <select name="gtype" id="gtype" >
  376. <option value="1">小于</option>
  377. <option value="2">小于等于</option>
  378. <option value="3">等于</option>
  379. <option value="4" selected>大于等于</option>
  380. <option value="5">大于</option>
  381. </select>
  382. </div>
  383. </div>
  384. </div>
  385. <div class="layui-tab-item ">
  386. <div class="layui-form-item">
  387. <label class="layui-form-label">内容副栏目</label>
  388. <div class="layui-input-block">
  389. <select name="subscode">
  390. <option value="">请选择内容副栏目</option>
  391. {$subsort_select}
  392. </select>
  393. </div>
  394. </div>
  395. <div class="layui-form-item">
  396. <label class="layui-form-label">标题颜色</label>
  397. <div class="layui-input-inline">
  398. <input type="text" name="titlecolor" placeholder="请选择标题颜色" value="#333333" class="layui-input jscolor {hash:true}">
  399. </div>
  400. </div>
  401. <div class="layui-form-item">
  402. <label class="layui-form-label">副标题</label>
  403. <div class="layui-input-block">
  404. <input type="text" name="subtitle" placeholder="请输入副标题" class="layui-input">
  405. </div>
  406. </div>
  407. <div class="layui-form-item">
  408. <label class="layui-form-label">URL名称</label>
  409. <div class="layui-input-block">
  410. <input type="text" name="filename" placeholder="请输入URL名称,如:test,test/a/b" class="layui-input">
  411. </div>
  412. </div>
  413. <div class="layui-form-item">
  414. <label class="layui-form-label">跳转外链接</label>
  415. <div class="layui-input-block">
  416. <input type="text" name="outlink" placeholder="请输入跳转外链接" class="layui-input">
  417. </div>
  418. </div>
  419. <div class="layui-form-item">
  420. <label class="layui-form-label">权限不足提示</label>
  421. <div class="layui-input-block">
  422. <input type="text" name="gnote" placeholder="请输入权限不足时提示文本" class="layui-input">
  423. </div>
  424. </div>
  425. <div class="layui-form-item">
  426. <label class="layui-form-label">发布时间</label>
  427. <div class="layui-input-inline">
  428. <input type="text" name="date" value="{fun=date('Y-m-d H:i:s')}" readonly placeholder="请选择发布时间" class="layui-input datetime">
  429. </div>
  430. <div class="layui-form-mid layui-word-aux">温馨提示:设置未来时间可定时发布!</div>
  431. </div>
  432. <div class="layui-form-item">
  433. <label class="layui-form-label">附件</label>
  434. <div class="layui-input-inline">
  435. <input type="text" name="enclosure" id="enclosure" placeholder="请上传附件" class="layui-input">
  436. </div>
  437. <button type="button" class="layui-btn file" data-des="enclosure">
  438. <i class="layui-icon">&#xe67c;</i>上传附件
  439. </button>
  440. </div>
  441. <div class="layui-form-item">
  442. <label class="layui-form-label">SEO关键字</label>
  443. <div class="layui-input-block">
  444. <input type="text" name="keywords" placeholder="请输入详情页SEO关键字" class="layui-input">
  445. </div>
  446. </div>
  447. <div class="layui-form-item">
  448. <label class="layui-form-label">SEO描述</label>
  449. <div class="layui-input-block">
  450. <textarea name="description" placeholder="请输入详情页SEO描述" class="layui-textarea"></textarea>
  451. </div>
  452. </div>
  453. <div class="layui-form-item">
  454. <label class="layui-form-label">状态</label>
  455. <div class="layui-input-block">
  456. <input type="radio" name="status" value="1" title="显示" checked>
  457. <input type="radio" name="status" value="0" title="隐藏">
  458. </div>
  459. </div>
  460. </div>
  461. </div>
  462. </div>
  463. <div class="layui-form-item">
  464. <div class="layui-input-block">
  465. <button class="layui-btn" lay-submit>立即提交</button>
  466. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  467. </div>
  468. </div>
  469. </form>
  470. </div>
  471. </div>
  472. </div>
  473. {/if}
  474. {if([$mod])}
  475. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  476. <ul class="layui-tab-title">
  477. <li class="layui-this">{$model_name}内容修改</li>
  478. </ul>
  479. <div class="layui-tab-content">
  480. <div class="layui-tab-item layui-show">
  481. <form action="{url./admin/Content/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form" id="edit">
  482. <input type="hidden" name="formcheck" value="{$formcheck}" >
  483. <div class="layui-tab">
  484. <ul class="layui-tab-title">
  485. <li class="layui-this">基本内容</li>
  486. <li>高级内容</li>
  487. </ul>
  488. <div class="layui-tab-content">
  489. <div class="layui-tab-item layui-show">
  490. <div class="layui-form-item">
  491. <label class="layui-form-label">内容栏目 <span class="layui-text-red">*</span></label>
  492. <div class="layui-input-block">
  493. <select name="scode" lay-verify="required">
  494. <option value="">请选择内容栏目</option>
  495. {$sort_select}
  496. </select>
  497. </div>
  498. </div>
  499. <div class="layui-form-item">
  500. <label class="layui-form-label">内容标题 <span class="layui-text-red">*</span></label>
  501. <div class="layui-input-block">
  502. <input type="text" name="title" required lay-verify="required" value="{$content->title}" placeholder="请输入内容标题" class="layui-input">
  503. </div>
  504. </div>
  505. {foreach $extfield(key,value)}
  506. {if($value->type==1)} <!-- 单行文本 -->
  507. <div class="layui-form-item">
  508. <label class="layui-form-label">[value->description]</label>
  509. <div class="layui-input-block">
  510. <input type="text" name="[value->name]" value="{$content->{$value->name}}" placeholder="请输入[value->description]" class="layui-input">
  511. </div>
  512. </div>
  513. {/if}
  514. {if($value->type==2)}<!-- 多行文本 -->
  515. <div class="layui-form-item">
  516. <label class="layui-form-label">[value->description]</label>
  517. <div class="layui-input-block">
  518. <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>
  519. </div>
  520. </div>
  521. {/if}
  522. {if($value->type==3)}<!-- 单选 -->
  523. <div class="layui-form-item">
  524. <label class="layui-form-label">[value->description]</label>
  525. <div class="layui-input-block">
  526. <div>
  527. {php}
  528. $radios=explode(',',$value->value);
  529. $name=$value->name;
  530. foreach ($radios as $value2) {
  531. if($this->vars['content']->$name==$value2){
  532. echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'" checked>';
  533. }else{
  534. echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'">';
  535. }
  536. }
  537. {/php}
  538. </div>
  539. </div>
  540. </div>
  541. {/if}
  542. {if($value->type==4)}<!-- 多选 -->
  543. <div class="layui-form-item">
  544. <label class="layui-form-label">[value->description]</label>
  545. <div class="layui-input-block">
  546. <div>
  547. {php}
  548. $checkboxs=explode(',',$value->value);
  549. $name=$value->name;
  550. echo '<input name="'.$value->name.'" type="hidden">';//占位清空
  551. $values=explode(',',$this->vars['content']->$name);
  552. foreach ($checkboxs as $value2) {
  553. if(in_array($value2,$values)){
  554. echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'" checked>';
  555. }else{
  556. echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'">';
  557. }
  558. }
  559. {/php}
  560. </div>
  561. </div>
  562. </div>
  563. {/if}
  564. {if($value->type==5)}<!-- 图片 -->
  565. <div class="layui-form-item">
  566. <label class="layui-form-label">[value->description]</label>
  567. <div class="layui-input-inline">
  568. <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
  569. </div>
  570. <button type="button" class="layui-btn upload watermark" data-des="[value->name]">
  571. <i class="layui-icon">&#xe67c;</i>上传图片
  572. </button>
  573. {php}$name=$value->name; {/php}
  574. <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>
  575. </div>
  576. {/if}
  577. {if($value->type==10)}<!-- 多图 -->
  578. <div class="layui-form-item">
  579. <label class="layui-form-label">[value->description]</label>
  580. <div class="layui-input-inline">
  581. <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
  582. </div>
  583. <button type="button" class="layui-btn uploads watermark" data-des="[value->name]">
  584. <i class="layui-icon">&#xe67c;</i>上传多图
  585. </button>
  586. <div id="[value->name]_box" class="pic addedit">
  587. <dl></dl> <!-- 规避空内容拖动bug -->
  588. {php}
  589. $name=$value->name;
  590. if([$content->$name]){
  591. $pics=explode(',',[$content->$name]);
  592. }else{
  593. $pics = array();
  594. }
  595. foreach ($pics as $key=>$value) {
  596. //需要留一个空,不然被解析为标签了
  597. echo "<dl><dt><img src='".SITE_DIR.$value."' data-url='".$value."'></dt><dd>删除</dd></dl>";
  598. }
  599. {/php}
  600. </div>
  601. </div>
  602. {/if}
  603. {if($value->type==6)}<!-- 文件 -->
  604. <div class="layui-form-item">
  605. <label class="layui-form-label">[value->description]</label>
  606. <div class="layui-input-inline">
  607. <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
  608. </div>
  609. <button type="button" class="layui-btn file" data-des="[value->name]">
  610. <i class="layui-icon">&#xe67c;</i>上传文件
  611. </button>
  612. </div>
  613. {/if}
  614. {if($value->type==7)}<!-- 日期 -->
  615. <div class="layui-form-item">
  616. <label class="layui-form-label">[value->description]</label>
  617. <div class="layui-input-block">
  618. <input type="text" name="[value->name]" value="{$content->{$value->name}}" readonly placeholder="请选择[value->description]" class="layui-input datetime">
  619. </div>
  620. </div>
  621. {/if}
  622. {if($value->type==8)}<!-- 编辑器 -->
  623. <div class="layui-form-item">
  624. <label class="layui-form-label">[value->description]</label>
  625. <div class="layui-input-block">
  626. {php}
  627. $name=@$value->name;
  628. {/php}
  629. <script type="text/plain" id="editor_[value->name]" name="[value->name]" style="width:100%;height:240px;">{fun=decode_string([$content->$name])}</script>
  630. <script>
  631. //初始化编辑器
  632. $(document).ready(function (e) {
  633. var ue = UE.getEditor('editor_[value->name]',{
  634. maximumWords:10000
  635. });
  636. })
  637. </script>
  638. </div>
  639. </div>
  640. {/if}
  641. {if($value->type==9)}<!-- 下拉 -->
  642. <div class="layui-form-item">
  643. <label class="layui-form-label">[value->description]</label>
  644. <div class="layui-input-block">
  645. <select name="[value->name]">
  646. {php}
  647. $selects=explode(',',$value->value);
  648. $name=$value->name;
  649. foreach ($selects as $value2) {
  650. if($this->vars['content']->$name==$value2){
  651. echo '<option value="'.$value2.'" selected>'.$value2.'</option>';
  652. }else{
  653. echo '<option value="'.$value2.'">'.$value2.'</option>';
  654. }
  655. }
  656. {/php}
  657. </select>
  658. </div>
  659. </div>
  660. {/if}
  661. {/foreach}
  662. <div class="layui-form-item">
  663. <label class="layui-form-label">内容</label>
  664. <div class="layui-input-block">
  665. <script type="text/plain" id="editor" name="content" style="width:100%;height:240px;">{fun=decode_string([$content->content])}</script>
  666. </div>
  667. </div>
  668. <div class="layui-form-item">
  669. <label class="layui-form-label">tags</label>
  670. <div class="layui-input-block">
  671. <input type="text" name="tags" placeholder="请输入文章tag,英文逗号隔开" value="{$content->tags}" class="layui-input">
  672. </div>
  673. </div>
  674. <div class="layui-form-item">
  675. <label class="layui-form-label">作者</label>
  676. <div class="layui-input-block">
  677. <input type="text" name="author" placeholder="请输入作者" value="{$content->author}" class="layui-input">
  678. </div>
  679. </div>
  680. <div class="layui-form-item">
  681. <label class="layui-form-label">来源</label>
  682. <div class="layui-input-block">
  683. <input type="text" name="source" placeholder="请输入来源" value="{$content->source}" class="layui-input">
  684. </div>
  685. </div>
  686. <div class="layui-form-item">
  687. <label class="layui-form-label">缩略图</label>
  688. <div class="layui-input-inline">
  689. <input type="text" name="ico" id="ico" value="{$content->ico}" placeholder="请上传缩略图" class="layui-input">
  690. </div>
  691. <button type="button" class="layui-btn upload watermark" data-des="ico">
  692. <i class="layui-icon">&#xe67c;</i>上传图片
  693. </button>
  694. <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>
  695. </div>
  696. <div class="layui-form-item">
  697. <label class="layui-form-label">轮播多图</label>
  698. <div class="layui-input-inline">
  699. <input type="text" name="pics" id="pics" value="{$content->pics}" placeholder="请上传轮播多图" class="layui-input">
  700. </div>
  701. <button type="button" class="layui-btn uploads watermark" data-des="pics">
  702. <i class="layui-icon">&#xe67c;</i>上传多图
  703. </button>
  704. <div id="pics_box" class="pic addedit">
  705. <dl></dl> <!-- 规避空内容拖动bug -->
  706. {php}
  707. if([$content->pics]){
  708. $pics=explode(',',[$content->pics]);
  709. }else{
  710. $pics = array();
  711. }
  712. if([$content->picstitle]){
  713. $picstitle=explode(',',[$content->picstitle]);
  714. }else{
  715. $picstitle = array();
  716. }
  717. foreach ($pics as $key=>$value) {
  718. //需要留一个空,不然被解析为标签了
  719. 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>";
  720. }
  721. {/php}
  722. </div>
  723. </div>
  724. <div class="layui-form-item">
  725. <label class="layui-form-label">状态</label>
  726. <div class="layui-input-block">
  727. <input type="checkbox" name="istop" value="1" title="置顶" {if([$content->istop]==1)}checked{/if}>
  728. <input type="checkbox" name="isrecommend" value="1" title="推荐" {if([$content->isrecommend]==1)}checked{/if}>
  729. <input type="checkbox" name="isheadline" value="1" title="头条" {if([$content->isheadline]==1)}checked{/if}>
  730. </div>
  731. </div>
  732. <div class="layui-form-item">
  733. <label class="layui-form-label">浏览权限</label>
  734. <div class="layui-input-block">
  735. <select name="gid">
  736. <option value="">不限制</option>
  737. {foreach $groups(key,value)}
  738. <option value="[value->id]" {if([$content->gid]==$value->id)}selected="selected"{/if}>[value->gname]</option>
  739. {/foreach}
  740. </select>
  741. </div>
  742. </div>
  743. <div class="layui-form-item">
  744. <label class="layui-form-label">权限类型</label>
  745. <div class="layui-input-block">
  746. <select name="gtype" id="gtype" >
  747. <option value="1" {if([$content->gtype]==1)}selected="selected"{/if}>小于</option>
  748. <option value="2" {if([$content->gtype]==2)}selected="selected"{/if}>小于等于</option>
  749. <option value="3" {if([$content->gtype]==3)}selected="selected"{/if}>等于</option>
  750. <option value="4" {if([$content->gtype]==4||(![$sort->gtype]))}selected="selected"{/if}>大于等于</option>
  751. <option value="5" {if([$content->gtype]==5)}selected="selected"{/if}>大于</option>
  752. </select>
  753. </div>
  754. </div>
  755. </div>
  756. <div class="layui-tab-item ">
  757. <div class="layui-form-item">
  758. <label class="layui-form-label">内容副栏目</label>
  759. <div class="layui-input-block">
  760. <select name="subscode">
  761. <option value="">请选择内容副栏目</option>
  762. {$subsort_select}
  763. </select>
  764. </div>
  765. </div>
  766. <div class="layui-form-item">
  767. <label class="layui-form-label">标题颜色</label>
  768. <div class="layui-input-inline">
  769. <input type="text" name="titlecolor" value="{$content->titlecolor}" placeholder="请选择标题颜色" class="layui-input jscolor {hash:true}">
  770. </div>
  771. </div>
  772. <div class="layui-form-item">
  773. <label class="layui-form-label">副标题</label>
  774. <div class="layui-input-block">
  775. <input type="text" name="subtitle" value="{$content->subtitle}" placeholder="请输入副标题" class="layui-input">
  776. </div>
  777. </div>
  778. <div class="layui-form-item">
  779. <label class="layui-form-label">URL名称</label>
  780. <div class="layui-input-block">
  781. <input type="text" name="filename" value="{$content->filename}" placeholder="请输入URL名称,如:test,test/a/b" class="layui-input">
  782. </div>
  783. </div>
  784. <div class="layui-form-item">
  785. <label class="layui-form-label">跳转外链接</label>
  786. <div class="layui-input-block">
  787. <input type="text" name="outlink" value="{$content->outlink}" placeholder="请输入跳转外链接" class="layui-input">
  788. </div>
  789. </div>
  790. <div class="layui-form-item">
  791. <label class="layui-form-label">权限不足提示</label>
  792. <div class="layui-input-block">
  793. <input type="text" name="gnote" value="{$content->gnote}" placeholder="请输入权限不足时提示文本" class="layui-input">
  794. </div>
  795. </div>
  796. <div class="layui-form-item">
  797. <label class="layui-form-label">发布时间</label>
  798. <div class="layui-input-inline">
  799. <input type="text" name="date" value="{$content->date}" readonly placeholder="请选择发布时间" class="layui-input datetime">
  800. </div>
  801. <div class="layui-form-mid layui-word-aux">温馨提示:设置未来时间可定时发布!</div>
  802. </div>
  803. <div class="layui-form-item">
  804. <label class="layui-form-label">附件</label>
  805. <div class="layui-input-inline">
  806. <input type="text" name="enclosure" id="enclosure" value="{$content->enclosure}" placeholder="请上传附件" class="layui-input">
  807. </div>
  808. <button type="button" class="layui-btn file" data-des="enclosure">
  809. <i class="layui-icon">&#xe67c;</i>上传附件
  810. </button>
  811. </div>
  812. <div class="layui-form-item">
  813. <label class="layui-form-label">SEO关键字</label>
  814. <div class="layui-input-block">
  815. <input type="text" name="keywords" value="{$content->keywords}" placeholder="请输入详情页SEO关键字" class="layui-input">
  816. </div>
  817. </div>
  818. <div class="layui-form-item">
  819. <label class="layui-form-label">SEO描述</label>
  820. <div class="layui-input-block">
  821. <textarea name="description" placeholder="请输入详情页SEO描述" class="layui-textarea">{$content->description}</textarea>
  822. </div>
  823. </div>
  824. <div class="layui-form-item">
  825. <label class="layui-form-label">状态</label>
  826. <div class="layui-input-block">
  827. <input type="radio" name="status" value="1" title="显示" {if([$content->status]==1)} checked="checked"{/if}>
  828. <input type="radio" name="status" value="0" title="隐藏" {if([$content->status]==0)} checked="checked"{/if}>
  829. </div>
  830. </div>
  831. </div>
  832. </div>
  833. </div>
  834. <div class="layui-form-item">
  835. <div class="layui-input-block">
  836. <button class="layui-btn" lay-submit>立即提交</button>
  837. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  838. {fun=get_btn_back()}
  839. </div>
  840. </div>
  841. </form>
  842. </div>
  843. </div>
  844. </div>
  845. {/if}
  846. </div>
  847. <style>.placeHolder {border:dashed 2px gray; }</style>
  848. <script type="text/javascript" src="{APP_THEME_DIR}/js/jquery.dragsort-0.5.2.min.js"></script>
  849. <script type="text/javascript">
  850. $("#pics_box").dragsort({
  851. dragSelector: "dl",
  852. dragSelectorExclude: "input,textarea,dd",
  853. dragBetween: false,
  854. dragEnd: saveOrder,
  855. placeHolderTemplate: "<dl class='placeHolder'><dt></dt></dl>"
  856. });
  857. function saveOrder() {
  858. var data = $("#pics_box dl dt img").map(function() {
  859. return $(this).data("url");
  860. }).get();
  861. $("input[name=pics]").val(data.join(","))
  862. };
  863. </script>
  864. <script type="text/javascript" src="{APP_THEME_DIR}/js/jscolor.js"></script>
  865. {include file='common/ueditor.html'}
  866. {include file='common/foot.html'}