00001 <?php
00002
00015
00016
00017
00018 import('classes.plugins.BlockPlugin');
00019
00020 class CmsBlockPlugin extends BlockPlugin {
00025 function getName() {
00026 return 'CmsBlockPlugin';
00027 }
00028
00033 function getDisplayName() {
00034 return Locale::translate('plugins.generic.cms.displayName');
00035 }
00036
00041 function getDescription() {
00042 $description = Locale::translate('plugins.generic.cms.description');
00043 $plugin =& $this->getCmsPlugin();
00044 if ( !$plugin->isTinyMCEInstalled() )
00045 $description .= "<br />".Locale::translate('plugins.generic.cms.requirement.tinymce');
00046 return $description;
00047 }
00048
00053 function getPluginPath() {
00054 $plugin =& $this->getCmsPlugin();
00055 return $plugin->getPluginPath();
00056 }
00057
00062 function getTemplatePath() {
00063 $plugin =& $this->getCmsPlugin();
00064 return $plugin->getTemplatePath();
00065 }
00066
00071 function getSupportedContexts() {
00072 return array(BLOCK_CONTEXT_LEFT_SIDEBAR, BLOCK_CONTEXT_RIGHT_SIDEBAR);
00073 }
00074
00080 function getContents(&$templateMgr) {
00081
00082
00083 $journal =& Request::getJournal();
00084 if (!$journal) return '';
00085
00086 $plugin =& $this->getCmsPlugin();
00087 if ( is_null($templateMgr->get_template_vars('cmsPluginToc')) ) {
00088 $templateMgr->assign('cmsPluginToc', $plugin->getSetting($journal->getJournalId(), 'toc'));
00089 }
00090 return parent::getContents($templateMgr);
00091 }
00092
00097 function &getCmsPlugin() {
00098 $plugin =& PluginRegistry::getPlugin('generic', 'CmsPlugin');
00099 return $plugin;
00100 }
00101
00106 function getEnabled() {
00107 $plugin =& $this->getCmsPlugin();
00108 if ( $plugin->getEnabled() ) {
00109 return parent::getEnabled();
00110 }
00111 return false;
00112 }
00113 }
00114
00115 ?>