config.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <style>
  2. #config-form div a.btn {
  3. color:#fff;
  4. text-decoration: none;
  5. }
  6. </style>
  7. <!--@formatter:off-->
  8. {php}
  9. $groupList = [
  10. 'config'=>'system_user_id,sitename,sitelogo,title,keywords,description,theme,qrcode,wxapp,donateimage,userpage,contactqq,searchtype,autopinyin,baidupush,usersidenav,loadmode,pagemode,cachelifetime,urlsuffix',
  11. 'thumb'=>'default_archives_img,default_channel_img,default_block_img,default_page_img,default_special_img',
  12. 'wxapp'=>'wxappid,wxappsecret',
  13. 'rewrite'=>'domain,rewrite,urlsuffix,moduleurlsuffix',
  14. 'audit'=>'isarchivesaudit,iscommentaudit,audittype,nlptype,aip_appid,aip_apikey,aip_secretkey',
  15. 'dict'=>'downloadtype,flagtype,autolinks',
  16. 'other'=>'archivesratio,score,limitscore,ispaylogin,paytypelist,apikey,archiveseditmode,auditnotice,noticetemplateid,channelallocate,archivesdatalimit,specialdatalimit,pagedatalimit,diyformdatalimit',
  17. ];
  18. $group = [];
  19. foreach($groupList as $k=>$v){
  20. $item = explode(',', $v);
  21. $item = array_flip($item);
  22. $group = array_merge($group, array_map(function($value) use($k){return $k;}, $item));
  23. }
  24. {/php}
  25. <form id="config-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  26. <div class="alert {$addon.tips.extend|default='alert-info-light'}" style="margin-bottom:10px;">
  27. <b>温馨提示</b><br>
  28. 1.如果需要将CMS绑定到首页,请移除伪静态中的<b>cms/</b><br>
  29. 2.默认CMS不包含富文本编辑器插件,请在<a href="https://www.fastadmin.net/store.html?category=16" target="_blank">插件市场</a>按需要安装<br>
  30. 3.如果需要启用付费阅读或付费下载,请务必安装<a href="https://www.fastadmin.net/store/epay.html" target="_blank">微信支付宝</a>整合插件<br>
  31. 4.如需启用审核通知,请在插件市场安装<a href="https://www.fastadmin.net/store/dinghorn.html" target="_blank">钉钉</a>或<a href="https://www.fastadmin.net/store/vbot.html" target="_blank">微信</a>通知插件<br>
  32. <div style="margin-top:10px;">
  33. <a href="{:addon_url('cms/index/index')}" class="btn btn-warning" target="_blank"><i class="fa fa-home"></i> CMS首页</a>
  34. <a href="__PUBLIC__index/user/index" class="btn btn-info" target="_blank"><i class="fa fa-user"></i> 会员中心</a>
  35. </div>
  36. </div>
  37. <div class="panel panel-default panel-intro">
  38. <div class="panel-heading">
  39. <ul class="nav nav-tabs nav-group">
  40. <li class="active"><a href="#all" data-toggle="tab">全部</a></li>
  41. <li><a href="#config" data-toggle="tab">基础配置</a></li>
  42. <li><a href="#thumb" data-toggle="tab">缩略图配置</a></li>
  43. <li><a href="#wxapp" data-toggle="tab">小程序配置</a></li>
  44. <li><a href="#rewrite" data-toggle="tab">伪静态配置</a></li>
  45. <li><a href="#audit" data-toggle="tab">审核配置</a></li>
  46. <li><a href="#dict" data-toggle="tab">字典配置</a></li>
  47. <li><a href="#other" data-toggle="tab">其它</a></li>
  48. </ul>
  49. </div>
  50. <div class="panel-body">
  51. <div id="myTabContent" class="tab-content">
  52. <div class="tab-pane fade active in" id="one">
  53. <table class="table table-striped table-config">
  54. <tbody>
  55. {foreach $addon.config as $item}
  56. <tr data-type="{:isset($group[$item['name']])?$group[$item['name']]:'other'}">
  57. <td width="15%">{$item.title}</td>
  58. <td>
  59. <div class="row">
  60. <div class="col-sm-8 col-xs-12">
  61. {switch $item.type}
  62. {case string}
  63. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
  64. {/case}
  65. {case text}
  66. <textarea {$item.extend} name="row[{$item.name}]" class="form-control" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
  67. {/case}
  68. {case array}
  69. <dl class="fieldlist" data-name="row[{$item.name}]">
  70. <dd>
  71. <ins>{:__('Array key')}</ins>
  72. <ins>{:__('Array value')}</ins>
  73. </dd>
  74. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  75. <textarea name="row[{$item.name}]" cols="30" rows="5" class="hide">{$item.value|json_encode|htmlentities}</textarea>
  76. </dl>
  77. {/case}
  78. {case date}
  79. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  80. {/case}
  81. {case time}
  82. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  83. {/case}
  84. {case datetime}
  85. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  86. {/case}
  87. {case number}
  88. <input {$item.extend} type="number" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  89. {/case}
  90. {case checkbox}
  91. {foreach name="item.content" item="vo"}
  92. <label for="row[{$item.name}][]-{$key}"><input id="row[{$item.name}][]-{$key}" name="row[{$item.name}][]" type="checkbox" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
  93. {/foreach}
  94. {/case}
  95. {case radio}
  96. {foreach name="item.content" item="vo"}
  97. <label for="row[{$item.name}]-{$key}"><input id="row[{$item.name}]-{$key}" name="row[{$item.name}]" type="radio" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
  98. {/foreach}
  99. {/case}
  100. {case value="select" break="0"}{/case}
  101. {case value="selects"}
  102. <select {$item.extend} name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
  103. {foreach name="item.content" item="vo"}
  104. <option value="{$key}" {in name="key" value="$item.value" }selected{/in}>{$vo}</option>
  105. {/foreach}
  106. </select>
  107. {/case}
  108. {case value="image" break="0"}{/case}
  109. {case value="images"}
  110. <div class="form-inline">
  111. <input id="c-{$item.name}" class="form-control" size="35" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  112. <span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  113. <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  114. <ul class="row list-inline plupload-preview" id="p-{$item.name}"></ul>
  115. </div>
  116. {/case}
  117. {case value="file" break="0"}{/case}
  118. {case value="files"}
  119. <div class="form-inline">
  120. <input id="c-{$item.name}" class="form-control" size="35" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  121. <span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  122. <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  123. </div>
  124. {/case}
  125. {case bool}
  126. <label for="row[{$item.name}]-yes"><input id="row[{$item.name}]-yes" name="row[{$item.name}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip}" /> {:__('Yes')}</label>
  127. <label for="row[{$item.name}]-no"><input id="row[{$item.name}]-no" name="row[{$item.name}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip}" /> {:__('No')}</label>
  128. {/case}
  129. {default /}{$item.value}
  130. {/switch}
  131. </div>
  132. <div class="col-sm-4"></div>
  133. </div>
  134. </td>
  135. </tr>
  136. {/foreach}
  137. </tbody>
  138. </table>
  139. <div class="form-group layer-footer">
  140. <label class="control-label col-xs-12 col-sm-2"></label>
  141. <div class="col-xs-12 col-sm-8">
  142. <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
  143. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </form>
  151. <!--@formatter:on-->
  152. <script>
  153. require.callback = function () {
  154. var tabevent = function () {
  155. $(document).on("click", ".nav-group li a[data-toggle='tab']", function () {
  156. var type = $(this).attr("href").substring(1);
  157. if (type == 'all') {
  158. $(".table-config tr").show();
  159. } else {
  160. $(".table-config tr").hide();
  161. $(".table-config tr[data-type='" + type + "']").show();
  162. }
  163. });
  164. };
  165. define('backend/addon', ['jquery', 'form'], function ($, Form) {
  166. var Controller = {
  167. config: function () {
  168. Form.api.bindevent($("form[role=form]"));
  169. tabevent();
  170. }
  171. };
  172. return Controller;
  173. });
  174. define('backend/cms/config', ['jquery', 'form'], function ($, Form) {
  175. var Controller = {
  176. index: function () {
  177. Form.api.bindevent($("form[role=form]"));
  178. tabevent();
  179. }
  180. };
  181. return Controller;
  182. });
  183. }
  184. </script>