2013-02-27 20:14:15 +00:00
|
|
|
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>">
|
2013-07-02 02:28:52 +00:00
|
|
|
<?php $totalfiles = 0;
|
|
|
|
$totaldirs = 0;
|
|
|
|
$totalsize = 0; ?>
|
2013-01-13 00:02:11 +00:00
|
|
|
<?php foreach($_['files'] as $file):
|
2013-07-30 10:29:12 +00:00
|
|
|
$relativePath = substr($file['path'], 6); //strlen('files/') => 6
|
2013-07-02 02:28:52 +00:00
|
|
|
$totalsize += $file['size'];
|
|
|
|
if ($file['type'] === 'dir') {
|
|
|
|
$totaldirs++;
|
|
|
|
} else {
|
|
|
|
$totalfiles++;
|
|
|
|
}
|
2013-01-13 00:02:11 +00:00
|
|
|
// the bigger the file, the darker the shade of grey; megabytes*2
|
2013-06-11 12:30:13 +00:00
|
|
|
$simple_size_color = intval(160-$file['size']/(1024*1024)*2);
|
2013-01-13 00:02:11 +00:00
|
|
|
if($simple_size_color<0) $simple_size_color = 0;
|
|
|
|
$relative_modified_date = OCP\relative_modified_date($file['mtime']);
|
|
|
|
// the older the file, the brighter the shade of grey; days*14
|
|
|
|
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14);
|
2013-06-11 12:30:13 +00:00
|
|
|
if($relative_date_color>160) $relative_date_color = 160;
|
2013-07-04 16:23:31 +00:00
|
|
|
$name = \OCP\Util::encodePath($file['name']);
|
|
|
|
$directory = \OCP\Util::encodePath($file['directory']); ?>
|
2013-02-27 20:14:15 +00:00
|
|
|
<tr data-id="<?php p($file['fileid']); ?>"
|
|
|
|
data-file="<?php p($name);?>"
|
2013-03-04 11:01:45 +00:00
|
|
|
data-type="<?php ($file['type'] == 'dir')?p('dir'):p('file')?>"
|
2013-02-27 20:14:15 +00:00
|
|
|
data-mime="<?php p($file['mimetype'])?>"
|
|
|
|
data-size='<?php p($file['size']);?>'
|
|
|
|
data-permissions='<?php p($file['permissions']); ?>'>
|
2013-01-13 00:02:11 +00:00
|
|
|
<td class="filename svg"
|
|
|
|
<?php if($file['type'] == 'dir'): ?>
|
2013-02-27 20:14:15 +00:00
|
|
|
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)"
|
2012-11-29 17:30:02 +00:00
|
|
|
<?php else: ?>
|
2013-07-11 09:58:52 +00:00
|
|
|
<?php if($_['isPublic']): ?>
|
|
|
|
<?php
|
|
|
|
$relativePath = substr($relativePath, strlen($_['sharingroot']));
|
|
|
|
?>
|
2013-07-29 13:47:17 +00:00
|
|
|
<?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?>
|
|
|
|
style="background-image:url(<?php print_unescaped(OCP\publicPreview_icon($relativePath, $_['sharingtoken'])); ?>)" class="preview-icon"
|
|
|
|
<?php else: ?>
|
|
|
|
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
|
|
|
|
<?php endif; ?>
|
2013-07-11 09:58:52 +00:00
|
|
|
<?php else: ?>
|
2013-07-29 13:47:17 +00:00
|
|
|
<?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?>
|
|
|
|
style="background-image:url(<?php print_unescaped(OCP\preview_icon($relativePath)); ?>)" class="preview-icon"
|
|
|
|
<?php else: ?>
|
|
|
|
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
|
|
|
|
<?php endif; ?>
|
2013-07-11 09:58:52 +00:00
|
|
|
<?php endif; ?>
|
2012-11-29 17:30:02 +00:00
|
|
|
<?php endif; ?>
|
2013-01-13 00:02:11 +00:00
|
|
|
>
|
|
|
|
<?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
|
|
|
|
<?php if($file['type'] == 'dir'): ?>
|
2013-02-27 22:36:52 +00:00
|
|
|
<a class="name" href="<?php p(rtrim($_['baseURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>" title="">
|
2013-01-13 00:02:11 +00:00
|
|
|
<?php else: ?>
|
2013-02-27 22:36:52 +00:00
|
|
|
<a class="name" href="<?php p(rtrim($_['downloadURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>" title="">
|
2013-01-13 00:02:11 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
<span class="nametext">
|
|
|
|
<?php if($file['type'] == 'dir'):?>
|
2013-02-27 20:19:11 +00:00
|
|
|
<?php print_unescaped(htmlspecialchars($file['name']));?>
|
2013-01-13 00:02:11 +00:00
|
|
|
<?php else:?>
|
2013-02-27 20:14:15 +00:00
|
|
|
<?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span>
|
2013-01-13 00:02:11 +00:00
|
|
|
<?php endif;?>
|
|
|
|
</span>
|
|
|
|
<?php if($file['type'] == 'dir'):?>
|
|
|
|
<span class="uploadtext" currentUploads="0">
|
|
|
|
</span>
|
|
|
|
<?php endif;?>
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td class="filesize"
|
2013-02-27 20:14:15 +00:00
|
|
|
style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)">
|
2013-07-18 20:15:26 +00:00
|
|
|
<?php print_unescaped(OCP\human_file_size($file['size'])); ?>
|
2013-01-13 00:02:11 +00:00
|
|
|
</td>
|
|
|
|
<td class="date">
|
|
|
|
<span class="modified"
|
2013-02-27 20:14:15 +00:00
|
|
|
title="<?php p($file['date']); ?>"
|
|
|
|
style="color:rgb(<?php p($relative_date_color.','
|
2013-01-13 00:02:11 +00:00
|
|
|
.$relative_date_color.','
|
2013-02-27 20:14:15 +00:00
|
|
|
.$relative_date_color) ?>)">
|
|
|
|
<?php p($relative_modified_date); ?>
|
2013-01-13 00:02:11 +00:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2013-07-02 02:28:52 +00:00
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php if ($totaldirs !== 0 || $totalfiles !== 0): ?>
|
|
|
|
<tr class="summary">
|
|
|
|
<td><span class="info">
|
|
|
|
<?php if ($totaldirs !== 0) {
|
|
|
|
p($totaldirs.' ');
|
|
|
|
if ($totaldirs === 1) {
|
|
|
|
p($l->t('directory'));
|
|
|
|
} else {
|
|
|
|
p($l->t('directories'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($totaldirs !== 0 && $totalfiles !== 0) {
|
|
|
|
p(' & ');
|
|
|
|
}
|
|
|
|
if ($totalfiles !== 0) {
|
|
|
|
p($totalfiles.' ');
|
|
|
|
if ($totalfiles === 1) {
|
|
|
|
p($l->t('file'));
|
|
|
|
} else {
|
|
|
|
p($l->t('files'));
|
|
|
|
}
|
|
|
|
} ?>
|
|
|
|
</span></td>
|
|
|
|
<td class="filesize">
|
2013-07-18 20:15:26 +00:00
|
|
|
<?php print_unescaped(OCP\human_file_size($totalsize)); ?>
|
2013-07-02 02:28:52 +00:00
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
<?php endif;
|