* @author Pierre-Luc Paour * @author Daniel Grund */ GalleryCoreApi::requireOnce('modules/rss/classes/RssHelper.class'); GalleryCoreApi::requireOnce('modules/rss/classes/RssGenerator.class'); GalleryCoreApi::requireOnce('modules/rss/classes/RssMapHelper.class'); GalleryCoreApi::requireOnce('modules/rss/Render.inc'); /** * Render the Simple Feed * * @package RSS * @subpackage UserInterface */ class SimpleRenderView extends RenderView { /** * @see GalleryView::renderImmediate */ function renderImmediate($status, $error) { global $gallery; /* get all parameters */ list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'rss'); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } if ($params['allowSimpleFeed'] != 1) { $this->handleError($gallery->i18n('Feeds of that type are not allowed!')); return null; } list ($ret, $item) = $this->_getItem(); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } $params['itemId'] = $item->getId(); /* set feed type */ if (GalleryUtilities::isA($item, 'GalleryAlbumItem')) { $params['feedType'] = $params['sfAlbumType']; } elseif(GalleryUtilities::isA($item, 'GalleryDataItem')) { $params['feedType'] = 'commentsPhoto'; } $params['feedDate'] = $params['sfDate']; /* apply defaults */ foreach (array('copyright' => 'defaultCopyright', 'version' => 'defaultVersion', 'count' => 'defaultCount', 'photosRecurseLimit' => 'sfPhotosRecurseLimit', 'ttl' => 'defaultTtl') as $name => $defaultName) { $params[$name] = $params[$defaultName]; } $params['language'] = 'en-us'; $params['useImage'] = true; $params['useEnclosure'] = false; $params['useCloud'] = false; $ret = $this->continueRender($params); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } return null; } } ?>