public function popup($fileName = null, $width = null, $height = null, $crop = null, $title = null)
{
if (empty($fileName)) {
return '';
}
$thumbconf = $this->app['config']->get('general/thumbnails');
$fullwidth = !empty($thumbconf['default_image'][0]) ? $thumbconf['default_image'][0] : 1000;
$fullheight = !empty($thumbconf['default_image'][1]) ? $thumbconf['default_image'][1] : 750;
$thumb = $this->getThumbnail($fileName, $width, $height, $crop);
$largeThumb = $this->getThumbnail($fileName, $fullwidth, $fullheight, 'r');
// BC Nightmare… If we're passed a title, use it, if not we might have
// one in the $fileName array, else use the file name
$title = $title ?: $thumb->getTitle() ?: sprintf('%s: %s', Trans::__('Image'), $thumb->getFileName());
$altTitle = $thumb->getAltTitle() ?: $title;
if ($this->getThumbnailUri($largeThumb)) {
$output = sprintf('<a href="%s" class="magnific" title="%s"><img src="%s" width="%s" height="%s" alt="%s"></a>', $this->getThumbnailUri($largeThumb), $title, $this->getThumbnailUri($thumb), $thumb->getWidth(), $thumb->getHeight(), $altTitle);
} else {
$output = '';
}
return $output;
}