00001 <?php
00002
00015
00016
00017
00018 import('plugins.BlockPlugin');
00019
00020 class WebFeedBlockPlugin extends BlockPlugin {
00026 function getName() {
00027 return 'WebFeedBlockPlugin';
00028 }
00029
00034 function getDisplayName() {
00035 return Locale::translate('plugins.generic.webfeed.displayName');
00036 }
00037
00041 function getDescription() {
00042 return Locale::translate('plugins.generic.webfeed.description');
00043 }
00044
00049 function getSupportedContexts() {
00050 return array(BLOCK_CONTEXT_LEFT_SIDEBAR, BLOCK_CONTEXT_RIGHT_SIDEBAR);
00051 }
00052
00057 function &getWebFeedPlugin() {
00058 $plugin =& PluginRegistry::getPlugin('generic', 'WebFeedPlugin');
00059 return $plugin;
00060 }
00061
00066 function getPluginPath() {
00067 $plugin =& $this->getWebFeedPlugin();
00068 return $plugin->getPluginPath();
00069 }
00070
00075 function getTemplatePath() {
00076 $plugin =& $this->getWebFeedPlugin();
00077 return $plugin->getTemplatePath() . 'templates/';
00078 }
00079
00085 function getContents(&$templateMgr) {
00086 $journal =& Request::getJournal();
00087 if (!$journal) return '';
00088
00089 $plugin =& $this->getWebFeedPlugin();
00090 $displayPage = $plugin->getSetting($journal->getJournalId(), 'displayPage');
00091 $requestedPage = Request::getRequestedPage();
00092 $issueDao = &DAORegistry::getDAO('IssueDAO');
00093 $currentIssue =& $issueDao->getCurrentIssue($journal->getJournalId());
00094
00095 if ( ($currentIssue) && (($displayPage == 'all') || ($displayPage == 'homepage' && (empty($requestedPage) || $requestedPage == 'index' || $requestedPage == 'issue')) || ($displayPage == 'issue' && $displayPage == $requestedPage)) ) {
00096 return parent::getContents($templateMgr);
00097 } else {
00098 return '';
00099 }
00100 }
00101 }
00102
00103 ?>