4 * @file FontSizeBlockPlugin.inc.php
6 * Copyright (c) 2003-2008 John Willinsky
7 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9 * @class FontSizeBlockPlugin
10 * @ingroup plugins_blocks_fontSize
12 * @brief Class for font size block plugin
16 // $Id: FontSizeBlockPlugin.inc.php,v 1.1.1.1 2008/10/20 21:27:10 tylerl Exp $
18 import('plugins.BlockPlugin');
20 class FontSizeBlockPlugin
extends BlockPlugin
{
21 function register($category, $path) {
22 $success = parent
::register($category, $path);
24 $this->addLocaleData();
25 $templateMgr =& TemplateManager
::getManager();
26 $templateMgr->assign('fontIconPath', 'templates/images/icons');
27 $additionalHeadData = $templateMgr->get_template_vars('additionalHeadData');
29 // Add font sizer js and css if not already in header
30 if (strpos(strtolower($additionalHeadData), 'sizer.js') === false) {
31 $additionalHeadData .= $templateMgr->fetch('common/sizer.tpl');
32 $templateMgr->assign('additionalHeadData', $additionalHeadData);
39 * Determine whether the plugin is enabled. Overrides parent so that
40 * the plugin will be displayed during install.
42 function getEnabled() {
43 if (!Config
::getVar('general', 'installed')) return true;
44 return parent
::getEnabled();
48 * Install default settings on system install.
51 function getInstallSitePluginSettingsFile() {
52 return $this->getPluginPath() . '/settings.xml';
56 * Install default settings on press creation.
59 function getNewPressPluginSettingsFile() {
60 return $this->getPluginPath() . '/settings.xml';
64 * Get the block context. Overrides parent so that the plugin will be
65 * displayed during install.
68 function getBlockContext() {
69 if (!Config
::getVar('general', 'installed')) return BLOCK_CONTEXT_RIGHT_SIDEBAR
;
70 return parent
::getBlockContext();
74 * Get the supported contexts (e.g. BLOCK_CONTEXT_...) for this block.
77 function getSupportedContexts() {
78 return array(BLOCK_CONTEXT_LEFT_SIDEBAR
, BLOCK_CONTEXT_RIGHT_SIDEBAR
);
82 * Determine the plugin sequence. Overrides parent so that
83 * the plugin will be displayed during install.
86 if (!Config
::getVar('general', 'installed')) return 3;
87 return parent
::getSeq();
91 * Get the name of this plugin. The name must be unique within
93 * @return String name of plugin
96 return 'FontSizeBlockPlugin';
100 * Get the display name of this plugin.
103 function getDisplayName() {
104 return Locale
::translate('plugins.block.fontSize.displayName');
108 * Get a description of the plugin.
110 function getDescription() {
111 return Locale
::translate('plugins.block.fontSize.description');
115 * Get the HTML contents for this block.
116 * @param $templateMgr object
119 function getContents(&$templateMgr) {
120 return parent
::getContents($templateMgr);