config.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <form id="config-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  2. {if $addon.tips && $addon.tips.value}
  3. <div class="alert {$addon.tips.extend|default='alert-info-light'}" style="margin-bottom:10px;">
  4. {if $addon.tips.title}
  5. <b>{$addon.tips.title}</b><br>
  6. {/if}
  7. {$addon.tips.value}
  8. </div>
  9. {/if}
  10. <div class="panel panel-default panel-intro">
  11. {if count($groupList)>1}
  12. <div class="panel-heading mb-3">
  13. <ul class="nav nav-tabs nav-group">
  14. <li class="active"><a href="#all" data-toggle="tab">全部</a></li>
  15. {foreach name="groupList" id="tab"}
  16. <li><a href="#tab-{$key}" title="{$tab}" data-toggle="tab">{$tab}</a></li>
  17. {/foreach}
  18. </ul>
  19. </div>
  20. {/if}
  21. <div class="panel-body no-padding">
  22. <div id="myTabContent" class="tab-content">
  23. {foreach name="groupList" id="group" key="groupName"}
  24. <div class="tab-pane fade active in" id="tab-{$groupName}">
  25. <table class="table table-striped table-config mb-0">
  26. <tbody>
  27. {foreach name="$addon.config" id="item"}
  28. {if ((!isset($item['group']) || $item['group']=='') && $groupName=='other') || (isset($item['group']) && $item['group']==$group)}
  29. <tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name}" class="{if $item.visible??''}hidden{/if}">
  30. <td width="15%">{$item.title}</td>
  31. <td>
  32. <div class="row">
  33. <div class="col-sm-8 col-xs-12">
  34. {switch $item.type}
  35. {case string}
  36. <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
  37. {/case}
  38. {case password}
  39. <input {$item.extend} type="password" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
  40. {/case}
  41. {case text}
  42. <textarea {$item.extend} name="row[{$item.name}]" class="form-control" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
  43. {/case}
  44. {case array}
  45. <dl class="fieldlist" data-name="row[{$item.name}]">
  46. <dd>
  47. <ins>{:__('Array key')}</ins>
  48. <ins>{:__('Array value')}</ins>
  49. </dd>
  50. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  51. <textarea name="row[{$item.name}]" cols="30" rows="5" class="hide">{$item.value|json_encode|htmlentities}</textarea>
  52. </dl>
  53. {/case}
  54. {case date}
  55. <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}"/>
  56. {/case}
  57. {case time}
  58. <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}"/>
  59. {/case}
  60. {case datetime}
  61. <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}"/>
  62. {/case}
  63. {case number}
  64. <input {$item.extend} type="number" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
  65. {/case}
  66. {case checkbox}
  67. {foreach name="item.content" item="vo"}
  68. <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>
  69. {/foreach}
  70. <span class="msg-box n-right" for="row[{$item.name}]"></span>
  71. {/case}
  72. {case radio}
  73. {foreach name="item.content" item="vo"}
  74. <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>
  75. {/foreach}
  76. <span class="msg-box n-right" for="row[{$item.name}]"></span>
  77. {/case}
  78. {case value="select" break="0"}{/case}
  79. {case value="selects"}
  80. <select {$item.extend} name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
  81. {foreach name="item.content" item="vo"}
  82. <option value="{$key}" {in name="key" value="$item.value" }selected{/in}>{$vo}</option>
  83. {/foreach}
  84. </select>
  85. {/case}
  86. {case value="image" break="0"}{/case}
  87. {case value="images"}
  88. <div class="form-inline">
  89. <input id="c-{$item.name}" class="form-control" size="28" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  90. <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>
  91. <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>
  92. <ul class="row list-inline plupload-preview" id="p-{$item.name}"></ul>
  93. <span class="msg-box n-right" for="c-{$item.name}"></span>
  94. </div>
  95. {/case}
  96. {case value="file" break="0"}{/case}
  97. {case value="files"}
  98. <div class="form-inline">
  99. <input id="c-{$item.name}" class="form-control" size="28" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
  100. <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>
  101. <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>
  102. <span class="msg-box n-right" for="c-{$item.name}"></span>
  103. </div>
  104. {/case}
  105. {case switch}
  106. <input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
  107. <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0">
  108. <i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
  109. </a>
  110. {/case}
  111. {case bool}
  112. <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>
  113. <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>
  114. {/case}
  115. {default /}{$item.value}
  116. {/switch}
  117. </div>
  118. <div class="col-sm-4"></div>
  119. </div>
  120. </td>
  121. </tr>
  122. {/if}
  123. {/foreach}
  124. </tbody>
  125. </table>
  126. </div>
  127. {/foreach}
  128. <div class="form-group layer-footer">
  129. <label class="control-label col-xs-12 col-sm-2" style="width:15%;"></label>
  130. <div class="col-xs-12 col-sm-8">
  131. <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
  132. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </form>