1
0

public.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /** @var \OCP\IL10N $l */
  3. /** @var array $_ */
  4. ?>
  5. <div id="app-content" tabindex="0">
  6. <?php if ($_['previewSupported']): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
  7. <link rel="image_src" href="<?php p($_['previewImage']); ?>" />
  8. <?php endif; ?>
  9. <input type="hidden" id="sharingUserId" value="<?php p($_['owner']) ?>">
  10. <input type="hidden" id="filesApp" name="filesApp" value="1">
  11. <input type="hidden" id="isPublic" name="isPublic" value="1">
  12. <?php if (!$_['hideDownload']): ?>
  13. <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
  14. <?php endif; ?>
  15. <input type="hidden" name="previewURL" value="<?php p($_['previewURL']) ?>" id="previewURL">
  16. <input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
  17. <input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
  18. <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
  19. <input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
  20. <input type="hidden" name="mimetypeIcon" value="<?php p(\OC::$server->getMimeTypeDetector()->mimeTypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
  21. <input type="hidden" name="hideDownload" value="<?php p($_['hideDownload'] ? 'true' : 'false'); ?>" id="hideDownload">
  22. <input type="hidden" id="disclaimerText" value="<?php p($_['disclaimer']) ?>">
  23. <?php
  24. $upload_max_filesize = OC::$server->get(\bantu\IniGetWrapper\IniGetWrapper::class)->getBytes('upload_max_filesize');
  25. $post_max_size = OC::$server->get(\bantu\IniGetWrapper\IniGetWrapper::class)->getBytes('post_max_size');
  26. $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
  27. ?>
  28. <input type="hidden" name="maxFilesizeUpload" value="<?php p($maxUploadFilesize); ?>" id="maxFilesizeUpload">
  29. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)): ?>
  30. <input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
  31. <?php endif; ?>
  32. <input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">
  33. <?php if (isset($_['note']) && $_['note'] !== '') : ?>
  34. <div id="notemenu" class="hidden">
  35. <div class="icon-comment-white menutoggle" tabindex="0" role="button" aria-haspopup="true" aria-controls="note-content" aria-expanded="false">
  36. <span class="hidden-visually"><?php p($l->t('Share note'))?></span>
  37. </div>
  38. <div id="note-content" class="menu" aria-label="Note content">
  39. <div class="content">
  40. <?php p($_['note']); ?>
  41. </div>
  42. </div>
  43. </div>
  44. <?php endif; ?>
  45. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
  46. <!-- ONLY if this is a folder, we show the grid toggle button -->
  47. <?php if (empty($_['dir']) === false) { ?>
  48. <input type="checkbox" class="hidden-visually" id="showgridview"
  49. <?php if ($_['showgridview']) { ?>checked="checked" <?php } ?>/>
  50. <label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>"
  51. title="<?php p($_['showgridview'] ? $l->t('Show list view') : $l->t('Show grid view'))?>"></label>
  52. <?php } ?>
  53. <!-- files listing -->
  54. <div id="files-public-content">
  55. <div id="preview">
  56. <?php if (isset($_['folder'])): ?>
  57. <?php print_unescaped($_['folder']); ?>
  58. <?php else: ?>
  59. <!-- preview frame to open file in with viewer -->
  60. <div id="imgframe"></div>
  61. <?php if (isset($_['mimetype']) && str_starts_with($_['mimetype'], 'image')) { ?>
  62. <div class="directDownload">
  63. <div>
  64. <?php p($_['filename'])?> (<?php p($_['fileSize']) ?>)
  65. </div>
  66. <?php if (!$_['hideDownload']) { ?>
  67. <a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
  68. <span class="icon icon-download"></span>
  69. <?php p($l->t('Download'))?>
  70. </a>
  71. <?php } ?>
  72. </div>
  73. <?php } ?>
  74. <?php if ($_['previewURL'] === $_['downloadURL'] && !$_['hideDownload']): ?>
  75. <div class="directDownload">
  76. <div>
  77. <?php p($_['filename'])?>&nbsp;(<?php p($_['fileSize']) ?>)
  78. </div>
  79. <a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
  80. <span class="icon icon-download"></span>
  81. <?php p($l->t('Download'))?>
  82. </a>
  83. </div>
  84. <?php endif; ?>
  85. <?php endif; ?>
  86. </div>
  87. </div>
  88. <?php } else { ?>
  89. <input type="hidden" id="upload-only-interface" value="1"/>
  90. <div id="public-upload">
  91. <div
  92. id="emptycontent"
  93. class="emptycontent <?php if (!empty($_['note'])) { ?>has-note<?php } ?>">
  94. <?php if ($_['shareOwner']) { ?>
  95. <div id="displayavatar"><div class="avatardiv"></div></div>
  96. <h2><?php p($l->t('Upload files to %s', [$_['shareOwner']])) ?></h2>
  97. <p><span class="icon-folder"></span> <?php p($_['filename']) ?></p>
  98. <?php } else { ?>
  99. <div id="displayavatar"><span class="icon-folder"></span></div>
  100. <h2><?php p($l->t('Upload files to %s', [$_['filename']])) ?></h2>
  101. <?php } ?>
  102. <?php if (empty($_['note']) === false) { ?>
  103. <h3><?php p($l->t('Note')); ?></h3>
  104. <p class="note"><?php p($_['note']); ?></p>
  105. <?php } ?>
  106. <input type="file" name="files[]" class="hidden" multiple>
  107. <a href="#" class="button icon-upload"><?php p($l->t('Select or drop files')) ?></a>
  108. <div id="drop-upload-progress-indicator" style="padding-top: 25px;" class="hidden"><span class="icon-loading-small"></span><?php p($l->t('Uploading files')) ?></div>
  109. <div id="drop-upload-done-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploaded files:')) ?></div>
  110. <ul id="drop-uploaded-files"></ul>
  111. <?php if ($_['disclaimer'] !== '') { ?>
  112. <div>
  113. <?php
  114. echo $l->t('By uploading files, you agree to the %1$sterms of service%2$s.', [
  115. '<span id="show-terms-dialog">', '</span>'
  116. ]);
  117. ?>
  118. </div>
  119. <?php } ?>
  120. </div>
  121. </div>
  122. <?php } ?>
  123. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] !== true)): ?>
  124. <div class="hiddenuploadfield">
  125. <input type="file" id="file_upload_start" class="hiddenuploadfield" name="files[]"
  126. data-url="<?php p(\OC::$server->getURLGenerator()->linkTo('files', 'ajax/upload.php')); ?>" />
  127. </div>
  128. <?php endif; ?>
  129. </div>