plugins/generic/announcementFeed/AnnouncementFeedBlockPlugin.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00017 import('plugins.BlockPlugin');
00018 
00019 class AnnouncementFeedBlockPlugin extends BlockPlugin {
00023    function getHideManagement() {
00024       return true;
00025    }
00026 
00032    function getName() {
00033       return 'AnnouncementFeedBlockPlugin';
00034    }
00035 
00040    function getDisplayName() {
00041       return __('plugins.generic.announcementfeed.displayName');
00042    }
00043 
00047    function getDescription() {
00048       return __('plugins.generic.announcementfeed.description');
00049    }
00050 
00055    function getSupportedContexts() {
00056       return array(BLOCK_CONTEXT_LEFT_SIDEBAR, BLOCK_CONTEXT_RIGHT_SIDEBAR);
00057    }
00058 
00063    function getInstallSitePluginSettingsFile() {
00064       return $this->getPluginPath() . '/settings.xml';
00065    }
00066 
00071    function &getAnnouncementFeedPlugin() {
00072       $plugin =& PluginRegistry::getPlugin('generic', 'AnnouncementFeedPlugin');
00073       return $plugin;
00074    }
00075 
00080    function getPluginPath() {
00081       $plugin =& $this->getAnnouncementFeedPlugin();
00082       return $plugin->getPluginPath();
00083    }
00084 
00089    function getTemplatePath() {
00090       $plugin =& $this->getAnnouncementFeedPlugin();
00091       return $plugin->getTemplatePath() . 'templates/';
00092    }
00093 
00099    function getContents(&$templateMgr) {
00100       $conference =& Request::getConference();
00101 
00102       if (!$conference) return '';
00103 
00104       if (!$conference->getSetting('enableAnnouncements')) return ''; 
00105 
00106       $plugin =& $this->getAnnouncementFeedPlugin();
00107       $displayPage = $plugin->getSetting($conference->getId(), 0, 'displayPage');
00108       $requestedPage = Request::getRequestedPage();
00109 
00110       if (($displayPage == 'all') || ($displayPage == 'homepage' && (empty($requestedPage) || $requestedPage == 'index' || $requestedPage == 'announcement')) || ($displayPage == $requestedPage)) { 
00111          return parent::getContents($templateMgr);
00112       } else {
00113          return '';
00114       }
00115    }
00116 }
00117 
00118 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7