From c95e449bbdc403a5ed690159fbd56e423df6d33f Mon Sep 17 00:00:00 2001 From: bhaal2 Date: Sat, 17 Sep 2016 02:11:07 +1000 Subject: [PATCH 1/3] Modifications to getDiskPercent(): Moved '%' to this function instead of at end of html in skins/classing/include/functions.php Changed from SQL query to Storage area object model. --- web/includes/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 9087c7c6d..2b97456f7 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1477,12 +1477,12 @@ function getDiskPercent() { else { $spaceString = ''; } - $storageAreas = dbFetchAll("select path, name from Storage order by Id"); - foreach($storageAreas as $storagePath) { - $storageTotal = disk_total_space($storagePath['path']); - $storageFree = disk_free_space($storagePath['path']); + $storageAreas = Storage::find_all(); + foreach($storageAreas as $storageArea) { + $storageTotal = disk_total_space($storageArea->Path); + $storageFree = disk_free_space($storageArea->Path); $storageSpace = round(($storageTotal - $storageFree) / $storageTotal * 100); - $spaceString .= ', '.$storagePath['name'].' '.$storageSpace; + $spaceString .= ', '.$storageArea->Name.' '.$storageSpace.'%'; } return( $spaceString ); } From aee6ae956d8524e9e5ae7063a323f6f689b44a74 Mon Sep 17 00:00:00 2001 From: bhaal2 Date: Sat, 17 Sep 2016 02:13:33 +1000 Subject: [PATCH 2/3] Moved '%' to getDiskPercent() where it should have been. --- web/skins/classic/includes/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index b772412b1..bfb55b045 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -79,8 +79,8 @@ function xhtmlHeaders( $file, $title ) - - + + - + @@ -249,7 +249,7 @@ function getNavBarHTML() { From c74af40ffbdc47844d02563add147563db23c5a7 Mon Sep 17 00:00:00 2001 From: bhaal2 Date: Sat, 17 Sep 2016 02:20:17 +1000 Subject: [PATCH 3/3] Had file open with old stuff. Fixed now. --- web/skins/classic/includes/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index bfb55b045..057245de0 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -79,8 +79,8 @@ function xhtmlHeaders( $file, $title ) - - + + - +