added prev/next event ids

pull/1136/head
Pliable Pixels 2015-11-02 16:54:52 -05:00
parent f13dddb719
commit e3d06ca103
1 changed files with 4 additions and 0 deletions

View File

@ -83,10 +83,14 @@ class EventsController extends AppController {
}
$options = array('conditions' => array('Event.' . $this->Event->primaryKey => $id));
$event = $this->Event->find('first', $options);
$this->Event->id = $id;
$event_neighbors = $this->Event->find('neighbors');
$path = $configs['ZM_DIR_EVENTS'].'/'.$this->Image->getEventPath($event).'/';
$event['Event']['BasePath'] = $path;
$event['Event']['Next'] = $event_neighbors['next']['Event']['Id'];
$event['Event']['Prev'] = $event_neighbors['prev']['Event']['Id'];
$this->set(array(
'event' => $event,