public.php 4.59 KB
Newer Older
1
<?php
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/** @var $l OC_L10N */
/** @var $_ array */

OCP\Util::addScript('files', 'file-upload');
OCP\Util::addStyle('files_sharing', 'public');
OCP\Util::addStyle('files_sharing', 'mobile');
OCP\Util::addScript('files_sharing', 'public');
OCP\Util::addScript('files', 'fileactions');
OCP\Util::addScript('files', 'jquery.iframe-transport');
OCP\Util::addScript('files', 'jquery.fileupload');

// JS required for folders
OCP\Util::addStyle('files', 'files');
OCP\Util::addStyle('files', 'upload');
OCP\Util::addScript('files', 'filesummary');
OCP\Util::addScript('files', 'breadcrumb');
OCP\Util::addScript('files', 'files');
OCP\Util::addScript('files', 'filelist');
OCP\Util::addscript('files', 'keyboardshortcuts');

22
$thumbSize = 1024;
23
?>
24

25
<?php if ($_['previewSupported']): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
pzy's avatar
pzy committed
26
27
28
	<link rel="image_src" href="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => $thumbSize, 'y' => $thumbSize, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
<?php endif; ?>

Roman Geber's avatar
Roman Geber committed
29
<div id="notification-container">
30
	<div id="notification" style="display: none;"></div>
Roman Geber's avatar
Roman Geber committed
31
32
</div>

33
<input type="hidden" id="filesApp" name="filesApp" value="1">
34
<input type="hidden" id="isPublic" name="isPublic" value="1">
Lukas Reschke's avatar
Lukas Reschke committed
35
36
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
<input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
37
<input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
Lukas Reschke's avatar
Lukas Reschke committed
38
39
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
40
<input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
41
<input type="hidden" name="mimetypeIcon" value="<?php p(OC_Helper::mimetypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
42
43
<input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
<input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">
44
45


46
<header><div id="header" class="<?php p((isset($_['folder']) ? 'share-folder' : 'share-file')) ?>">
47
		<a href="<?php print_unescaped(link_to('', 'index.php')); ?>"
48
		   title="" id="owncloud">
49
50
51
52
53
			<div class="logo-wide svg">
				<h1 class="hidden-visually">
					<?php p($theme->getName()); ?>
				</h1>
			</div>
54
		</a>
55
		<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
56
		<div class="header-right">
57
			<span id="details">
58
59
60
61
62
				<?php
				if ($_['server2serversharing']) {
					?>
					<span id="save" data-protected="<?php p($_['protected']) ?>"
						  data-owner="<?php p($_['displayName']) ?>" data-name="<?php p($_['filename']) ?>">
63
					<button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button>
64
					<form class="save-form hidden" action="#">
65
						<input type="text" id="remote_address" placeholder="example.com/owncloud"/>
66
						<button id="save-button-confirm" class="icon-confirm svg"></button>
67
68
					</form>
				</span>
69
				<?php } ?>
70
71
				<a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
					<img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
72
					<span id="download-text"><?php p($l->t('Download'))?></span>
73
74
				</a>
			</span>
75
		</div>
76
	</div></header>
Roman Geber's avatar
Roman Geber committed
77
<div id="content">
78
79
80
	<div id="preview">
		<?php if (isset($_['folder'])): ?>
			<?php print_unescaped($_['folder']); ?>
81
		<?php else: ?>
82
			<?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
83
				<div id="imgframe">
84
					<video tabindex="0" controls="" preload="none">
85
86
87
						<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
					</video>
				</div>
88
			<?php else: ?>
89
90
				<!-- Preview frame is filled via JS to support SVG images for modern browsers -->
				<div id="imgframe"></div>
91
			<?php endif; ?>
92
93
94
			<div class="directDownload">
				<a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
					<img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
95
					<?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
96
97
98
99
100
101
				</a>
			</div>
			<div class="directLink">
				<label for="directLink"><?php p($l->t('Direct link')) ?></label>
				<input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>">
			</div>
102
		<?php endif; ?>
103
	</div>
104
105
106
107
108
109
110

</div>
<footer>
	<p class="info">
		<?php print_unescaped($theme->getLongFooter()); ?>
	</p>
</footer>