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

71 lines
2.9 KiB
PHP
Raw Normal View History

<script type="text/javascript">
2012-11-29 21:30:02 +04:00
<?php if ( array_key_exists('publicListView', $_) && $_['publicListView'] == true ) :?>
var publicListView = true;
<?php else: ?>
var publicListView = false;
<?php endif; ?>
</script>
2012-10-14 23:04:08 +04:00
<?php foreach($_['files'] as $file):
2012-05-07 01:00:36 +04:00
$simple_file_size = OCP\simple_file_size($file['size']);
2012-11-29 21:30:02 +04:00
// the bigger the file, the darker the shade of grey; megabytes*2
$simple_size_color = intval(200-$file['size']/(1024*1024)*2);
2011-07-29 05:09:30 +04:00
if($simple_size_color<0) $simple_size_color = 0;
2012-05-07 01:00:36 +04:00
$relative_modified_date = OCP\relative_modified_date($file['mtime']);
2012-11-29 21:30:02 +04:00
// 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;
2012-11-04 14:10:46 +04:00
$name = str_replace('+', '%20', urlencode($file['name']));
$name = str_replace('%2F', '/', $name);
$directory = str_replace('+', '%20', urlencode($file['directory']));
$directory = str_replace('%2F', '/', $directory); ?>
2012-12-02 06:03:48 +04:00
<tr data-id="<?php echo $file['fileid']; ?>"
2012-11-29 21:30:02 +04:00
data-file="<?php echo $name;?>"
data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>"
data-mime="<?php echo $file['mimetype']?>"
data-size='<?php echo $file['size'];?>'
data-permissions='<?php echo $file['permissions']; ?>'>
<td class="filename svg"
<?php if($file['type'] == 'dir'): ?>
style="background-image:url(<?php echo OCP\mimetype_icon('dir'); ?>)"
<?php else: ?>
style="background-image:url(<?php echo OCP\mimetype_icon($file['mimetype']); ?>)"
<?php endif; ?>
>
<?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
<?php if($file['type'] == 'dir'): ?>
<a class="name" href="<?php $_['baseURL'].$directory.'/'.$name; ?>)" title="">
<?php else: ?>
<a class="name" href="<?php echo $_['downloadURL'].$directory.'/'.$name; ?>" title="">
<?php endif; ?>
<span class="nametext">
2011-07-07 04:41:22 +04:00
<?php if($file['type'] == 'dir'):?>
<?php echo htmlspecialchars($file['name']);?>
2011-07-07 04:41:22 +04:00
<?php else:?>
2012-11-29 21:30:02 +04:00
<?php echo htmlspecialchars($file['basename']);?><span
class='extension'><?php echo $file['extension'];?></span>
2011-07-07 04:41:22 +04:00
<?php endif;?>
</span>
<?php if($file['type'] == 'dir'):?>
<span class="uploadtext" currentUploads="0">
</span>
<?php endif;?>
2011-07-07 04:41:22 +04:00
</a>
</td>
2012-11-29 21:30:02 +04:00
<td class="filesize"
title="<?php echo OCP\human_file_size($file['size']); ?>"
style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)">
<?php echo $simple_file_size; ?>
</td>
<td class="date">
<span class="modified"
title="<?php echo $file['date']; ?>"
style="color:rgb(<?php echo $relative_date_color.','
.$relative_date_color.','
.$relative_date_color ?>)">
<?php echo $relative_modified_date; ?>
</span>
</td>
2011-04-17 18:19:21 +04:00
</tr>
2012-12-02 06:03:48 +04:00
<?php endforeach;