2013-08-17 15:07:18 +04:00
|
|
|
<?php $totalfiles = 0;
|
|
|
|
$totaldirs = 0;
|
|
|
|
$totalsize = 0; ?>
|
2013-01-13 04:02:11 +04:00
|
|
|
<?php foreach($_['files'] as $file):
|
|
|
|
// the bigger the file, the darker the shade of grey; megabytes*2
|
2013-06-11 16:30:13 +04:00
|
|
|
$simple_size_color = intval(160-$file['size']/(1024*1024)*2);
|
2013-01-13 04:02:11 +04: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 16:30:13 +04:00
|
|
|
if($relative_date_color>160) $relative_date_color = 160;
|
2013-07-04 20:23:31 +04:00
|
|
|
$name = \OCP\Util::encodePath($file['name']);
|
|
|
|
$directory = \OCP\Util::encodePath($file['directory']); ?>
|
2013-02-28 00:14:15 +04:00
|
|
|
<tr data-id="<?php p($file['fileid']); ?>"
|
|
|
|
data-file="<?php p($name);?>"
|
2013-03-04 15:01:45 +04:00
|
|
|
data-type="<?php ($file['type'] == 'dir')?p('dir'):p('file')?>"
|
2013-02-28 00:14:15 +04:00
|
|
|
data-mime="<?php p($file['mimetype'])?>"
|
2013-08-15 21:40:39 +04:00
|
|
|
data-size="<?php p($file['size']);?>"
|
2013-10-28 14:22:34 +04:00
|
|
|
data-etag="<?php p($file['etag']);?>"
|
2013-08-15 21:40:39 +04:00
|
|
|
data-permissions="<?php p($file['permissions']); ?>">
|
2013-08-21 17:55:59 +04:00
|
|
|
<?php if($file['isPreviewAvailable']): ?>
|
2013-08-14 20:48:30 +04:00
|
|
|
<td class="filename svg preview-icon"
|
|
|
|
<?php else: ?>
|
2013-01-13 04:02:11 +04:00
|
|
|
<td class="filename svg"
|
2013-08-14 20:48:30 +04:00
|
|
|
<?php endif; ?>
|
2013-09-12 02:13:19 +04:00
|
|
|
style="background-image:url(<?php print_unescaped($file['icon']); ?>)"
|
2013-01-13 04:02:11 +04:00
|
|
|
>
|
2013-08-14 22:41:20 +04:00
|
|
|
<?php if(!isset($_['readonly']) || !$_['readonly']): ?>
|
|
|
|
<input id="select-<?php p($file['fileid']); ?>" type="checkbox" />
|
|
|
|
<label for="select-<?php p($file['fileid']); ?>"></label>
|
|
|
|
<?php endif; ?>
|
2013-01-13 04:02:11 +04:00
|
|
|
<?php if($file['type'] == 'dir'): ?>
|
2013-02-28 02:36:52 +04:00
|
|
|
<a class="name" href="<?php p(rtrim($_['baseURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>" title="">
|
2013-10-02 20:41:03 +04:00
|
|
|
<span class="nametext">
|
|
|
|
<?php print_unescaped(htmlspecialchars($file['name']));?>
|
|
|
|
</span>
|
2013-01-13 04:02:11 +04:00
|
|
|
<?php else: ?>
|
2013-10-02 20:41:03 +04:00
|
|
|
<a class="name" href="<?php p(rtrim($_['downloadURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>">
|
2013-10-02 20:10:34 +04:00
|
|
|
<label class="filetext" title="" for="select-<?php p($file['fileid']); ?>"></label>
|
2013-10-10 14:21:02 +04:00
|
|
|
<span class="nametext"><?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span></span>
|
2013-10-02 20:10:34 +04:00
|
|
|
</a>
|
2013-01-13 04:02:11 +04:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php if($file['type'] == 'dir'):?>
|
|
|
|
<span class="uploadtext" currentUploads="0">
|
|
|
|
</span>
|
|
|
|
<?php endif;?>
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td class="filesize"
|
2013-02-28 00:14:15 +04:00
|
|
|
style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)">
|
2013-07-19 00:15:26 +04:00
|
|
|
<?php print_unescaped(OCP\human_file_size($file['size'])); ?>
|
2013-01-13 04:02:11 +04:00
|
|
|
</td>
|
|
|
|
<td class="date">
|
|
|
|
<span class="modified"
|
2013-02-28 00:14:15 +04:00
|
|
|
title="<?php p($file['date']); ?>"
|
|
|
|
style="color:rgb(<?php p($relative_date_color.','
|
2013-01-13 04:02:11 +04:00
|
|
|
.$relative_date_color.','
|
2013-02-28 00:14:15 +04:00
|
|
|
.$relative_date_color) ?>)">
|
|
|
|
<?php p($relative_modified_date); ?>
|
2013-01-13 04:02:11 +04:00
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2013-07-03 21:50:03 +04:00
|
|
|
<?php endforeach;
|