]> source.dussan.org Git - nextcloud-server.git/commitdiff
add complete size of versions to array
authorBjörn Schießle <schiessle@owncloud.com>
Thu, 10 Jan 2013 09:36:55 +0000 (10:36 +0100)
committerBjörn Schießle <schiessle@owncloud.com>
Thu, 10 Jan 2013 09:36:55 +0000 (10:36 +0100)
apps/files_versions/lib/versions.php

index e890715b5a5076f13320d5aec981d57d013f0e37..58e4a2ce1321a38e7d9fb4514337a2c8ef9d2020 100644 (file)
@@ -245,10 +245,12 @@ class Storage {
                        
                        $result = array();
                        $file_count = array();
+                       $size_full = 0;
                        
                        foreach( $versions as $key => $value ) {\r
                                $i++;
                                $size = $versions_fileview->filesize($value['path']);
+                               $size_full = $size_full + $size;
                                $filename = substr($value['path'], 0, -strlen($value['timestamp'])-2);
 \r
                                $result['all'][$i]['version'] = $value['timestamp'];
@@ -269,6 +271,8 @@ class Storage {
                                \r
                        }
 
+                       $result['size'] = $size_full;
+                       
                        return $result;
                }
        }