* @version $Revision: 1064 $ */ class TagCloudCssView 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) { global $gallery; $platform =& $gallery->getPlatform(); /* Get the file timestamp */ $slash = $platform->getDirectorySeparator(); $cssDir = $gallery->getConfig('data.gallery.plugins_data') . 'modules' . $slash . 'tags'; $cssFile = $cssDir . $slash . 'tags.css'; $cssFileStat = $platform->stat($cssFile); $fileLastModifiedDate = $cssFileStat[9]; if (function_exists('getallheaders')) { $headers = getallheaders(); if (isset($headers['If-modified-since'])) { $headers['If-Modified-Since'] = $headers['If-modified-since']; } if (isset($headers['If-Modified-Since']) && ($when = strtotime($headers['If-Modified-Since'])) > 0 && $fileLastModifiedDate < $when) { /* File not changed, don't resend */ header('HTTP/1.0 304 Not Modified'); return null; } } /* Send the CSS */ $cssFileRelative = 'plugins_data' . $slash . 'modules' . $slash. 'tags' . $slash . 'tags.css'; $success = $gallery->fastDownload($cssFileRelative, 'tags.css', $fileLastModifiedDate, 'text/css', $platform->filesize($cssFile)); if (!$success){ return GalleryCoreApi::error(ERROR_UNKNOWN, __FILE__, __LINE__, 'The CSS file couldn\'t be sent to the browser'); } return null; } } ?>