setting.tpl.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header');?>
  4. <script type="text/javascript">
  5. <!--
  6. $(function(){
  7. SwapTab('setting','on','',5,<?php echo $_GET['tab'] ? $_GET['tab'] : '1'?>);
  8. $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
  9. $("#js_path").formValidator({onshow:"<?php echo L('setting_input').L('setting_js_path')?>",onfocus:"<?php echo L('setting_js_path').L('setting_end_with_x')?>"}).inputValidator({onerror:"<?php echo L('setting_js_path').L('setting_input_error')?>"}).regexValidator({regexp:"(.+)\/$",onerror:"<?php echo L('setting_js_path').L('setting_end_with_x')?>"});
  10. $("#css_path").formValidator({onshow:"<?php echo L('setting_input').L('setting_css_path')?>",onfocus:"<?php echo L('setting_css_path').L('setting_end_with_x')?>"}).inputValidator({onerror:"<?php echo L('setting_css_path').L('setting_input_error')?>"}).regexValidator({regexp:"(.+)\/$",onerror:"<?php echo L('setting_css_path').L('setting_end_with_x')?>"});
  11. $("#img_path").formValidator({onshow:"<?php echo L('setting_input').L('setting_img_path')?>",onfocus:"<?php echo L('setting_img_path').L('setting_end_with_x')?>"}).inputValidator({onerror:"<?php echo L('setting_img_path').L('setting_input_error')?>"}).regexValidator({regexp:"(.+)\/$",onerror:"<?php echo L('setting_img_path').L('setting_end_with_x')?>"});
  12. $("#upload_url").formValidator({onshow:"<?php echo L('setting_input').L('setting_upload_url')?>",onfocus:"<?php echo L('setting_upload_url').L('setting_end_with_x')?>"}).inputValidator({onerror:"<?php echo L('setting_upload_url').L('setting_input_error')?>"}).regexValidator({regexp:"(.+)\/$",onerror:"<?php echo L('setting_upload_url').L('setting_end_with_x')?>"});
  13. $("#errorlog_size").formValidator({onshow:"<?php echo L('setting_errorlog_hint')?>",onfocus:"<?php echo L('setting_input').L('setting_error_log_size')?>"}).inputValidator({onerror:"<?php echo L('setting_error_log_size').L('setting_input_error')?>"}).regexValidator({regexp:"num",datatype:"enum",onerror:"<?php echo L('setting_errorlog_type')?>"});
  14. $("#phpsso_api_url").formValidator({onshow:"<?php echo L('setting_phpsso_type')?>",onfocus:"<?php echo L('setting_phpsso_type')?>",tipcss:{width:'300px'},empty:false}).inputValidator({onerror:"<?php echo L('setting_phpsso_type')?>"}).regexValidator({regexp:"http:\/\/(.+)[^/]$",onerror:"<?php echo L('setting_phpsso_type')?>"});
  15. $("#phpsso_appid").formValidator({onshow:"<?php echo L('input').L('setting_phpsso_appid')?>",onfocus:"<?php echo L('input').L('setting_phpsso_appid')?>"}).regexValidator({regexp:"^\\d{1,8}$",onerror:"<?php echo L('setting_phpsso_appid').L('must_be_number')?>"});
  16. $("#phpsso_version").formValidator({onshow:"<?php echo L('input').L('setting_phpsso_version')?>",onfocus:"<?php echo L('input').L('setting_phpsso_version')?>"}).regexValidator({regexp:"^\\d{1,8}$",onerror:"<?php echo L('setting_phpsso_version').L('must_be_number')?>"});
  17. $("#phpsso_auth_key").formValidator({onshow:"<?php echo L('input').L('setting_phpsso_auth_key')?>",onfocus:"<?php echo L('input').L('setting_phpsso_auth_key')?>"}).regexValidator({regexp:"^\\w{32}$",onerror:"<?php echo L('setting_phpsso_auth_key').L('must_be_32_w')?>"});
  18. })
  19. //-->
  20. </script>
  21. <form action="?m=admin&c=setting&a=save" method="post" id="myform">
  22. <div class="pad-10">
  23. <div class="col-tab">
  24. <ul class="tabBut cu-li">
  25. <li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',5,1);"><?php echo L('setting_basic_cfg')?></li>
  26. <li id="tab_setting_2" onclick="SwapTab('setting','on','',5,2);"><?php echo L('setting_safe_cfg')?></li>
  27. <li id="tab_setting_3" onclick="SwapTab('setting','on','',5,3);"><?php echo L('setting_sso_cfg')?></li>
  28. <li id="tab_setting_4" onclick="SwapTab('setting','on','',5,4);"><?php echo L('setting_mail_cfg')?></li>
  29. <li id="tab_setting_5" onclick="SwapTab('setting','on','',5,5);"><?php echo L('setting_connect')?></li>
  30. </ul>
  31. <div id="div_setting_1" class="contentList pad-10">
  32. <table width="100%" class="table_form">
  33. <tr>
  34. <th width="120"><?php echo L('setting_admin_email')?></th>
  35. <td class="y-bg"><input type="text" class="input-text" name="setting[admin_email]" id="admin_email" size="30" value="<?php echo $admin_email?>"/></td>
  36. </tr>
  37. <tr>
  38. <th width="120"><?php echo L('setting_category_ajax')?></th>
  39. <td class="y-bg"><input type="text" class="input-text" name="setting[category_ajax]" id="category_ajax" size="5" value="<?php echo $category_ajax?>"/>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo L('setting_category_ajax_desc')?></td>
  40. </tr>
  41. <tr>
  42. <th width="120"><?php echo L('setting_gzip')?></th>
  43. <td class="y-bg">
  44. <input name="setconfig[gzip]" value="1" type="radio" <?php echo ($gzip=='1') ? ' checked' : ''?>> <?php echo L('setting_yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  45. <input name="setconfig[gzip]" value="0" type="radio" <?php echo ($gzip=='0') ? ' checked' : ''?>> <?php echo L('setting_no')?></td>
  46. </tr>
  47. <tr>
  48. <th width="120"><?php echo L('setting_attachment_stat')?></th>
  49. <td class="y-bg">
  50. <input name="setconfig[attachment_stat]" value="1" type="radio" <?php echo ($attachment_stat=='1') ? ' checked' : ''?>> <?php echo L('setting_yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  51. <input name="setconfig[attachment_stat]" value="0" type="radio" <?php echo ($attachment_stat=='0') ? ' checked' : ''?>> <?php echo L('setting_no')?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo L('setting_attachment_stat_desc')?></td>
  52. </tr>
  53. <tr>
  54. <th width="120"><?php echo L('setting_js_path')?></th>
  55. <td class="y-bg"><input type="text" class="input-text" name="setconfig[js_path]" id="js_path" size="50" value="<?php echo JS_PATH?>" /></td>
  56. </tr>
  57. <tr>
  58. <th width="120"><?php echo L('setting_css_path')?></th>
  59. <td class="y-bg"><input type="text" class="input-text" name="setconfig[css_path]" id="css_path" size="50" value="<?php echo CSS_PATH?>"/></td>
  60. </tr>
  61. <tr>
  62. <th width="120"><?php echo L('setting_img_path')?></th>
  63. <td class="y-bg"><input type="text" class="input-text" name="setconfig[img_path]" id="img_path" size="50" value="<?php echo IMG_PATH?>" /></td>
  64. </tr>
  65. <tr>
  66. <th width="120"><?php echo L('setting_upload_url')?></th>
  67. <td class="y-bg"><input type="text" class="input-text" name="setconfig[upload_url]" id="upload_url" size="50" value="<?php echo $upload_url?>" /></td>
  68. </tr>
  69. </table>
  70. </div>
  71. <div id="div_setting_2" class="contentList pad-10 hidden">
  72. <table width="100%" class="table_form">
  73. <tr>
  74. <th width="120"><?php echo L('setting_admin_log')?></th>
  75. <td class="y-bg">
  76. <input name="setconfig[admin_log]" value="1" type="radio" <?php echo ($admin_log=='1') ? ' checked' : ''?>> <?php echo L('setting_yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  77. <input name="setconfig[admin_log]" value="0" type="radio" <?php echo ($admin_log=='0') ? ' checked' : ''?>> <?php echo L('setting_no')?>
  78. </td>
  79. </tr>
  80. <tr>
  81. <th width="120"><?php echo L('setting_error_log')?></th>
  82. <td class="y-bg">
  83. <input name="setconfig[errorlog]" value="1" type="radio" <?php echo ($errorlog=='1') ? ' checked' : ''?>> <?php echo L('setting_yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  84. <input name="setconfig[errorlog]" value="0" type="radio" <?php echo ($errorlog=='0') ? ' checked' : ''?>> <?php echo L('setting_no')?>
  85. </td>
  86. </tr>
  87. <tr>
  88. <th><?php echo L('setting_error_log_size')?></th>
  89. <td class="y-bg"><input type="text" class="input-text" name="setting[errorlog_size]" id="errorlog_size" size="5" value="<?php echo $errorlog_size?>"/> MB</td>
  90. </tr>
  91. <tr>
  92. <th><?php echo L('setting_maxloginfailedtimes')?></th>
  93. <td class="y-bg"><input type="text" class="input-text" name="setting[maxloginfailedtimes]" id="maxloginfailedtimes" size="10" value="<?php echo $maxloginfailedtimes?>"/></td>
  94. </tr>
  95. <tr>
  96. <th><?php echo L('setting_minrefreshtime')?></th>
  97. <td class="y-bg"><input type="text" class="input-text" name="setting[minrefreshtime]" id="minrefreshtime" size="10" value="<?php echo $minrefreshtime?>"/> <?php echo L('miao')?></td>
  98. </tr>
  99. <tr>
  100. <th><?php echo L('admin_url')?></th>
  101. <td class="y-bg"><TABLE>
  102. <TR>
  103. <TD width="270"><?php echo SITE_PROTOCOL;?><input type="text" class="input-text" name="setconfig[admin_url]" id="admin_url" size="30" value="<?php echo $admin_url?>"/> </TD>
  104. <TD><?php echo L('admin_url_tips')?></TD>
  105. </TR>
  106. </TABLE> </td>
  107. </tr>
  108. </table>
  109. </div>
  110. <div id="div_setting_3" class="contentList pad-10 hidden">
  111. <table width="100%" class="table_form">
  112. <tr>
  113. <th width="120"><?php echo L('setting_phpsso')?></th>
  114. <td class="y-bg">
  115. <input name="setconfig[phpsso]" value="1" type="radio" <?php echo ($phpsso=='1') ? ' checked' : ''?>> <?php echo L('setting_yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  116. <input name="setconfig[phpsso]" value="0" type="radio" <?php echo ($phpsso=='0') ? ' checked' : ''?>> <?php echo L('setting_no')?></td>
  117. </tr>
  118. <tr>
  119. <th><?php echo L('setting_phpsso_appid')?></th>
  120. <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_appid]" id="phpsso_appid" size="30" value="<?php echo $phpsso_appid ?>"/></td>
  121. </tr>
  122. <tr>
  123. <th><?php echo L('setting_phpsso_phpsso_api_url')?></th>
  124. <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_api_url]" id="phpsso_api_url" size="50" value="<?php echo $phpsso_api_url ?>"/></td>
  125. </tr>
  126. <tr>
  127. <th><?php echo L('setting_phpsso_auth_key')?></th>
  128. <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_auth_key]" id="phpsso_auth_key" size="50" value="<?php echo $phpsso_auth_key ?>"/></td>
  129. </tr>
  130. <tr>
  131. <th><?php echo L('setting_phpsso_version')?></th>
  132. <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_version]" id="phpsso_version" size="2" value="<?php echo $phpsso_version ?>"/></td>
  133. </tr>
  134. </table>
  135. </div>
  136. <div id="div_setting_4" class="contentList pad-10 hidden">
  137. <table width="100%" class="table_form">
  138. <tr>
  139. <th width="120"><?php echo L('mail_type')?></th>
  140. <td class="y-bg">
  141. <input name="setting[mail_type]" checkbox="mail_type" value="1" onclick="showsmtp(this)" type="radio" <?php echo $mail_type==1 ? ' checked' : ''?>> <?php echo L('mail_type_smtp')?>
  142. <input name="setting[mail_type]" checkbox="mail_type" value="0" onclick="showsmtp(this)" type="radio" <?php echo $mail_type==0 ? ' checked' : ''?> <?php if(substr(strtolower(PHP_OS), 0, 3) == 'win') echo 'disabled'; ?>/> <?php echo L('mail_type_mail')?>
  143. </td>
  144. </tr>
  145. <tbody id="smtpcfg" style="<?php if($mail_type == 0) echo 'display:none'?>">
  146. <tr>
  147. <th><?php echo L('mail_server')?></th>
  148. <td class="y-bg"><input type="text" class="input-text" name="setting[mail_server]" id="mail_server" size="30" value="<?php echo $mail_server?>"/></td>
  149. </tr>
  150. <tr>
  151. <th><?php echo L('mail_port')?></th>
  152. <td class="y-bg"><input type="text" class="input-text" name="setting[mail_port]" id="mail_port" size="30" value="<?php echo $mail_port?>"/></td>
  153. </tr>
  154. <tr>
  155. <th><?php echo L('mail_from')?></th>
  156. <td class="y-bg"><input type="text" class="input-text" name="setting[mail_from]" id="mail_from" size="30" value="<?php echo $mail_from?>"/></td>
  157. </tr>
  158. <tr>
  159. <th><?php echo L('mail_auth')?></th>
  160. <td class="y-bg">
  161. <input name="setting[mail_auth]" checkbox="mail_auth" value="1" type="radio" <?php echo $mail_auth==1 ? ' checked' : ''?>> <?php echo L('mail_auth_open')?>
  162. <input name="setting[mail_auth]" checkbox="mail_auth" value="0" type="radio" <?php echo $mail_auth==0 ? ' checked' : ''?>> <?php echo L('mail_auth_close')?></td>
  163. </tr>
  164. <tr>
  165. <th><?php echo L('mail_user')?></th>
  166. <td class="y-bg"><input type="text" class="input-text" name="setting[mail_user]" id="mail_user" size="30" value="<?php echo $mail_user?>"/></td>
  167. </tr>
  168. <tr>
  169. <th><?php echo L('mail_password')?></th>
  170. <td class="y-bg"><input type="password" class="input-text" name="setting[mail_password]" id="mail_password" size="30" value="<?php echo $mail_password?>"/></td>
  171. </tr>
  172. </tbody>
  173. <tr>
  174. <th><?php echo L('mail_test')?></th>
  175. <td class="y-bg"><input type="text" class="input-text" name="mail_to" id="mail_to" size="30" value=""/> <input type="button" class="button" onClick="javascript:test_mail();" value="<?php echo L('mail_test_send')?>"></td>
  176. </tr>
  177. </table>
  178. </div>
  179. <div id="div_setting_5" class="contentList pad-10 hidden">
  180. <table width="100%" class="table_form">
  181. <tr>
  182. <th width="120"><?php echo L('setting_snda_enable')?></th>
  183. <td class="y-bg">
  184. APP key <input type="text" class="input-text" name="setconfig[snda_akey]" id="snda_akey" size="20" value="<?php echo $snda_akey ?>"/>
  185. APP secret key <input type="text" class="input-text" name="setconfig[snda_skey]" id="snda_skey" size="40" value="<?php echo $snda_skey ?>"/> <a href="http://code.snda.com/index/oauth" target="_blank"><?php echo L('click_register')?></a>
  186. </td>
  187. </tr>
  188. <tr>
  189. <th><?php echo L('setting_connect_sina')?></th>
  190. <td class="y-bg">
  191. App key <input type="text" class="input-text" name="setconfig[sina_akey]" id="sina_akey" size="20" value="<?php echo $sina_akey ?>"/>
  192. App secret key <input type="text" class="input-text" name="setconfig[sina_skey]" id="sina_skey" size="40" value="<?php echo $sina_skey ?>"/> <a href="http://open.t.sina.com.cn/wiki/index.php/<?php echo L('connect_micro')?>" target="_blank"><?php echo L('click_register')?></a>
  193. </td>
  194. </tr>
  195. <tr>
  196. <th><?php echo L('setting_connect_qq')?></th>
  197. <td class="y-bg">
  198. App key <input type="text" class="input-text" name="setconfig[qq_akey]" id="qq_akey" size="20" value="<?php echo $qq_akey ?>"/>
  199. App secret key <input type="text" class="input-text" name="setconfig[qq_skey]" id="qq_skey" size="40" value="<?php echo $qq_skey ?>"/> <a href="http://open.t.qq.com/" target="_blank"><?php echo L('click_register')?></a>
  200. </td>
  201. </tr>
  202. <tr>
  203. <th><?php echo L('setting_connect_qqnew')?></th>
  204. <td class="y-bg">
  205. App I D &nbsp;<input type="text" class="input-text" name="setconfig[qq_appid]" id="qq_appid" size="20" value="<?php echo $qq_appid;?>"/>
  206. App key <input type="text" class="input-text" name="setconfig[qq_appkey]" id="qq_appkey" size="40" value="<?php echo $qq_appkey;?>"/>
  207. <?php echo L('setting_connect_qqcallback')?> <input type="text" class="input-text" name="setconfig[qq_callback]" id="qq_callback" size="40" value="<?php echo $qq_callback;?>"/>
  208. <a href="http://connect.qq.com" target="_blank"><?php echo L('click_register')?></a>
  209. </td>
  210. </tr>
  211. </table>
  212. </div>
  213. <div class="bk15"></div>
  214. <input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
  215. </div>
  216. </div>
  217. </form>
  218. </body>
  219. <script type="text/javascript">
  220. function SwapTab(name,cls_show,cls_hide,cnt,cur){
  221. for(i=1;i<=cnt;i++){
  222. if(i==cur){
  223. $('#div_'+name+'_'+i).show();
  224. $('#tab_'+name+'_'+i).attr('class',cls_show);
  225. }else{
  226. $('#div_'+name+'_'+i).hide();
  227. $('#tab_'+name+'_'+i).attr('class',cls_hide);
  228. }
  229. }
  230. }
  231. function showsmtp(obj,hiddenid){
  232. hiddenid = hiddenid ? hiddenid : 'smtpcfg';
  233. var status = $(obj).val();
  234. if(status == 1) $("#"+hiddenid).show();
  235. else $("#"+hiddenid).hide();
  236. }
  237. function test_mail() {
  238. var mail_type = $('input[checkbox=mail_type][checked]').val();
  239. var mail_auth = $('input[checkbox=mail_auth][checked]').val();
  240. $.post('?m=admin&c=setting&a=public_test_mail&mail_to='+$('#mail_to').val(),{mail_type:mail_type,mail_server:$('#mail_server').val(),mail_port:$('#mail_port').val(),mail_user:$('#mail_user').val(),mail_password:$('#mail_password').val(),mail_auth:mail_auth,mail_from:$('#mail_from').val()}, function(data){
  241. alert(data);
  242. });
  243. }
  244. </script>
  245. </html>