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 ) + DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); ?> - - - - - - - - - - - + Id().$filterQuery.$sortQuery.'&page=1', 'zmEvent', array( 'event', reScale( $event->Width(), $scale ), reScale( $event->Height(), $scale ) ), $event->Id().($event->Archived()?'*':'') ) ?> + Id().$filterQuery.$sortQuery.'&page=1', 'zmEvent', array( 'event', reScale( $event->Width(), $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), reScale( $event->Height(), $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ) ), validHtmlStr($event->Name()).($event->Archived()?'*':'' ) ) ?> + MonitorName() ?> + Id(), 'zmEventDetail', 'eventdetail', validHtmlStr($event->Cause()), canEdit( 'Events' ), 'title="'.htmlspecialchars($event->Notes()).'"' ) ?> + StartTime()) ) ?> + Length() ) ?> + Id(), 'zmFrames', 'frames', $event->Frames() ) ?> + Id(), 'zmFrames', 'frames', $event->AlarmFrames() ) ?> + TotScore() ?> + AvgScore() ?> + Id().'&fid=0', 'zmImage', array( 'image', reScale( $event->Width(), $scale ), reScale( $event->Height(), $scale ) ), $event->MaxScore() ) ?> + DiskSpace() ?> - ' ) ?> + Width(), $scale ), reScale( $event->Height(), $scale ) ), ''.$thumbData['FrameId'].'/'.$event->MaxScore().'' ) ?> - disabled="disabled"/> + disabled="disabled"/>