1
0

public.php 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. <input type="hidden" id="sharingUserId" value="<?php p($_['owner']) ?>">
  9. <input type="hidden" id="filesApp" name="filesApp" value="1">
  10. <input type="hidden" id="isPublic" name="isPublic" value="1">
  11. <input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
  12. <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
  13. <input type="hidden" name="previewURL" value="<?php p($_['previewURL']) ?>" id="previewURL">
  14. <input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
  15. <input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
  16. <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
  17. <input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
  18. <input type="hidden" name="mimetypeIcon" value="<?php p(\OC::$server->getMimeTypeDetector()->mimeTypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
  19. <?php
  20. $upload_max_filesize = OC::$server->getIniWrapper()->getBytes('upload_max_filesize');
  21. $post_max_size = OC::$server->getIniWrapper()->getBytes('post_max_size');
  22. $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
  23. ?>
  24. <input type="hidden" name="maxFilesizeUpload" value="<?php p($maxUploadFilesize); ?>" id="maxFilesizeUpload">
  25. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)): ?>
  26. <input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
  27. <?php endif; ?>
  28. <input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">
  29. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
  30. <div id="files-public-content">
  31. <div id="preview">
  32. <?php if (isset($_['folder'])): ?>
  33. <?php print_unescaped($_['folder']); ?>
  34. <?php else: ?>
  35. <?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'audio'): ?>
  36. <div id="imgframe">
  37. <audio tabindex="0" controls="" preload="none" style="width: 100%; max-width: <?php p($_['previewMaxX']); ?>px; max-height: <?php p($_['previewMaxY']); ?>px">
  38. <source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
  39. </audio>
  40. </div>
  41. <?php else: ?>
  42. <!-- Preview frame is filled via JS to support SVG images for modern browsers -->
  43. <div id="imgframe"></div>
  44. <?php endif; ?>
  45. <?php if ($_['previewURL'] === $_['downloadURL']): ?>
  46. <div class="directDownload">
  47. <a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
  48. <span class="icon icon-download"></span>
  49. <?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
  50. </a>
  51. </div>
  52. <?php endif; ?>
  53. <?php endif; ?>
  54. </div>
  55. </div>
  56. <?php } else { ?>
  57. <input type="hidden" id="upload-only-interface" value="1"/>
  58. <div id="public-upload">
  59. <div id="emptycontent" class="<?php if (!empty($_['disclaimer'])) { ?>has-disclaimer<?php } ?>">
  60. <div id="displayavatar"><div class="avatardiv"></div></div>
  61. <h2><?php p($l->t('Upload files to %s', [$_['shareOwner']])) ?></h2>
  62. <p><span class="icon-folder"></span> <?php p($_['filename']) ?></p>
  63. <?php if (!empty($_['disclaimer'])) { ?>
  64. <p class="disclaimer"><?php p($_['disclaimer']); ?></p>
  65. <?php } ?>
  66. <input type="file" name="files[]" class="hidden" multiple>
  67. <a href="#" class="button icon-upload"><?php p($l->t('Select or drop files')) ?></a>
  68. <div id="drop-upload-progress-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploading files…')) ?></div>
  69. <div id="drop-upload-done-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploaded files:')) ?></div>
  70. <ul>
  71. </ul>
  72. </div>
  73. </div>
  74. <?php } ?>
  75. <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] !== true)): ?>
  76. <input type="hidden" name="dir" id="dir" value="" />
  77. <div class="hiddenuploadfield">
  78. <input type="file" id="file_upload_start" class="hiddenuploadfield" name="files[]"
  79. data-url="<?php p(\OC::$server->getURLGenerator()->linkTo('files', 'ajax/upload.php')); ?>" />
  80. </div>
  81. <?php endif; ?>