/**
* Display the requested view.
*
* @param string $view Which view to display.
* @param Ansel_Style $style Force use of this gallery style.
*
* @throws Horde_Exception_PermissionDenied, Ansel_Exception
*/
public function display($view = 'full', Ansel_Style $style = null)
{
if ($view == 'full' && !$this->_dirty) {
// Check full photo permissions
$gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery(abs($this->gallery));
if (!$gallery->canDownload()) {
throw Horde_Exception_PermissionDenied(_("Access denied downloading photos from this gallery."));
}
try {
$data = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Vfs')->create('images')->read($this->getVFSPath('full'), $this->getVFSName('full'));
} catch (Horde_Vfs_Exception $e) {
throw new Ansel_Exception($e);
}
echo $data;
} elseif (!$this->_dirty) {
$this->load($view, $style);
$this->_image->display();
} else {
$this->_image->display();
}
}