public.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /** @var $l \OCP\IL10N */
  3. /** @var $_ array */
  4. ?>
  5. <?php if ($_['previewSupported']): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
  6. <link rel="image_src" href="<?php p($_['previewImage']); ?>" />
  7. <?php endif; ?>
  8. <div id="notification-container">
  9. <div id="notification" style="display: none;"></div>
  10. </div>
  11. <input type="hidden" id="sharingUserId" value="<?php p($_['owner']) ?>">
  12. <input type="hidden" id="filesApp" name="filesApp" value="1">
  13. <input type="hidden" id="isPublic" name="isPublic" value="1">
  14. <input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
  15. <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
  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. <?php
  22. $upload_max_filesize = OC::$server->getIniWrapper()->getBytes('upload_max_filesize');
  23. $post_max_size = OC::$server->getIniWrapper()->getBytes('post_max_size');
  24. $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
  25. ?>
  26. <input type="hidden" name="maxFilesizeUpload" value="<?php p($maxUploadFilesize); ?>" id="maxFilesizeUpload">
  27. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)): ?>
  28. <input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
  29. <?php endif; ?>
  30. <input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">
  31. <header><div id="header" class="<?php p((isset($_['folder']) ? 'share-folder' : 'share-file')) ?>">
  32. <div id="header-left">
  33. <a href="<?php print_unescaped(link_to('', 'index.php')); ?>"
  34. title="" id="nextcloud">
  35. <div class="logo-icon svg"></div>
  36. <h1 class="header-appname">
  37. <?php p($theme->getName()); ?>
  38. </h1>
  39. </a>
  40. </div>
  41. <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
  42. <div id="header-right">
  43. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) {
  44. if ($_['server2serversharing']) {
  45. ?>
  46. <span id="save" data-protected="<?php p($_['protected']) ?>"
  47. data-owner-display-name="<?php p($_['displayName']) ?>" data-owner="<?php p($_['owner']) ?>" data-name="<?php p($_['filename']) ?>">
  48. <button id="save-button"><?php p($l->t('Add to your Nextcloud')) ?></button>
  49. <form class="save-form hidden" action="#">
  50. <input type="email" id="remote_address" placeholder="user@yourNextcloud.org"/>
  51. <button id="save-button-confirm" class="icon-confirm svg" disabled></button>
  52. </form>
  53. </span>
  54. <?php } ?>
  55. <a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
  56. <span class="icon icon-download"></span>
  57. <span id="download-text"><?php p($l->t('Download'))?></span>
  58. </a>
  59. <?php } ?>
  60. </div>
  61. </div></header>
  62. <div id="content-wrapper">
  63. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
  64. <div id="content">
  65. <div id="preview">
  66. <?php if (isset($_['folder'])): ?>
  67. <?php print_unescaped($_['folder']); ?>
  68. <?php else: ?>
  69. <?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
  70. <div id="imgframe">
  71. <video tabindex="0" controls="" preload="none" style="max-width: <?php p($_['previewMaxX']); ?>px; max-height: <?php p($_['previewMaxY']); ?>px">
  72. <source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
  73. </video>
  74. </div>
  75. <?php else: ?>
  76. <!-- Preview frame is filled via JS to support SVG images for modern browsers -->
  77. <div id="imgframe"></div>
  78. <?php endif; ?>
  79. <div class="directDownload">
  80. <a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button primary">
  81. <span class="icon icon-download"></span>
  82. <?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
  83. </a>
  84. </div>
  85. <div class="directLink">
  86. <label for="directLink"><?php p($l->t('Direct link')) ?></label>
  87. <input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>">
  88. </div>
  89. <?php endif; ?>
  90. </div>
  91. </div>
  92. <?php } else { ?>
  93. <input type="hidden" id="upload-only-interface" value="1"/>
  94. <div id="public-upload">
  95. <div id="emptycontent" class="<?php if (!empty($_['disclaimer'])) { ?>has-disclaimer<?php } ?>">
  96. <div id="displayavatar"><div class="avatardiv"></div></div>
  97. <h2><?php p($l->t('Upload files to %s', [$_['shareOwner']])) ?></h2>
  98. <p><span class="icon-folder"></span> <?php p($_['filename']) ?></p>
  99. <?php if (!empty($_['disclaimer'])) { ?>
  100. <p class="disclaimer"><?php p($_['disclaimer']); ?></p>
  101. <?php } ?>
  102. <input type="file" name="files[]" class="hidden" multiple>
  103. <a href="#" class="button icon-upload"><?php p($l->t('Select or drop files')) ?></a>
  104. <div id="drop-upload-progress-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploading files…')) ?></div>
  105. <div id="drop-upload-done-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploaded files:')) ?></div>
  106. <ul>
  107. </ul>
  108. </div>
  109. </div>
  110. <?php } ?>
  111. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] !== true)): ?>
  112. <input type="hidden" name="dir" id="dir" value="" />
  113. <div class="hiddenuploadfield">
  114. <input type="file" id="file_upload_start" class="hiddenuploadfield" name="files[]"
  115. data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" />
  116. </div>
  117. <?php endif; ?>
  118. <footer>
  119. <p class="info">
  120. <?php print_unescaped($theme->getLongFooter()); ?>
  121. </p>
  122. </footer>
  123. </div>