nextcloud/apps/files/templates/part.list.php

65 lines
2.7 KiB
PHP
Raw Normal View History

2013-02-28 00:14:15 +04:00
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>">
2013-01-13 04:02:11 +04:00
<?php foreach($_['files'] as $file):
$simple_file_size = OCP\simple_file_size($file['size']);
// the bigger the file, the darker the shade of grey; megabytes*2
$simple_size_color = intval(200-$file['size']/(1024*1024)*2);
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);
if($relative_date_color>200) $relative_date_color = 200;
$name = str_replace('+', '%20', urlencode($file['name']));
$name = str_replace('%2F', '/', $name);
$directory = str_replace('+', '%20', urlencode($file['directory']));
$directory = str_replace('%2F', '/', $directory); ?>
2013-02-28 00:14:15 +04:00
<tr data-id="<?php p($file['fileid']); ?>"
data-file="<?php p($name);?>"
data-type="<?php p($file['type'] == 'dir')?'dir':'file'?>"
data-mime="<?php p($file['mimetype'])?>"
data-size='<?php p($file['size']);?>'
data-permissions='<?php p($file['permissions']); ?>'>
2013-01-13 04:02:11 +04:00
<td class="filename svg"
<?php if($file['type'] == 'dir'): ?>
2013-02-28 00:14:15 +04:00
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)"
2012-11-29 21:30:02 +04:00
<?php else: ?>
2013-02-28 00:14:15 +04:00
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
2012-11-29 21:30:02 +04:00
<?php endif; ?>
2013-01-13 04:02:11 +04:00
>
<?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
<?php if($file['type'] == 'dir'): ?>
2013-02-28 00:14:15 +04:00
<a class="name" href="<?php p($_['baseURL'].$directory.'/'.$name); ?>" title="">
2013-01-13 04:02:11 +04:00
<?php else: ?>
2013-02-28 00:14:15 +04:00
<a class="name" href="<?php p($_['downloadURL'].$directory.'/'.$name); ?>" title="">
2013-01-13 04:02:11 +04:00
<?php endif; ?>
<span class="nametext">
<?php if($file['type'] == 'dir'):?>
2013-02-28 00:19:11 +04:00
<?php print_unescaped(htmlspecialchars($file['name']));?>
2013-01-13 04:02:11 +04:00
<?php else:?>
2013-02-28 00:19:11 +04:00
<?php print_unescaped(htmlspecialchars($file['basename']));?><span
2013-02-28 00:14:15 +04:00
class='extension'><?php p($file['extension']);?></span>
2013-01-13 04:02:11 +04:00
<?php endif;?>
</span>
<?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
title="<?php p(OCP\human_file_size($file['size'])); ?>"
style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)">
<?php p($simple_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-01-15 17:57:23 +04:00
<?php endforeach;