setting.tpl.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header', 'admin');?>
  4. <form method="post" action="?m=search&c=search_admin&a=setting">
  5. <div class="pad_10">
  6. <div class="col-tab">
  7. <ul class="tabBut cu-li">
  8. <li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',2,1);"><?php echo L('basic_setting')?></li>
  9. <li id="tab_setting_2" onclick="SwapTab('setting','on','',2,2);"><?php echo L('sphinx_setting')?></li>
  10. </ul>
  11. <div id="div_setting_1" class="contentList pad-10">
  12. <table width="100%" class="table_form">
  13. <tr>
  14. <th width="200"><?php echo L('enable_search')?></th>
  15. <td class="y-bg">
  16. <input type='radio' name='setting[fulltextenble]' value='1' <?php if($fulltextenble == 1) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  17. <input type='radio' name='setting[fulltextenble]' value='0' <?php if($fulltextenble == 0) {?>checked<?php }?>> <?php echo L('no')?></td>
  18. </tr>
  19. <tr>
  20. <th width="200"><?php echo L('relationenble')?></th>
  21. <td class="y-bg">
  22. <input type='radio' name='setting[relationenble]' value='1' <?php if($relationenble == 1) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  23. <input type='radio' name='setting[relationenble]' value='0' <?php if($relationenble == 0) {?>checked<?php }?>> <?php echo L('no')?> <?php echo L('relationenble_note')?></td>
  24. </tr>
  25. <tr>
  26. <th width="200"><?php echo L('suggestenable')?></th>
  27. <td class="y-bg">
  28. <input type='radio' name='setting[suggestenable]' value='1' <?php if($suggestenable == 1) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  29. <input type='radio' name='setting[suggestenable]' value='0' <?php if($suggestenable == 0) {?>checked<?php }?>> <?php echo L('no')?> <?php echo L('suggestenable_note')?></td>
  30. </tr>
  31. </table>
  32. </div>
  33. <div id="div_setting_2" class="contentList pad-10 hidden">
  34. <table width="100%" class="table_form">
  35. <tr>
  36. <th width="200"><?php echo L('sphinxenable')?></th>
  37. <td class="y-bg">
  38. <input type='radio' name='setting[sphinxenable]' value='1' <?php if($sphinxenable == 1) {?>checked<?php }?>> <?php echo L('yes')?>&nbsp;&nbsp;&nbsp;&nbsp;
  39. <input type='radio' name='setting[sphinxenable]' value='0' <?php if($sphinxenable == 0) {?>checked<?php }?>> <?php echo L('no')?>
  40. </td>
  41. </tr>
  42. <tr>
  43. <th><?php echo L('host')?></th>
  44. <td class="y-bg">
  45. <input name="setting[sphinxhost]" id="sphinxhost" value="<?php echo $sphinxhost?>" type="text" class="input-text"></td>
  46. </tr>
  47. <tr>
  48. <th><?php echo L('port')?></th>
  49. <td class="y-bg"><input name="setting[sphinxport]" id="sphinxport" value="<?php echo $sphinxport?>" type="text" class="input-text"></td>
  50. </tr>
  51. <tr>
  52. <th></th>
  53. <td class="y-bg"><input name="button" type="button" value="<?php echo L('test')?>" class="button" onclick="test_sphinx()"> <span id='testing'></span></td>
  54. </tr>
  55. </table>
  56. </div>
  57. <div class="bk15"></div>
  58. <input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
  59. </div>
  60. </form>
  61. </body>
  62. <script type="text/javascript">
  63. function SwapTab(name,cls_show,cls_hide,cnt,cur){
  64. for(i=1;i<=cnt;i++){
  65. if(i==cur){
  66. $('#div_'+name+'_'+i).show();
  67. $('#tab_'+name+'_'+i).attr('class',cls_show);
  68. }else{
  69. $('#div_'+name+'_'+i).hide();
  70. $('#tab_'+name+'_'+i).attr('class',cls_hide);
  71. }
  72. }
  73. }
  74. function showsmtp(obj,hiddenid){
  75. hiddenid = hiddenid ? hiddenid : 'smtpcfg';
  76. var status = $(obj).val();
  77. if(status == 1) $("#"+hiddenid).show();
  78. else $("#"+hiddenid).hide();
  79. }
  80. function test_sphinx() {
  81. $('#testing').html('<?php echo L('testing')?>');
  82. $.post('?m=search&c=search_admin&a=public_test_sphinx',{sphinxhost:$('#sphinxhost').val(),sphinxport:$('#sphinxport').val()}, function(data){
  83. message = '';
  84. if(data == 1) {
  85. message = '<?php echo L('testsuccess')?>';
  86. } else if(data == -1) {
  87. message = '<?php echo L('hostempty')?>';
  88. } else if(data == -2) {
  89. message = '<?php echo L('portempty')?>';
  90. } else {
  91. message = data;
  92. }
  93. $('#testing').html(message);
  94. //window.top.art.dialog({content:message,lock:true,width:'200',height:'50'},function(){});
  95. });
  96. }
  97. </script>
  98. </html>