nextcloud/files/templates/part.list.php

29 lines
2.1 KiB
PHP
Raw Normal View History

<?php foreach($_['files'] as $file):
$simple_file_size = simple_file_size($file['size']);
2011-07-30 17:42:34 +04:00
$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2
2011-07-29 05:09:30 +04:00
if($simple_size_color<0) $simple_size_color = 0;
$relative_modified_date = relative_modified_date($file['mtime']);
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*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); ?>
<tr data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
<a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$directory.'/'.$name; else echo $_['downloadURL'].$directory.'/'.$name; ?>" title="">
<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:?>
<?php echo htmlspecialchars($file['basename']);?><span class='extention'><?php echo $file['extention'];?></span>
2011-07-07 04:41:22 +04:00
<?php endif;?>
</span>
2011-07-07 04:41:22 +04:00
</a>
</td>
<td class="filesize" title="<?php echo 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>
<?php endforeach; ?>