tag on another site. * * @package Rewrite * @subpackage UserInterface * @author Alan Harder * @version $Revision: 15513 $ */ class DownloadItemView extends GalleryView { /** * @see GalleryView::isImmediate */ function isImmediate() { return true; } /** * @see GalleryView::isAllowedInEmbedOnly */ function isAllowedInEmbedOnly() { return true; } /** * @see GalleryView::shouldSaveSession */ function shouldSaveSession() { return false; } /** * @see GalleryView::renderImmediate */ function renderImmediate($status, $error) { $itemId = GalleryUtilities::getRequestVariables('itemId'); if (empty($itemId)) { return GalleryCoreApi::error(ERROR_BAD_PARAMETER); } list ($ret, $image) = GalleryCoreApi::loadEntitiesById($itemId); if ($ret) { return $ret; } header('Content-type: text/html; charset=UTF-8'); header('Expires: ' . GalleryUtilities::getHttpDate(time() - 100)); header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header('Pragma: no-cache'); if (GalleryUtilities::isA($image, 'GalleryItem')) { $item = $image; } else { list ($ret, $item) = GalleryCoreApi::loadEntitiesById($image->getParentId()); if ($ret) { return $ret; } } list ($ret, $albumId) = GalleryCoreApi::getDefaultAlbumId(); if ($ret) { return $ret; } list ($ret, $album) = GalleryCoreApi::loadEntitiesById($albumId); if ($ret) { return $ret; } GalleryCoreApi::requireOnce('modules/core/classes/GalleryTemplate.class'); $template = new GalleryTemplate(dirname(dirname(dirname(__FILE__)))); $template->setVariable('l10Domain', 'modules_rewrite'); $template->setVariable('item', (array)$item); $template->setVariable('image', (array)$image); $template->setVariable('gallery', (array)$album); $ret = $template->display('gallery:modules/rewrite/templates/DownloadItem.tpl'); if ($ret) { return $ret; } return null; } } ?>