aboutsummaryrefslogtreecommitdiff
path: root/mod/lightpics/views/default/forms/photos/basic_upload.php
blob: 9e71cf59ef9fe4b12bcca98b92bf8cdfd6289c61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
$album = $vars['entity'];
$help = elgg_echo('tidypics:uploader:help');

$input = elgg_view('input/file', array(
	'name' => 'images[]',
	'multiple' => 'multiple',
	'class' => 'hidden-js',
));

$button = elgg_view('output/url', array(
	'text' => elgg_echo('tidypics:uploader:upload') . $input,
	'class' => 'elgg-button elgg-button-action fileinput-button',
));

$reset = elgg_view('input/reset', array(
	'value' => elgg_echo('cancel'),
	'class' => 'hidden',
));

$foot = elgg_view('input/hidden', array('name' => 'guid', 'value' => $album->getGUID()));
$foot .= elgg_view('input/submit', array('value' => elgg_echo("save")));

echo <<<HTML
<div>
	$max
</div>
<div class="fileinput-container">
	$button
	$reset
	<p class="elgg-text-help">$help</p>
</div>
<div class="mtm"><!-- The table listing the files available for upload/download -->
        <table role="presentation" class="elgg-table-alt clearfloat mtm">
			<tbody class="files"></tbody>
		</table>
</div>
<div class='elgg-foot'>
	$foot
</div>
HTML;

?>

<noscript><style type="text/css">hidden-nojs {display: hidden}</style></noscript>

<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
	<tr class="template-upload fade">
		{% if (file.error) { %}
			<td class="error"><span class="elgg-message elgg-state-error">{%=locale.fileupload.error%} {%=locale.fileupload.errors[file.error] || file.error%}</span></td>
		{% } else { %}
			<td class="preview"><span class="fade"></span></td>
		{% } %}
		<td class="name"><span>{%=file.name%}</span></td>
		<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
		
	</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl" />