release_point_edit.tpl.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header');
  4. ?>
  5. <script type="text/javascript">
  6. <!--
  7. $(function(){
  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. $("#name").formValidator({onshow:"<?php echo L('input').L('release_point_name')?>",onfocus:"<?php echo L('input').L('release_point_name')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('release_point_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=release_point&a=public_name&id=<?php echo $id?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('release_point_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed();
  10. $("#host").formValidator({onshow:"<?php echo L('input').L('server_address')?>",onfocus:"<?php echo L('input').L('server_address')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('server_address')?>"});
  11. $("#port").formValidator({onshow:"<?php echo L('input').L('server_port')?>",onfocus:"<?php echo L('input').L('server_port')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('server_port')?>"}).regexValidator({datatype:'enum',regexp:'intege1',onerror:'<?php echo L('server_ports_must_be_integers')?>'});
  12. $("#username").formValidator({onshow:"<?php echo L('input').L('username')?>",onfocus:"<?php echo L('input').L('username')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('username')?>"});
  13. $("#password").formValidator({onshow:"<?php echo L('input').L('password')?>",onfocus:"<?php echo L('input').L('password')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('password')?>"});
  14. })
  15. //-->
  16. </script>
  17. <div class="pad-10">
  18. <form action="?m=admin&c=release_point&a=edit&id=<?php echo $id?>" method="post" id="myform">
  19. <fieldset>
  20. <legend><?php echo L('basic_configuration')?></legend>
  21. <table width="100%" class="table_form">
  22. <tr>
  23. <th width="80"><?php echo L('release_point_name')?>:</th>
  24. <td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="30" value="<?php echo $data['name']?>" /></td>
  25. </tr>
  26. </table>
  27. </fieldset>
  28. <div class="bk15"></div>
  29. <fieldset>
  30. <legend><?php echo L('ftp_server')?></legend>
  31. <table width="100%" class="table_form">
  32. <tr>
  33. <th width="80"><?php echo L('server_address')?>:</th>
  34. <td class="y-bg"><input type="text" class="input-text" name="host" id="host" size="30" value="<?php echo $data['host']?>" /></td>
  35. </tr>
  36. <tr>
  37. <th width="80"><?php echo L("server_port")?>:</th>
  38. <td class="y-bg"><input type="text" class="input-text" name="port" id="port" size="30" value="<?php echo $data['port']?>" /></td>
  39. </tr>
  40. <tr>
  41. <th><?php echo L('username')?>:</th>
  42. <td class="y-bg"><input type="text" class="input-text" name="username" id="username" size="30" value="<?php echo $data['username']?>" /></td>
  43. </tr>
  44. <tr>
  45. <th><?php echo L('password')?>:</th>
  46. <td class="y-bg"><input type="password" class="input-text" name="password" id="password" size="30" value="<?php echo $data['password']?> "/></td>
  47. </tr>
  48. <tr>
  49. <th><?php echo L('path')?>:</th>
  50. <td class="y-bg"><input type="text" class="input-text" name="path" id="path" size="30" value="<?php echo $data['path']?>" /></td>
  51. </tr>
  52. <tr>
  53. <th><?php echo L('passive_mode')?>:</th>
  54. <td class="y-bg"><label><input type="checkbox" class="inputcheckbox" name="pasv" id="pasv" value="1" size="30"<?php if ($data['pasv']){echo ' checked';}?> /><?php echo L('yes')?></label></td>
  55. </tr>
  56. <tr>
  57. <th><?php echo L('ssl_connection')?>:</th>
  58. <td class="y-bg"><label><input type="checkbox" class="inputcheckbox" name="ssl" id="ssl" value="1" size="30"<?php if ($data['ssl']){echo ' checked';}?> <?php if(!$this->ssl){ echo 'disabled';}?> /><?php echo L('yes')?></label> <?php if(!$this->ssl){ echo '<span style="color:red">'.L('your_server_will_not_support_the_ssl_connection').'</a>';}?></td>
  59. </tr>
  60. </tr>
  61. <tr>
  62. <th><?php echo L('test_connections')?>:</th>
  63. <td class="y-bg"><input type="button" class="button" onclick="ftp_test()" value="<?php echo L('test_connections')?>" /></td>
  64. </tr>
  65. </table>
  66. </fieldset>
  67. <div class="bk15"></div>
  68. <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit')?>" />
  69. </div>
  70. </div>
  71. <script type="text/javascript">
  72. <!--
  73. function ftp_test() {
  74. if(!$.formValidator.isOneValid('host')) {
  75. $('#host').focus();
  76. return false;
  77. }
  78. if(!$.formValidator.isOneValid('port')) {
  79. $('#port').focus();
  80. return false;
  81. }
  82. if(!$.formValidator.isOneValid('username')) {
  83. $('#username').focus();return false;
  84. }
  85. if(!$.formValidator.isOneValid('password')) {
  86. $('#password').focus();return false;
  87. }
  88. var host = $('#host').val();
  89. var port = $('#port').val();
  90. var username = $('#username').val();
  91. var password = $('#password').val();
  92. var pasv = $("input[type='checkbox'][name='pasv']:checked").val();
  93. var ssl = $("input[type='checkbox'][name='ssl']:checked").val();
  94. $.get("?",{m:'admin',c:'release_point',a:'public_test_ftp', host:host,port:port,username:username,password:password,pasv:pasv,ssl:ssl}, function(data){
  95. if (data==1){
  96. alert('<?php echo L('ftp_server_connections_success')?>');
  97. } else {
  98. alert(data);
  99. }
  100. })
  101. }
  102. //-->
  103. </script>
  104. </form>
  105. </body>
  106. </html>