doc2export.html.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php include '../../../common/view/header.modal.html.php';?>
  2. <?php $this->app->loadLang('file');?>
  3. <form class="main-form" target='hiddenwin' method='post'>
  4. <table class='table table-form table-borderless'>
  5. <tr>
  6. <th class='w-100px'><?php echo $lang->doc->export->fileName?></th>
  7. <td><?php echo html::input('fileName', $data->name, "class='form-control'")?></td>
  8. </tr>
  9. <tr>
  10. <th><?php echo $lang->doc->export->range; ?></th>
  11. <td><?php echo html::select('range', $chapters, 0, "class='form-control chosen'")?></td>
  12. </tr>
  13. <tr>
  14. <th><?php echo $lang->doc->export->fileType?></th>
  15. <td><?php echo html::select('fileType', array('word'), 0, "class='form-control' disabled")?></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', $lang->doc->export->formatList, '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. <style>
  31. .table-borderless > tbody > tr{border-bottom: none;}
  32. .table-borderless > tbody > tr > th{width: 90px; text-align: right;}
  33. </style>
  34. <script>
  35. function setDownloading()
  36. {
  37. if(navigator.userAgent.toLowerCase().indexOf("opera") > -1) return true; // Opera don't support, omit it.
  38. var $fileName = $('#fileName');
  39. if($fileName.val() === '') $fileName.val('<?php echo $lang->file->untitled;?>');
  40. $.cookie.set('downloading', 0);
  41. time = setInterval("closeWindow()", 300);
  42. $('#mainContent').addClass('loading');
  43. return true;
  44. }
  45. function closeWindow()
  46. {
  47. if($.cookie.get('downloading') == 1)
  48. {
  49. $('#mainContent').removeClass('loading');
  50. $.closeModal();
  51. $.cookie.set('downloading', null);
  52. clearInterval(time);
  53. }
  54. }
  55. $(function()
  56. {
  57. setTimeout(function()
  58. {
  59. if($.cookie.get('checkedItem') !== '') $('#range').val('selected').trigger('chosen:updated');
  60. }, 600);
  61. })
  62. </script>
  63. <iframe name='hiddenwin' class='hidden'></iframe>