exportfiles.html.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php include '../../../common/view/header.modal.html.php';?>
  2. <?php $this->app->loadLang('file');?>
  3. <div id="mainContent" class='load-indicator'>
  4. <div class='main-header'>
  5. <h2><?php echo $lang->export;?></h2>
  6. </div>
  7. <form class="main-form" target='hiddenwin' method='post'>
  8. <table class='table table-form'>
  9. <tr>
  10. <th class='w-100px'><?php echo $lang->doc->export->fileName?></th>
  11. <td><?php echo html::input('fileName', $fileName, "class='form-control'")?></td>
  12. </tr>
  13. <tr>
  14. <th><?php echo $lang->doc->export->range; ?></th>
  15. <td><?php echo html::select('range', $this->lang->doc->exportFilesRanger, 'all', "class='form-control chosen'")?></td>
  16. </tr>
  17. <tr>
  18. <th><?php echo $lang->doc->export->encode?></th>
  19. <td><?php echo html::select('encode', array('UTF-8'), 0, "class='form-control' disabled")?></td>
  20. </tr>
  21. <tr>
  22. <th><?php echo $lang->doc->export->format?></th>
  23. <td><?php echo html::radio('format', array('zip' => $lang->doc->zip), 'zip');?></td>
  24. </tr>
  25. <tr>
  26. <td colspan='2' class='text-center'><?php echo html::submitButton($lang->export, "onclick='setDownloading();'");?></td>
  27. </tr>
  28. </table>
  29. </form>
  30. </div>
  31. <script>
  32. function setDownloading()
  33. {
  34. if(navigator.userAgent.toLowerCase().indexOf("opera") > -1) return true; // Opera don't support, omit it.
  35. var $fileName = $('#fileName');
  36. if($fileName.val() === '') $fileName.val('<?php echo $lang->file->untitled;?>');
  37. $.cookie('downloading', 0);
  38. time = setInterval("closeWindow()", 300);
  39. $('#mainContent').addClass('loading');
  40. return true;
  41. }
  42. function closeWindow()
  43. {
  44. if($.cookie('downloading') == 1)
  45. {
  46. $('#mainContent').removeClass('loading');
  47. $.closeModal();
  48. $.cookie('downloading', null);
  49. clearInterval(time);
  50. }
  51. }
  52. $(function()
  53. {
  54. var checkedItem = $.cookie('checkedItem');
  55. if(checkedItem != null)
  56. {
  57. $('#range').val('selected');
  58. $('#range').trigger('chosen:updated');
  59. }
  60. else
  61. {
  62. $('#range').val('all');
  63. $('#range').trigger('chosen:updated');
  64. }
  65. });
  66. </script>
  67. <iframe name='hiddenwin' class='hidden'></iframe>
  68. <?php include '../../../common/view/footer.modal.html.php';?>