17 import(
'lib.pkp.classes.plugins.BlockPlugin');
32 $this->_blockName = $blockName;
33 $this->_parentPlugin = $parentPlugin;
34 parent::__construct();
57 return $plugin->getPluginPath();
65 return $plugin->getTemplatePath($inCore);
80 return parent::getEnabled($contextId);
87 return $this->_blockName .
' ' . __(
'plugins.generic.customBlock.nameSuffix');
94 return __(
'plugins.generic.customBlock.description');
102 $contextId = $context ? $context->getId() : 0;
105 $customBlockContent = $this->
getSetting($contextId,
'blockContent');
107 $contextPrimaryLocale = $context?$context->getPrimaryLocale():
$request->getSite()->getPrimaryLocale();
109 $divCustomBlockId =
'customblock-'.preg_replace(
'/\W+/',
'-', $this->
getName());
110 $templateMgr->assign(
'customBlockId', $divCustomBlockId);
112 $content = $customBlockContent[$currentLocale] ? $customBlockContent[$currentLocale] : $customBlockContent[$contextPrimaryLocale];
114 $templateMgr->assign(
'customBlockContent', $content);
115 return parent::getContents($templateMgr,
$request);