1
0

public.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. /** @var $l OC_L10N */
  3. /** @var $_ array */
  4. OCP\Util::addScript('files', 'file-upload');
  5. OCP\Util::addStyle('files_sharing', 'public');
  6. OCP\Util::addStyle('files_sharing', 'mobile');
  7. OCP\Util::addScript('files_sharing', 'public');
  8. OCP\Util::addScript('files', 'fileactions');
  9. OCP\Util::addScript('files', 'jquery.iframe-transport');
  10. OCP\Util::addScript('files', 'jquery.fileupload');
  11. // JS required for folders
  12. OCP\Util::addStyle('files', 'files');
  13. OCP\Util::addStyle('files', 'upload');
  14. OCP\Util::addScript('files', 'filesummary');
  15. OCP\Util::addScript('files', 'breadcrumb');
  16. OCP\Util::addScript('files', 'files');
  17. OCP\Util::addScript('files', 'filelist');
  18. OCP\Util::addscript('files', 'keyboardshortcuts');
  19. $thumbSize = 1024;
  20. ?>
  21. <?php if ($_['previewSupported']): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
  22. <link rel="image_src" href="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => $thumbSize, 'y' => $thumbSize, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
  23. <?php endif; ?>
  24. <div id="notification-container">
  25. <div id="notification" style="display: none;"></div>
  26. </div>
  27. <input type="hidden" id="filesApp" name="filesApp" value="1">
  28. <input type="hidden" id="isPublic" name="isPublic" value="1">
  29. <input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
  30. <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
  31. <input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
  32. <input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
  33. <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
  34. <input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
  35. <input type="hidden" name="mimetypeIcon" value="<?php p(OC_Helper::mimetypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
  36. <input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
  37. <input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">
  38. <header><div id="header" class="<?php p((isset($_['folder']) ? 'share-folder' : 'share-file')) ?>">
  39. <a href="<?php print_unescaped(link_to('', 'index.php')); ?>"
  40. title="" id="owncloud">
  41. <div class="logo-wide svg">
  42. <h1 class="hidden-visually">
  43. <?php p($theme->getName()); ?>
  44. </h1>
  45. </div>
  46. </a>
  47. <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
  48. <div class="header-right">
  49. <span id="details">
  50. <?php
  51. if ($_['server2serversharing']) {
  52. ?>
  53. <span id="save" data-protected="<?php p($_['protected']) ?>"
  54. data-owner="<?php p($_['displayName']) ?>" data-name="<?php p($_['filename']) ?>">
  55. <button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button>
  56. <form class="save-form hidden" action="#">
  57. <input type="text" id="remote_address" placeholder="example.com/owncloud"/>
  58. <button id="save-button-confirm" class="icon-confirm svg"></button>
  59. </form>
  60. </span>
  61. <?php } ?>
  62. <a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
  63. <img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
  64. <span id="download-text"><?php p($l->t('Download'))?></span>
  65. </a>
  66. </span>
  67. </div>
  68. </div></header>
  69. <div id="content">
  70. <div id="preview">
  71. <?php if (isset($_['folder'])): ?>
  72. <?php print_unescaped($_['folder']); ?>
  73. <?php else: ?>
  74. <?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
  75. <div id="imgframe">
  76. <video tabindex="0" controls="" preload="none">
  77. <source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
  78. </video>
  79. </div>
  80. <?php else: ?>
  81. <!-- Preview frame is filled via JS to support SVG images for modern browsers -->
  82. <div id="imgframe"></div>
  83. <?php endif; ?>
  84. <div class="directDownload">
  85. <a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
  86. <img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
  87. <?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
  88. </a>
  89. </div>
  90. <div class="directLink">
  91. <label for="directLink"><?php p($l->t('Direct link')) ?></label>
  92. <input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>">
  93. </div>
  94. <?php endif; ?>
  95. </div>
  96. </div>
  97. <footer>
  98. <p class="info">
  99. <?php print_unescaped($theme->getLongFooter()); ?>
  100. </p>
  101. </footer>