summaryrefslogtreecommitdiffstats
path: root/apps/files/templates/part.list.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/templates/part.list.php')
-rw-r--r--apps/files/templates/part.list.php41
1 files changed, 39 insertions, 2 deletions
diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php
index 1e94275dcba..05fbb892509 100644
--- a/apps/files/templates/part.list.php
+++ b/apps/files/templates/part.list.php
@@ -1,6 +1,14 @@
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>">
-
+<?php $totalfiles = 0;
+$totaldirs = 0;
+$totalsize = 0; ?>
<?php foreach($_['files'] as $file):
+ $totalsize += $file['size'];
+ if ($file['type'] === 'dir') {
+ $totaldirs++;
+ } else {
+ $totalfiles++;
+ }
$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(160-$file['size']/(1024*1024)*2);
@@ -60,4 +68,33 @@
</span>
</td>
</tr>
-<?php endforeach;
+<?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">
+ <?php p(OCP\simple_file_size($totalsize)); ?>
+ </td>
+ <td></td>
+ </tr>
+ <?php endif;