badword_edit.tpl.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header');?>
  4. <script type="text/javascript">
  5. $(function(){
  6. $.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();})}});
  7. $("#badword").formValidator({onshow:"<?php echo L("input").L('badword_name')?>",onfocus:"<?php echo L("input").L('badword_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('badword_name')?>"}).regexValidator({regexp:"notempty",datatype:"enum",param:'i',onerror:"<?php echo L('input_not_space')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=badword&a=public_name&badid=<?php echo $badid;?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('badword_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed();
  8. $("#replaceword").formValidator({empty:true,onshow:"<?php echo L('badword_noreplace')?>",onfocus:"<?php echo L("input").L('badword_replacename')?>",oncorrect:"<?php echo L('format_right')?>",onempty:"<?php echo L('badword_notreplace')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('badword_replacename')?>"});
  9. })
  10. </script>
  11. <div class="pad_10">
  12. <table cellpadding="2" cellspacing="1" class="table_form" width="100%">
  13. <form action="?m=admin&c=badword&a=edit&badid=<?php echo $badid?>" method="post" name="myform" id="myform">
  14. <tr>
  15. <th width="20%"><?php echo L('badword_name')?></th>
  16. <td><input type="text" name="badword" id="badword" value="<?php echo $badword?>"></td>
  17. </tr>
  18. <tr>
  19. <th width="20%"><?php echo L('badword_replacename')?></th>
  20. <td><input type="text" name="replaceword" id="replaceword" value="<?php echo $replaceword ?>" ></td>
  21. </tr>
  22. <tr>
  23. <th width="20%"><?php echo L('badword_level')?></th>
  24. <td>
  25. <select size="1" id="info[level]" name="info[level]">
  26. <?php
  27. if($level=='1'){
  28. $level1 = "selected";
  29. }else{
  30. $level2 = "selected";
  31. }
  32. ?>
  33. <option <?php echo $level1;?> value="1"><?php echo L('badword_common')?></option>
  34. <option <?php echo $level2;?> value="2"><?php echo L('badword_dangerous')?></option>
  35. </select>
  36. <?php echo L('badword_level_info')?>
  37. </td>
  38. </tr>
  39. <input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('submit')?> " class="dialog">
  40. </form>
  41. </table>
  42. </div>
  43. </body>
  44. </html>