getPluginPath() . '/settings.xml'; } /** * Install default settings on journal creation. * @return string */ function getContextSpecificPluginSettingsFile() { return $this->getPluginPath() . '/settings.xml'; } /** * Get the block context. Overrides parent so that the plugin will be * displayed during install. * @return int */ function getBlockContext() { if (!Config::getVar('general', 'installed')) return BLOCK_CONTEXT_RIGHT_SIDEBAR; return parent::getBlockContext(); } /** * Determine the plugin sequence. Overrides parent so that * the plugin will be displayed during install. */ function getSeq() { if (!Config::getVar('general', 'installed')) return 2; return parent::getSeq(); } /** * Get the display name of this plugin. * @return String */ function getDisplayName() { return __('plugins.block.languageToggle.displayName'); } /** * Get a description of the plugin. */ function getDescription() { return __('plugins.block.languageToggle.description'); } /** * Get the HTML contents for this block. */ function getContents(&$templateMgr) { $templateMgr->assign('isPostRequest', Request::isPost()); if (!defined('SESSION_DISABLE_INIT')) { $journal =& Request::getJournal(); if (isset($journal)) { $locales =& $journal->getSupportedLocaleNames(); } else { $site =& Request::getSite(); $locales =& $site->getSupportedLocaleNames(); } } else { $locales =& AppLocale::getAllLocales(); $templateMgr->assign('languageToggleNoUser', true); } if (isset($locales) && count($locales) > 1) { $templateMgr->assign('enableLanguageToggle', true); $templateMgr->assign('languageToggleLocales', $locales); } $templateMgr->addStyleSheet(Request::getBaseUrl() . '/' . $this->getPluginPath() . '/styles/languageToggle.css', STYLE_SEQUENCE_CORE); return parent::getContents($templateMgr); } } ?>