public.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <div id="notification-container">
  2. <div id="notification" style="display: none;"></div>
  3. </div>
  4. <input type="hidden" id="filesApp" name="filesApp" value="1">
  5. <input type="hidden" id="isPublic" name="isPublic" value="1">
  6. <input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
  7. <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
  8. <input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
  9. <input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
  10. <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
  11. <header><div id="header">
  12. <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg"
  13. src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($theme->getName()); ?>" /></a>
  14. <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
  15. <div class="header-right">
  16. <?php if (isset($_['folder'])): ?>
  17. <span id="details"><?php p($l->t('%s shared the folder %s with you',
  18. array($_['displayName'], $_['filename']))) ?></span>
  19. <?php else: ?>
  20. <span id="details"><?php p($l->t('%s shared the file %s with you',
  21. array($_['displayName'], $_['filename']))) ?></span>
  22. <?php endif; ?>
  23. <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?>
  24. <a href="<?php p($_['downloadURL']); ?>" class="button" id="download"><img
  25. class="svg" alt="Download" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"
  26. /><span><?php p($l->t('Download'))?></span></a>
  27. <?php endif; ?>
  28. <?php if ($_['allowPublicUploadEnabled']):?>
  29. <input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
  30. <input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" />
  31. <input type="hidden" id="uploadMaxFilesize" name="uploadMaxFilesize" value="<?php p($_['uploadMaxFilesize']) ?>" />
  32. <input type="hidden" id="uploadMaxHumanFilesize" name="uploadMaxHumanFilesize" value="<?php p($_['uploadMaxHumanFilesize']) ?>" />
  33. <input type="hidden" id="directory_path" name="directory_path" value="<?php p($_['directory_path']) ?>" />
  34. <?php if($_['uploadMaxFilesize'] >= 0):?>
  35. <input type="hidden" name="MAX_FILE_SIZE" id="max_upload"
  36. value="<?php p($_['uploadMaxFilesize']) ?>">
  37. <?php endif;?>
  38. <div id="data-upload-form" class="button" title="<?php p($l->t('Upload') . ' max. '.$_['uploadMaxHumanFilesize']) ?>">
  39. <input id="file_upload_start" type="file" name="files[]" data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" multiple>
  40. <a href="#" id="publicUploadButtonMock" class="svg">
  41. <span><?php p($l->t('Upload'))?></span>
  42. </a>
  43. </div>
  44. </div>
  45. <div id="additional_controls" style="display:none">
  46. <div id="uploadprogresswrapper">
  47. <div id="uploadprogressbar"></div>
  48. <input id="cancel_upload_button" type="button" class="stop" style="display:none"
  49. value="<?php p($l->t('Cancel upload'));?>"
  50. />
  51. </div>
  52. <?php endif; ?>
  53. </div>
  54. </div></header>
  55. <div id="content">
  56. <div id="preview">
  57. <?php if (isset($_['folder'])): ?>
  58. <?php print_unescaped($_['folder']); ?>
  59. <?php else: ?>
  60. <?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'image'): ?>
  61. <div id="imgframe">
  62. <img src="<?php p($_['downloadURL']); ?>" />
  63. </div>
  64. <?php elseif (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
  65. <div id="imgframe">
  66. <video tabindex="0" controls="" autoplay="">
  67. <source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
  68. </video>
  69. </div>
  70. <?php elseif (\OC\Preview::isMimeSupported($_['mimetype'])): ?>
  71. <div id="imgframe">
  72. <img src="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => 500, 'y' => 500, 'file' => urlencode($_['directory_path']), 't' => $_['dirToken']))); ?>" class="publicpreview"/>
  73. </div>
  74. <?php else: ?>
  75. <ul id="noPreview">
  76. <li class="error">
  77. <?php p($l->t('No preview available for').' '.$_['filename']); ?><br />
  78. <a href="<?php p($_['downloadURL']); ?>" id="download"><img class="svg" alt="Download"
  79. src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"
  80. /><?php p($l->t('Download'))?></a>
  81. </li>
  82. </ul>
  83. <?php endif; ?>
  84. <div class="directLink"><label for="directLink"><?php p($l->t('Direct link')) ?></label><input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>"></input></div>
  85. <?php endif; ?>
  86. </div>
  87. <footer>
  88. <p class="info">
  89. <?php print_unescaped($theme->getLongFooter()); ?>
  90. </p>
  91. </footer>