Add API function for getting Event's path

This commit is contained in:
Kyle Johnson 2015-01-23 11:57:31 -05:00
parent 4e0e8664b1
commit e4b1f8a64e
1 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,7 @@ App::uses('Component', 'Controller');
class ImageComponent extends Component {
public function getImageSrc( $event, $frame, $scale, $config ) {
$eventPath = $event['Event']['MonitorId'].'/'.strftime( "%y/%m/%d/%H/%M/%S", strtotime($event['Event']['StartTime']) );
$eventPath = $this->getEventPath($event);
$captImage = sprintf( "%0".$config['ZM_EVENT_IMAGE_DIGITS']."d-capture.jpg", $frame['Frame']['FrameId'] );
$captPath = $eventPath.'/'.$captImage;
@ -79,5 +79,11 @@ class ImageComponent extends Component {
return( $imageData );
}
// Take the StartTime of an Event and return
// the path to its location on the filesystem
public function getEventPath( $event ) {
return $event['Event']['MonitorId'].'/'.strftime( "%y/%m/%d/%H/%M/%S", strtotime($event['Event']['StartTime']) );
}
}
?>