diff --git a/web/includes/Event.php b/web/includes/Event.php index 5ad1c4031..71e61b7c4 100644 --- a/web/includes/Event.php +++ b/web/includes/Event.php @@ -148,5 +148,8 @@ public function getStreamSrc( $args, $querySep='&' ) { return( $streamSrc ); } // end function getStreamSrc + function DiskSpace() { + return folder_size( $this->Path() ); + } } # end class ?> diff --git a/web/includes/functions.php b/web/includes/functions.php index c00003853..7161f6293 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2173,4 +2173,12 @@ function getStreamMode( ) { } } // end function getStreamMode +function folder_size($dir) { + $size = 0; + foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) { + $size += is_file($each) ? filesize($each) : folderSize($each); + } + return $size; +} // end fucntion folder_size + ?> diff --git a/web/skins/classic/views/events.php b/web/skins/classic/views/events.php index ebb97c368..be9eaed2d 100644 --- a/web/skins/classic/views/events.php +++ b/web/skins/classic/views/events.php @@ -95,8 +95,10 @@ $unarchived = false; $events = array(); foreach ( dbFetchAll( $eventsSql ) as $event ) { - $events[] = $event; - $scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); + $events[] = new Event( $event ); + + # Doesn this code do anything? + $scale = max( reScale( SCALE_BASE, $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); $eventWidth = reScale( $event['Width'], $scale ); $eventHeight = reScale( $event['Height'], $scale ); if ( $maxWidth < $eventWidth ) $maxWidth = $eventWidth; @@ -183,6 +185,7 @@ foreach ( $events as $event )