Add API function for getting Event's path
This commit is contained in:
parent
4e0e8664b1
commit
e4b1f8a64e
|
@ -3,7 +3,7 @@ App::uses('Component', 'Controller');
|
||||||
|
|
||||||
class ImageComponent extends Component {
|
class ImageComponent extends Component {
|
||||||
public function getImageSrc( $event, $frame, $scale, $config ) {
|
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'] );
|
$captImage = sprintf( "%0".$config['ZM_EVENT_IMAGE_DIGITS']."d-capture.jpg", $frame['Frame']['FrameId'] );
|
||||||
$captPath = $eventPath.'/'.$captImage;
|
$captPath = $eventPath.'/'.$captImage;
|
||||||
|
@ -79,5 +79,11 @@ class ImageComponent extends Component {
|
||||||
return( $imageData );
|
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']) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue