00001 <?php 00002 00015 // $Id: ThesisFeedBlockPlugin.inc.php,v 1.2 2008/07/01 01:16:13 asmecher Exp $ 00016 00017 00018 import('plugins.BlockPlugin'); 00019 00020 class ThesisFeedBlockPlugin extends BlockPlugin { 00026 function getName() { 00027 return 'ThesisFeedBlockPlugin'; 00028 } 00029 00034 function getDisplayName() { 00035 return Locale::translate('plugins.generic.thesisfeed.displayName'); 00036 } 00037 00041 function getDescription() { 00042 return Locale::translate('plugins.generic.thesisfeed.description'); 00043 } 00044 00049 function getSupportedContexts() { 00050 return array(BLOCK_CONTEXT_LEFT_SIDEBAR, BLOCK_CONTEXT_RIGHT_SIDEBAR); 00051 } 00052 00057 function &getThesisFeedPlugin() { 00058 $plugin =& PluginRegistry::getPlugin('generic', 'ThesisFeedPlugin'); 00059 return $plugin; 00060 } 00061 00066 function &getThesisPlugin() { 00067 $plugin =& PluginRegistry::getPlugin('generic', 'ThesisPlugin'); 00068 return $plugin; 00069 } 00070 00075 function getPluginPath() { 00076 $plugin =& $this->getThesisFeedPlugin(); 00077 return $plugin->getPluginPath(); 00078 } 00079 00084 function getTemplatePath() { 00085 $plugin =& $this->getThesisFeedPlugin(); 00086 return $plugin->getTemplatePath() . 'templates/'; 00087 } 00088 00094 function getContents(&$templateMgr) { 00095 $journal =& Request::getJournal(); 00096 if (!$journal) return ''; 00097 00098 $thesisPlugin =& $this->getThesisPlugin(); 00099 if (!$thesisPlugin->getEnabled()) return ''; 00100 00101 $plugin =& $this->getThesisFeedPlugin(); 00102 $displayPage = $plugin->getSetting($journal->getJournalId(), 'displayPage'); 00103 $requestedPage = Request::getRequestedPage(); 00104 00105 if (($displayPage == 'all') || ($displayPage == 'homepage' && (empty($requestedPage) || $requestedPage == 'index' || $requestedPage == 'thesis')) || ($displayPage == $requestedPage)) { 00106 return parent::getContents($templateMgr); 00107 } else { 00108 return ''; 00109 } 00110 } 00111 } 00112 00113 ?>
1.5.6