Просмотр файла mc-2.7.0/modules/downloads/views/admin/ftp_upload.tpl

Размер файла: 4.37Kb
  1. <?php $this->display('header', array('title' => 'Загрузка файлов с ФТП')) ?>
  2.  
  3. <style>
  4. #mask {
  5. position:absolute;
  6. left:0;
  7. top:0;
  8. z-index:9000;
  9. background-color:#000;
  10. display:none;
  11. }
  12. #boxes .window {
  13. position:absolute;
  14. left:0;
  15. top:0;
  16. width:440px;
  17. height:200px;
  18. display:none;
  19. z-index:9999;
  20. padding:20px;
  21. }
  22. #boxes #dialog {
  23. width:375px;
  24. height:203px;
  25. padding:10px;
  26. background-color:#ffffff;
  27. }
  28. </style>
  29.  
  30. <?php if($error): ?>
  31. <div class="error">
  32. <?php echo $error ?>
  33. </div>
  34. <?php endif; ?>
  35.  
  36. <form action="<?php echo a_url('downloads/admin/ftp_upload', 'directory_id='. @$_GET['directory_id']) ?>" method="post">
  37. <div class="box">
  38. <h3>Загрузка файлов с ФТП</h3>
  39. <div class="inside">
  40. <p>
  41. <label>Слить в папку</label>
  42. <b><?php echo $directory['name'] ?></b>
  43. </p>
  44. <p>
  45. <label>Из какой папки сливать</label>
  46. <input name="from_directory" id="from_directory" type="text" value="" style="width: 400px;"><button id="button_dialog">Обзор</button>
  47. </p>
  48. <p>
  49. <input name="translite" type="checkbox" value="ON" checked="checked"> Транслитерация имён файлов<br />
  50. </p>
  51. </div>
  52. </div>
  53.  
  54. <p><input type="submit" name="submit" value="Загрузить"></p>
  55.  
  56. </form>
  57.  
  58. <!-- Окно для выбора папки -->
  59. <div id="boxes">
  60. <div id="dialog" class="window">
  61. <span style="text-align: right;"><a href="#" class="close">x</a></span>
  62. <div id="list_directories" style="border: 1px double black; padding: 5px 5px 5px 5px;">
  63. </div>
  64. <br />
  65. Текущая папка:<br />
  66. <input id="directory"><br />
  67. <button class="close" onclick="change_directory()";>Выбрать</button>
  68. </div>
  69. </div>
  70.  
  71. <!-- Макска, которая затемняет весь экран -->
  72. <div id="mask"></div>
  73.  
  74. <script>
  75. $(document).ready(function () {
  76. $('#button_dialog').click(function (e) {
  77. e.preventDefault();
  78. var id = '#dialog';
  79.  
  80. var maskHeight = $(document).height();
  81. var maskWidth = $(window).width();
  82.  
  83. $('#mask').css({'width':maskWidth,'height':maskHeight});
  84.  
  85. $('#mask').fadeIn(100);
  86. $('#mask').fadeTo("slow", 0.8);
  87.  
  88. var winH = $(window).height();
  89. var winW = $(window).width();
  90.  
  91. $(id).css('top', winH / 3 - $(id).height() / 2);
  92. $(id).css('left', winW / 2 - $(id).width() / 2);
  93.  
  94. $(id).fadeIn(200);
  95.  
  96. list_directories('');
  97. });
  98.  
  99. $('.window .close').click(function (e) {
  100. e.preventDefault();
  101. $('#mask, .window').hide();
  102. });
  103.  
  104. $('#mask').click(function () {
  105. $(this).hide();
  106. $('.window').hide();
  107. });
  108. });
  109.  
  110. function list_directories(directory) {
  111. return $.ajax({
  112. type: "GET",
  113. url: "<?php echo a_url('downloads/admin/ftp_upload_get_directories') ?>?directory=" + directory,
  114.  
  115. async: false,
  116. beforeSend: function () {
  117.  
  118. },
  119. success: function (response) {
  120. $('#list_directories').empty();
  121. $('#directory').empty();
  122.  
  123. var directories = eval("(" + response + ")");
  124. var i = 0;
  125. for (var key in directories) {
  126. $('#list_directories').append('<a href="#" onclick="list_directories(\'' + key + '\')">' + directories[key] + '</a><br />');
  127. i++;
  128. }
  129. if (i == 0)
  130. $('#list_directories').append('Папка пуста!');
  131. $('#directory').val(directory);
  132. },
  133. error: function () {
  134. alert('error');
  135. }
  136. }).responseText;
  137. }
  138.  
  139. function change_directory() {
  140. var directory = $('#directory').val();
  141. $('#from_directory').val(directory);
  142. }
  143. </script>
  144.  
  145. <?php $this->display('footer') ?>