config.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <!DOCTYPE html>
  2. <html lang="{{ @this->lang() }}">
  3. <head>
  4. <include href="blocks/head.html" />
  5. </head>
  6. <body>
  7. <include href="blocks/navbar.html" />
  8. <div class="container">
  9. <include href="blocks/admin/tabs.html" />
  10. <form action="{{ @BASE }}/admin/config" method="post" id="frm-config">
  11. <div class="row">
  12. <div class="col-sm-3">
  13. <ul class="nav nav-pills nav-stacked">
  14. <li class="active"><a href="#config-site" data-toggle="tab">{{ @dict.site_basics }}</a></li>
  15. <li><a href="#config-parse" data-toggle="tab">{{ @dict.text_parsing }}</a></li>
  16. <li><a href="#config-email" data-toggle="tab">{{ @dict.email_smtp_imap }}</a></li>
  17. <li><a href="#config-advanced" data-toggle="tab">{{ @dict.advanced }}</a></li>
  18. </ul>
  19. </div>
  20. <div class="col-sm-9 tab-content">
  21. <div role="tabpanel" class="tab-pane fade in active" id="config-site">
  22. <div class="form-group">
  23. <label class="control-label" for="site-name">{{ @dict.site_name }}</label>
  24. <input type="text" class="form-control" name="site-name" value="{{ @site.name }}" required>
  25. </div>
  26. <div class="form-group">
  27. <label class="control-label" for="site-description">{{ @dict.site_description }}</label>
  28. <textarea class="form-control input-sm" name="site-description">{{ @site.description | esc }}</textarea>
  29. </div>
  30. <div class="form-group">
  31. <label class="control-label" for="site-timezone">{{ @dict.timezone }}</label>
  32. <input type="text" class="form-control input-sm" name="site-timezone" value="{{ @site.timezone }}" required>
  33. </div>
  34. <div class="form-group">
  35. <label class="control-label" for="site-theme">{{ @dict.default_theme }}</label>
  36. <input type="text" class="form-control input-sm" name="site-theme" value="{{ @site.theme }}" required>
  37. </div>
  38. <div class="form-group">
  39. <label class="control-label" for="site-logo">{{ @dict.logo }}</label>
  40. <input type="text" class="form-control input-sm" name="site-logo" placeholder="(Site Name)" value="{{ @site.logo }}">
  41. </div>
  42. </div>
  43. <div role="tabpanel" class="tab-pane fade" id="config-parse">
  44. <!-- TODO: Set checked attributes on current values, rather than defaults -->
  45. <p>{{ @dict.parser_syntax }}</p>
  46. <div class="form-group" style="margin-bottom: 0;">
  47. <div class="checkbox">
  48. <label>
  49. <input type="checkbox" name="parse-markdown" value="1" autocomplete="off" {{ @parse.markdown ? 'checked' : '' }}>
  50. Markdown
  51. </label>
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. <div class="checkbox">
  56. <label>
  57. <input type="checkbox" name="parse-textile" value="1" autocomplete="off" {{ @parse.textile ? 'checked' : '' }}>
  58. Textile
  59. </label>
  60. </div>
  61. </div>
  62. <p>{{ @dict.advanced_options }}</p>
  63. <div class="form-group">
  64. <div class="checkbox">
  65. <label>
  66. <input type="checkbox" name="parse-ids" value="1" {{ @parse.ids ? 'checked' : '' }}>
  67. {{ @dict.convert_ids }}
  68. </label>
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <div class="checkbox">
  73. <label>
  74. <input type="checkbox" name="parse-hashtags" value="1" {{ @parse.hashtags ? 'checked' : '' }}>
  75. {{ @dict.convert_hashtags }}
  76. </label>
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <div class="checkbox">
  81. <label>
  82. <input type="checkbox" name="parse-urls" value="1" {{ @parse.urls ? 'checked' : '' }}>
  83. {{ @dict.convert_urls }}
  84. </label>
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <div class="checkbox">
  89. <label>
  90. <input type="checkbox" name="parse-emoticons" value="1" {{ @parse.emoticons ? 'checked' : '' }}>
  91. {{ @dict.convert_emoticons }}
  92. </label>
  93. </div>
  94. </div>
  95. </div>
  96. <div role="tabpanel" class="tab-pane fade" id="config-email">
  97. <fieldset>
  98. <legend>{{ @dict.outgoing_mail }}</legend>
  99. <div class="form-group">
  100. <label class="control-label" for="mail-from">{{ @dict.from_address}}</label>
  101. <input type="text" class="form-control input-sm" name="mail-from" value="{{ @mail.from }}" placeholder="{{ @dict.email_leave_blank }}">
  102. </div>
  103. <p class="alert alert-info"><strong>{{ @dict.config_note }}:</strong> {{ @dict.package_mail_config_note, @PACKAGE | format }} </p>
  104. </fieldset>
  105. <br>
  106. <fieldset>
  107. <legend>{{ @dict.incoming_mail }}</legend>
  108. <div class="form-group">
  109. <label class="control-label" for="imap-hostname">{{ @dict.hostname }}</label>
  110. <input type="text" class="form-control input-sm" name="imap-hostname" value="{{ @imap.hostname }}" placeholder="{{ @dict.email_leave_blank }}">
  111. </div>
  112. <div class="form-group">
  113. <label class="control-label" for="imap-username">{{ @dict.username }}</label>
  114. <input type="text" class="form-control input-sm" name="imap-username" value="{{ @imap.username }}">
  115. </div>
  116. <div class="form-group">
  117. <label class="control-label" for="imap-password">{{ @dict.password }}</label>
  118. <input type="text" class="form-control input-sm" name="imap-password" value="{{ str_repeat('*', strlen(@imap.password)) }}">
  119. </div>
  120. <div class="form-group">
  121. <label class="control-label" for="mail-truncate_lines">{{ @dict.imap_truncate_lines }}</label>
  122. <textarea class="form-control input-sm" name="mail-truncate_lines" rows="4">{{ implode("\n", is_array(@mail.truncate_lines) ? @mail.truncate_lines : \Base::instance()->split(@mail.truncate_lines)) | esc }}</textarea>
  123. </div>
  124. <p class="alert alert-info"><strong>{{ @dict.config_note }}:</strong> {{ @dict.imap_settings_note, '<code>checkmail.php</code>' | format }}</p>
  125. </fieldset>
  126. </div>
  127. <div role="tabpanel" class="tab-pane fade" id="config-advanced">
  128. <h3>{{ @dict.security }}</h3>
  129. <div class="form-group">
  130. <label class="control-label">{{ @dict.min_pass_len }}</label>
  131. <input type="number" class="form-control input-sm" name="security-min_pass_len" value="{{ @security.min_pass_len }}">
  132. </div>
  133. <div class="form-group">
  134. <div class="checkbox">
  135. <label>
  136. <input type="checkbox" name="security-block_ccs" value="1" {{ @security.block_ccs ? 'checked' : '' }}>
  137. {{ @dict.censor_credit_card_numbers }}
  138. </label>
  139. </div>
  140. </div>
  141. <h3>{{ @dict.general }}</h3>
  142. <div class="form-group">
  143. <label class="control-label">{{ @dict.cookie_expiration }}</label>
  144. <input type="text" class="form-control input-sm" value="{{ @JAR.expire }}">
  145. </div>
  146. <div class="form-group">
  147. <label class="control-label">{{ @dict.max_upload_size }}</label>
  148. <input type="text" class="form-control input-sm" value="{{ @files.maxsize }}">
  149. </div>
  150. <div class="form-group">
  151. <div class="checkbox">
  152. <label>
  153. <input type="checkbox" name="site-public_registration" value="1" {{ @site.public_registration ? 'checked' : '' }}>
  154. {{ @dict.allow_public_registration }}
  155. </label>
  156. </div>
  157. </div>
  158. <hr>
  159. <h3>{{ @dict.core }}</h3>
  160. <div class="form-group">
  161. <label class="control-label">{{ @dict.debug_level }}</label>
  162. <input type="text" class="form-control input-sm" value="{{ @DEBUG }}" readonly>
  163. </div>
  164. <div class="form-group">
  165. <label class="control-label">{{ @dict.cache_mode }}</label>
  166. <input type="text" class="form-control input-sm" value="{{ @CACHE }}" readonly>
  167. </div>
  168. <div class="form-group">
  169. <label class="control-label">{{ @dict.demo_user }}</label>
  170. <input type="text" class="form-control input-sm" value="{{ @site.demo ?: 'Disabled' }}" readonly>
  171. </div>
  172. <p class="alert alert-info">{{ @dict.advanced_config_note,'<code>config</code>' | format }}</p>
  173. </div>
  174. </div>
  175. </div>
  176. </form>
  177. <include href="blocks/footer.html" />
  178. </div>
  179. <script type="text/javascript">
  180. $(document).ready(function() {
  181. // Auto-select tab if hash is present
  182. if(window.location.hash) {
  183. $('.nav a').filter('[href=#config-' + window.location.hash.substr(1) + ']').click();
  184. }
  185. // Handle input changes
  186. $('#frm-config').on('change', 'input, select, textarea', function(e) {
  187. var $el = $(this),
  188. val = $el.val();
  189. if($el.attr('type') == 'checkbox') {
  190. val = $el.prop('checked') ? 1 : 0;
  191. }
  192. $.post(BASE + '/admin/config/saveattribute', {
  193. attribute: $el.attr('name'),
  194. value: val
  195. }, function(data) {
  196. if(data.error) {
  197. alert(data.error);
  198. } else {
  199. $el.parents('.form-group').addClass('has-success');
  200. setTimeout(function() {
  201. $el.parents('.form-group').removeClass('has-success');
  202. }, 2500);
  203. }
  204. }, 'json');
  205. });
  206. });
  207. </script>
  208. </body>
  209. </html>