index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <style type="text/css">
  2. @media (max-width: 375px) {
  3. .edit-form tr td input {
  4. width: 100%;
  5. }
  6. .edit-form tr th:first-child, .edit-form tr td:first-child {
  7. width: 20%;
  8. }
  9. .edit-form tr th:nth-last-of-type(-n+2), .edit-form tr td:nth-last-of-type(-n+2) {
  10. display: none;
  11. }
  12. }
  13. .edit-form table > tbody > tr td a.btn-delcfg {
  14. visibility: hidden;
  15. }
  16. .edit-form table > tbody > tr:hover td a.btn-delcfg {
  17. visibility: visible;
  18. }
  19. </style>
  20. <div class="panel panel-default panel-intro">
  21. <div class="panel-heading">
  22. {:build_heading(null, false)}
  23. <ul class="nav nav-tabs">
  24. {foreach $siteList as $index=>$vo}
  25. <li class="{$vo.active?'active':''}"><a href="#{$vo.name}" data-toggle="tab">{:__($vo.title)}</a></li>
  26. {/foreach}
  27. </ul>
  28. </div>
  29. <div class="panel-body">
  30. <div id="myTabContent" class="tab-content">
  31. {foreach $siteList as $index=>$vo}
  32. <div class="tab-pane fade {$vo.active ? 'active in' : ''}" id="{$vo.name}">
  33. <div class="widget-body no-padding">
  34. <form id="{$vo.name}-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('weixin.config/edit')}">
  35. {:token()}
  36. <table class="table table-striped">
  37. <thead>
  38. <tr>
  39. <th width="15%">{:__('Title')}</th>
  40. <th width="68%">{:__('Value')}</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. {if $vo.name == 'weixin'}
  45. <tr>
  46. <td>公众号接口地址</td>
  47. <td>
  48. <div class="row">
  49. <div class="col-sm-8 col-xs-12">
  50. <input type="text" value="http://{$_SERVER['HTTP_HOST']}/addons/weixin/index/serve" class="form-control" disabled>
  51. </div>
  52. <div class="col-sm-4"></div>
  53. </div>
  54. </td>
  55. </tr>
  56. {/if}
  57. {foreach $vo.list as $item}
  58. <tr>
  59. <td>{$item.title}</td>
  60. <td>
  61. <div class="row">
  62. <div class="col-sm-8 col-xs-12">
  63. {switch $item.type}
  64. {case string}
  65. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
  66. {/case}
  67. {case text}
  68. <textarea {$item.extend} name="row[{$item.name}]" class="form-control" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
  69. {/case}
  70. {case editor}
  71. <textarea {$item.extend} name="row[{$item.name}]" id="editor-{$item.name}" class="form-control editor" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
  72. {/case}
  73. {case array}
  74. <dl class="fieldlist" data-name="row[{$item.name}]">
  75. <dd>
  76. <ins>{:__('Array key')}</ins>
  77. <ins>{:__('Array value')}</ins>
  78. </dd>
  79. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  80. <textarea name="row[{$item.name}]" class="form-control hide" cols="30" rows="5">{$item.value|htmlentities}</textarea>
  81. </dl>
  82. {/case}
  83. {case date}
  84. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  85. {/case}
  86. {case time}
  87. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  88. {/case}
  89. {case datetime}
  90. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  91. {/case}
  92. {case number}
  93. <input {$item.extend} type="number" name="row[{$item.name}]" value="{$item.value}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  94. {/case}
  95. {case checkbox}
  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="checkbox" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
  98. {/foreach}
  99. {/case}
  100. {case radio}
  101. {foreach name="item.content" item="vo"}
  102. <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>
  103. {/foreach}
  104. {/case}
  105. {case value="select" break="0"}{/case}
  106. {case value="selects"}
  107. <select {$item.extend} name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
  108. {foreach name="item.content" item="vo"}
  109. <option value="{$key}" {in name="key" value="$item.value" }selected{/in}>{$vo}</option>
  110. {/foreach}
  111. </select>
  112. {/case}
  113. {case value="image" break="0"}{/case}
  114. {case value="images"}
  115. <div class="form-inline">
  116. <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  117. <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>
  118. <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>
  119. <span class="msg-box n-right" for="c-{$item.name}"></span>
  120. <ul class="row list-inline plupload-preview" id="p-{$item.name}"></ul>
  121. </div>
  122. {/case}
  123. {case value="file" break="0"}{/case}
  124. {case value="files"}
  125. <div class="form-inline">
  126. <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  127. <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>
  128. <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>
  129. <span class="msg-box n-right" for="c-{$item.name}"></span>
  130. </div>
  131. {/case}
  132. {case switch}
  133. <input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
  134. <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0">
  135. <i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
  136. </a>
  137. {/case}
  138. {case bool}
  139. <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>
  140. <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>
  141. {/case}
  142. {case custom}
  143. {$item.extend}
  144. {/case}
  145. {/switch}
  146. </div>
  147. <div class="col-sm-4"></div>
  148. </div>
  149. </td>
  150. </tr>
  151. {/foreach}
  152. </tbody>
  153. <tfoot>
  154. <tr>
  155. <td></td>
  156. <td>
  157. <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
  158. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  159. </td>
  160. </tr>
  161. </tfoot>
  162. </table>
  163. </form>
  164. </div>
  165. </div>
  166. {/foreach}
  167. </div>
  168. </div>
  169. </div>