public.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /** @var $l \OCP\IL10N */
  3. /** @var $_ array */
  4. ?>
  5. <div id="app-content">
  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. <input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
  13. <?php if (!$_['hideDownload']): ?>
  14. <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
  15. <?php endif; ?>
  16. <input type="hidden" name="previewURL" value="<?php p($_['previewURL']) ?>" id="previewURL">
  17. <input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
  18. <input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
  19. <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
  20. <input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
  21. <input type="hidden" name="mimetypeIcon" value="<?php p(\OC::$server->getMimeTypeDetector()->mimeTypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
  22. <input type="hidden" name="hideDownload" value="<?php p($_['hideDownload'] ? 'true' : 'false'); ?>" id="hideDownload">
  23. <input type="hidden" id="disclaimerText" value="<?php p($_['disclaimer']) ?>">
  24. <?php
  25. $upload_max_filesize = OC::$server->getIniWrapper()->getBytes('upload_max_filesize');
  26. $post_max_size = OC::$server->getIniWrapper()->getBytes('post_max_size');
  27. $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
  28. ?>
  29. <input type="hidden" name="maxFilesizeUpload" value="<?php p($maxUploadFilesize); ?>" id="maxFilesizeUpload">
  30. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)): ?>
  31. <input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
  32. <?php endif; ?>
  33. <input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">
  34. <?php if (isset($_['note']) && $_['note'] !== '') : ?>
  35. <div id="notemenu" class="hidden">
  36. <div class="icon-comment-white menutoggle" tabindex="0" role="button" aria-haspopup="true" aria-controls="note-content" aria-expanded="false">
  37. <span class="hidden-visually"><?php p($l->t('Share note'))?></span>
  38. </div>
  39. <div id="note-content" class="menu" aria-label="Note content">
  40. <div class="content">
  41. <?php p($_['note']); ?>
  42. </div>
  43. </div>
  44. </div>
  45. <?php endif; ?>
  46. <?php if ($_['showgridview'] && empty($_['dir']) === false) { ?>
  47. <input type="checkbox" class="hidden-visually" id="showgridview"
  48. <?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/>
  49. <label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>"
  50. title="<?php p($l->t('Toggle grid view'))?>"></label>
  51. <?php } ?>
  52. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
  53. <div id="files-public-content">
  54. <div id="preview">
  55. <?php if (isset($_['folder'])): ?>
  56. <?php print_unescaped($_['folder']); ?>
  57. <?php else: ?>
  58. <?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'audio'): ?>
  59. <div id="imgframe">
  60. <audio tabindex="0" controls="" preload="none" style="width: 100%; max-width: <?php p($_['previewMaxX']); ?>px; max-height: <?php p($_['previewMaxY']); ?>px">
  61. <source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
  62. </audio>
  63. </div>
  64. <?php else: ?>
  65. <!-- Preview frame is filled via JS to support SVG images for modern browsers -->
  66. <div id="imgframe"></div>
  67. <?php endif; ?>
  68. <?php if ($_['previewURL'] === $_['downloadURL'] && !$_['hideDownload']): ?>
  69. <div class="directDownload">
  70. <a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
  71. <span class="icon icon-download"></span>
  72. <?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
  73. </a>
  74. </div>
  75. <?php endif; ?>
  76. <?php endif; ?>
  77. </div>
  78. </div>
  79. <?php } else { ?>
  80. <input type="hidden" id="upload-only-interface" value="1"/>
  81. <div id="public-upload">
  82. <div
  83. id="emptycontent"
  84. class="<?php if (!empty($_['note'])) { ?>has-note<?php } ?>">
  85. <div id="displayavatar"><div class="avatardiv"></div></div>
  86. <h2><?php p($l->t('Upload files to %s', [$_['shareOwner']])) ?></h2>
  87. <p><span class="icon-folder"></span> <?php p($_['filename']) ?></p>
  88. <?php if (empty($_['note']) === false) { ?>
  89. <h3><?php p($l->t('Note')); ?></h3>
  90. <p class="note"><?php p($_['note']); ?></p>
  91. <?php } ?>
  92. <input type="file" name="files[]" class="hidden" multiple>
  93. <a href="#" class="button icon-upload"><?php p($l->t('Select or drop files')) ?></a>
  94. <div id="drop-upload-progress-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploading files…')) ?></div>
  95. <div id="drop-upload-done-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploaded files:')) ?></div>
  96. <ul id="drop-uploaded-files"></ul>
  97. <?php if (!empty($_['disclaimer'])) { ?>
  98. <div>
  99. <?php
  100. echo $l->t('By uploading files, you agree to the %1$sterms of service%2$s.', [
  101. '<span id="show-terms-dialog">', '</span>'
  102. ]);
  103. ?>
  104. </div>
  105. <?php } ?>
  106. </div>
  107. </div>
  108. <?php } ?>
  109. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] !== true)): ?>
  110. <input type="hidden" name="dir" id="dir" value="" />
  111. <div class="hiddenuploadfield">
  112. <input type="file" id="file_upload_start" class="hiddenuploadfield" name="files[]"
  113. data-url="<?php p(\OC::$server->getURLGenerator()->linkTo('files', 'ajax/upload.php')); ?>" />
  114. </div>
  115. <?php endif; ?>
  116. </div>