本文整理汇总了PHP中PluginRegistry::loadPlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistry::loadPlugin方法的具体用法?PHP PluginRegistry::loadPlugin怎么用?PHP PluginRegistry::loadPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginRegistry
的用法示例。
在下文中一共展示了PluginRegistry::loadPlugin方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setMetadata
/**
* Register the article's metadata with the SWORD deposit.
*/
function setMetadata()
{
$this->package->setCustodian($this->journal->getSetting('contactName'));
$this->package->setTitle(html_entity_decode($this->article->getTitle($this->journal->getPrimaryLocale()), ENT_QUOTES, 'UTF-8'));
$this->package->setAbstract(html_entity_decode(strip_tags($this->article->getAbstract($this->journal->getPrimaryLocale())), ENT_QUOTES, 'UTF-8'));
$this->package->setType($this->section->getIdentifyType($this->journal->getPrimaryLocale()));
// The article can be published or not. Support either.
if (is_a($this->article, 'PublishedArticle')) {
$doi = $this->article->getPubId('doi');
if ($doi !== null) {
$this->package->setIdentifier($doi);
}
}
foreach ($this->article->getAuthors() as $author) {
$creator = $author->getFullName(true);
$affiliation = $author->getAffiliation($this->journal->getPrimaryLocale());
if (!empty($affiliation)) {
$creator .= "; {$affiliation}";
}
$this->package->addCreator($creator);
}
// The article can be published or not. Support either.
if (is_a($this->article, 'PublishedArticle')) {
$plugin =& PluginRegistry::loadPlugin('citationFormats', 'bibtex');
$this->package->setCitation(html_entity_decode(strip_tags($plugin->fetchCitation($this->article, $this->issue, $this->journal)), ENT_QUOTES, 'UTF-8'));
}
}
示例2: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
* @param $request PKPRequest FIXME: is optional for backwards compatibility only - make mandatory
*/
function TemplateManager($request = null)
{
// FIXME: for backwards compatibility only - remove
if (!isset($request)) {
// FIXME: Trigger a deprecation warning when enough instances of this
// call have been fixed to not clutter the error log.
$request =& Registry::get('request');
}
assert(is_a($request, 'PKPRequest'));
parent::PKPTemplateManager($request);
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$site =& $request->getSite();
$siteFilesDir = $request->getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
$this->assign('isAdmin', Validation::isSiteAdmin());
// assign an empty home context
$this->assign('homeContext', array());
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet($request->getBaseUrl() . '/' . $siteStyleFilename);
}
// Load and apply theme plugin, if chosen
$themePluginPath = $site->getSetting('theme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Add the site-wide logo, if set for this locale or the primary locale
$this->assign('displayPageHeaderTitle', $site->getLocalizedPageHeaderTitle());
$customLogo = $site->getSetting('customLogo');
if ($customLogo) {
$this->assign('displayPageHeaderLogo', $customLogo);
}
$this->assign('siteTitle', $site->getLocalizedTitle());
$this->assign('enableSubmit', $site->getSetting('enableSubmit'));
// Add java script for notifications
$user =& $request->getUser();
if ($user) {
$this->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.pnotify.js');
}
}
}
示例3: setMetadata
/**
* Register the article's metadata with the SWORD deposit.
*/
function setMetadata()
{
$this->package->setCustodian($this->journal->getSetting('contactName'));
$this->package->setTitle($this->article->getTitle($this->journal->getPrimaryLocale()));
$this->package->setAbstract($this->article->getAbstract($this->journal->getPrimaryLocale()));
$this->package->setType($this->section->getIdentifyType($this->journal->getPrimaryLocale()));
$doi = $this->article->getDOI();
if ($doi !== null) {
$this->package->setIdentifier($doi);
}
foreach ($this->article->getAuthors() as $author) {
$this->package->addCreator($author->getFullName());
}
$plugin =& PluginRegistry::loadPlugin('citationFormats', 'bibtex');
$this->package->setCitation(html_entity_decode(strip_tags($plugin->fetchCitation($this->article, $this->issue, $this->journal))));
}
示例4: initialize
/**
* @copydoc PKPHandler::initialize()
*/
function initialize($request)
{
parent::initialize($request);
// Basic grid configuration.
$this->setTitle('plugins.importexport.common.export.issues');
// Load submission-specific translations.
AppLocale::requireComponents(LOCALE_COMPONENT_APP_EDITOR, LOCALE_COMPONENT_APP_MANAGER);
$pluginCategory = $request->getUserVar('category');
$pluginPathName = $request->getUserVar('plugin');
$this->_plugin = PluginRegistry::loadPlugin($pluginCategory, $pluginPathName);
assert(isset($this->_plugin));
// Fetch the authorized roles.
$authorizedRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES);
// Grid columns.
$cellProvider = new PubIdExportIssuesListGridCellProvider($this->_plugin, $authorizedRoles);
$this->addColumn(new GridColumn('identification', 'issue.issue', null, null, $cellProvider, array('html' => true, 'alignment' => COLUMN_ALIGNMENT_LEFT)));
$this->addColumn(new GridColumn('published', 'editor.issues.published', null, null, $cellProvider, array('html' => true, 'alignment' => COLUMN_ALIGNMENT_LEFT)));
$this->addColumn(new GridColumn('pubId', null, $this->_plugin->getPubIdDisplayType(), null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 15)));
$this->addColumn(new GridColumn('status', 'common.status', null, null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 10)));
}
示例5: initialize
/**
* @copydoc PKPHandler::initialize()
*/
function initialize($request)
{
parent::initialize($request);
$context = $request->getContext();
// Basic grid configuration.
$this->setTitle('plugins.importexport.common.export.articles');
// Load submission-specific translations.
AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_MANAGER);
$pluginCategory = $request->getUserVar('category');
$pluginPathName = $request->getUserVar('plugin');
$this->_plugin = PluginRegistry::loadPlugin($pluginCategory, $pluginPathName);
assert(isset($this->_plugin));
// Grid columns.
$cellProvider = $this->getGridCellProvider();
$this->addColumn(new GridColumn('id', null, __('common.id'), 'controllers/grid/gridCell.tpl', $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 10)));
$this->addColumn(new GridColumn('title', 'grid.submission.itemTitle', null, null, $cellProvider, array('html' => true, 'alignment' => COLUMN_ALIGNMENT_LEFT)));
$this->addColumn(new GridColumn('issue', 'issue.issue', null, null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 20)));
if (method_exists($this, 'addAdditionalColumns')) {
$this->addAdditionalColumns($cellProvider);
}
$this->addColumn(new GridColumn('status', 'common.status', null, null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 10)));
}
示例6: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
*/
function TemplateManager()
{
parent::PKPTemplateManager();
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$site =& Request::getSite();
$siteFilesDir = Request::getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
$this->assign('isAdmin', Validation::isSiteAdmin());
// assign an empty home context
$this->assign('homeContext', array());
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . $siteStyleFilename);
}
// Load and apply theme plugin, if chosen
$themePluginPath = $site->getSetting('theme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Add the site-wide logo, if set for this locale or the primary locale
$this->assign('displayPageHeaderTitle', $site->getLocalizedPageHeaderTitle());
$customLogo = $site->getSetting('customLogo');
if ($customLogo) {
$this->assign('useCustomLogo', $customLogo);
}
$this->assign('siteTitle', $site->getLocalizedTitle());
$this->assign('enableSubmit', $site->getSetting('enableSubmit'));
}
}
示例7: initialize
/**
* @copydoc PKPHandler::initialize()
*/
function initialize($request)
{
parent::initialize($request);
$context = $request->getContext();
// Basic grid configuration.
$this->setTitle('plugins.importexport.common.export.articles');
// Load submission-specific translations.
AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_MANAGER);
$pluginCategory = $request->getUserVar('category');
$pluginPathName = $request->getUserVar('plugin');
$this->_plugin = PluginRegistry::loadPlugin($pluginCategory, $pluginPathName);
assert(isset($this->_plugin));
// Fetch the authorized roles.
$authorizedRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES);
// Grid columns.
$cellProvider = new PubIdExportRepresentationsListGridCellProvider($this->_plugin, $authorizedRoles);
$this->addColumn(new GridColumn('id', null, __('common.id'), 'controllers/grid/gridCell.tpl', $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 10)));
$this->addColumn(new GridColumn('title', 'grid.submission.itemTitle', null, null, $cellProvider, array('html' => true, 'alignment' => COLUMN_ALIGNMENT_LEFT)));
$this->addColumn(new GridColumn('issue', 'issue.issue', null, null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 20)));
$this->addColumn(new GridColumn('galley', 'submission.layout.galleyLabel', null, null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 20)));
$this->addColumn(new GridColumn('pubId', null, $this->_plugin->getPubIdDisplayType(), null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 15)));
$this->addColumn(new GridColumn('status', 'common.status', null, null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 10)));
}
示例8: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
* @param $request PKPRequest FIXME: is optional for backwards compatibility only - make mandatory
*/
function TemplateManager($request = null)
{
parent::PKPTemplateManager($request);
// Retrieve the router
$router =& $this->request->getRouter();
assert(is_a($router, 'PKPRouter'));
// Are we using implicit authentication?
$this->assign('implicitAuth', Config::getVar('security', 'implicit_auth'));
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$journal =& $router->getContext($this->request);
$site =& $this->request->getSite();
$publicFileManager = new PublicFileManager();
$siteFilesDir = $this->request->getBaseUrl() . '/' . $publicFileManager->getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
// May be overridden by journal
$siteStyleFilename = $publicFileManager->getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet($this->request->getBaseUrl() . '/' . $siteStyleFilename);
}
$this->assign('homeContext', array());
$this->assign('siteCategoriesEnabled', $site->getSetting('categoriesEnabled'));
if (isset($journal)) {
$this->assign_by_ref('currentJournal', $journal);
$journalTitle = $journal->getLocalizedTitle();
$this->assign('siteTitle', $journalTitle);
$this->assign('publicFilesDir', $this->request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journal->getId()));
$this->assign('primaryLocale', $journal->getPrimaryLocale());
$this->assign('alternateLocales', $journal->getSetting('alternateLocales'));
// Assign additional navigation bar items
$navMenuItems =& $journal->getLocalizedSetting('navItems');
$this->assign_by_ref('navMenuItems', $navMenuItems);
// Assign journal page header
$this->assign('displayPageHeaderTitle', $journal->getLocalizedPageHeaderTitle());
$this->assign('displayPageHeaderLogo', $journal->getLocalizedPageHeaderLogo());
$this->assign('displayPageHeaderTitleAltText', $journal->getLocalizedSetting('pageHeaderTitleImageAltText'));
$this->assign('displayPageHeaderLogoAltText', $journal->getLocalizedSetting('pageHeaderLogoImageAltText'));
$this->assign('displayFavicon', $journal->getLocalizedFavicon());
$this->assign('faviconDir', $this->request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journal->getId()));
$this->assign('alternatePageHeader', $journal->getLocalizedSetting('journalPageHeader'));
$this->assign('metaSearchDescription', $journal->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $journal->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $journal->getLocalizedSetting('customHeaders'));
$this->assign('numPageLinks', $journal->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $journal->getSetting('itemsPerPage'));
$this->assign('enableAnnouncements', $journal->getSetting('enableAnnouncements'));
$this->assign('hideRegisterLink', !$journal->getSetting('allowRegReviewer') && !$journal->getSetting('allowRegReader') && !$journal->getSetting('allowRegAuthor'));
// Load and apply theme plugin, if chosen
$themePluginPath = $journal->getSetting('journalTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Assign stylesheets and footer
$journalStyleSheet = $journal->getSetting('journalStyleSheet');
if ($journalStyleSheet) {
$this->addStyleSheet($this->request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journal->getId()) . '/' . $journalStyleSheet['uploadName']);
}
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($this->request);
$this->assign('journalPaymentsEnabled', $paymentManager->isConfigured());
$this->assign('pageFooter', $journal->getLocalizedSetting('journalPageFooter'));
} else {
// Add the site-wide logo, if set for this locale or the primary locale
$displayPageHeaderTitle = $site->getLocalizedPageHeaderTitle();
$this->assign('displayPageHeaderTitle', $displayPageHeaderTitle);
if (isset($displayPageHeaderTitle['altText'])) {
$this->assign('displayPageHeaderTitleAltText', $displayPageHeaderTitle['altText']);
}
$this->assign('siteTitle', $site->getLocalizedTitle());
// Load and apply theme plugin, if chosen
$themePluginPath = $site->getSetting('siteTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
}
if (!$site->getRedirect()) {
$this->assign('hasOtherJournals', true);
}
// Add java script for notifications
$user =& $this->request->getUser();
if ($user) {
$this->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.pnotify.js');
//.........这里部分代码省略.........
示例9: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
* @param $request PKPRequest FIXME: is optional for backwards compatibility only - make mandatory
*/
function TemplateManager($request = null)
{
// FIXME: for backwards compatibility only - remove
if (!isset($request)) {
// FIXME: Trigger a deprecation warning when enough instances of this
// call have been fixed to not clutter the error log.
$request =& Registry::get('request');
}
assert(is_a($request, 'PKPRequest'));
parent::PKPTemplateManager($request);
// Retrieve the router
$router =& $request->getRouter();
assert(is_a($router, 'PKPRouter'));
// Are we using implicit authentication?
$this->assign('implicitAuth', Config::getVar('security', 'implicit_auth'));
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$press =& $router->getContext($request);
$site =& $request->getSite();
$siteFilesDir = $request->getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
// May be overridden by press
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet($request->getBaseUrl() . '/' . $siteStyleFilename);
}
$this->assign('homeContext', array());
if (isset($press)) {
$this->assign_by_ref('currentPress', $press);
$pressTitle = $press->getLocalizedName();
$this->assign('siteTitle', $pressTitle);
$this->assign('publicFilesDir', $request->getBaseUrl() . '/' . PublicFileManager::getPressFilesPath($press->getId()));
$this->assign('primaryLocale', $press->getPrimaryLocale());
$this->assign('alternateLocales', $press->getSetting('alternateLocales'));
// Assign additional navigation bar items
$navMenuItems =& $press->getLocalizedSetting('navItems');
$this->assign_by_ref('navMenuItems', $navMenuItems);
// Assign press page header
$this->assign('displayPageHeaderTitle', $press->getPressPageHeaderTitle());
$this->assign('displayPageHeaderLogo', $press->getPressPageHeaderLogo());
$this->assign('alternatePageHeader', $press->getLocalizedSetting('pressPageHeader'));
$this->assign('metaSearchDescription', $press->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $press->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $press->getLocalizedSetting('customHeaders'));
$this->assign('numPageLinks', $press->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $press->getSetting('itemsPerPage'));
$this->assign('enableAnnouncements', $press->getSetting('enableAnnouncements'));
// Load and apply theme plugin, if chosen
$themePluginPath = $press->getSetting('pressTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Assign stylesheets and footer
$pressStyleSheet = $press->getSetting('pressStyleSheet');
if ($pressStyleSheet) {
$this->addStyleSheet($request->getBaseUrl() . '/' . PublicFileManager::getPressFilesPath($press->getId()) . '/' . $pressStyleSheet['uploadName']);
}
$this->assign('pageFooter', $press->getLocalizedSetting('pressPageFooter'));
} else {
// Add the site-wide logo, if set for this locale or the primary locale
$displayPageHeaderTitle = $site->getLocalizedPageHeaderTitle();
$this->assign('displayPageHeaderTitle', $displayPageHeaderTitle);
if (isset($displayPageHeaderTitle['altText'])) {
$this->assign('displayPageHeaderTitleAltText', $displayPageHeaderTitle['altText']);
}
$this->assign('siteTitle', $site->getLocalizedTitle());
}
if (!$site->getRedirect()) {
$this->assign('hasOtherPresses', true);
}
}
}
示例10: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
* @param $request PKPRequest FIXME: is optional for backwards compatibility only - make mandatory
*/
function TemplateManager($request = null)
{
// FIXME: for backwards compatibility only - remove
if (!isset($request)) {
// FIXME: Trigger a deprecation warning when enough instances of this
// call have been fixed to not clutter the error log.
$request =& Registry::get('request');
}
assert(is_a($request, 'PKPRequest'));
parent::PKPTemplateManager($request);
// Retrieve the router
$router =& $request->getRouter();
assert(is_a($router, 'PKPRouter'));
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$conference =& $router->getContext($request, 1);
$schedConf =& $router->getContext($request, 2);
$site =& $request->getSite();
$this->assign('siteTitle', $site->getLocalizedTitle());
$siteFilesDir = $request->getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('homeContext', array('conference' => 'index', 'schedConf' => 'index'));
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet($request->getBaseUrl() . '/' . $siteStyleFilename);
}
if (isset($conference)) {
$schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
$archivedSchedConfsExist = $schedConfDao->archivedSchedConfsExist($conference->getId());
$currentSchedConfsExist = $schedConfDao->currentSchedConfsExist($conference->getId());
$this->assign('archivedSchedConfsExist', $archivedSchedConfsExist);
$this->assign('currentSchedConfsExist', $currentSchedConfsExist);
$this->assign_by_ref('currentConference', $conference);
$conferenceTitle = $conference->getConferenceTitle();
$this->assign('numPageLinks', $conference->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $conference->getSetting('itemsPerPage'));
// Load and apply theme plugin, if chosen
$themePluginPath = $conference->getSetting('conferenceTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Assign additional navigation bar items
$navMenuItems =& $conference->getLocalizedSetting('navItems');
$this->assign_by_ref('navMenuItems', $navMenuItems);
$this->assign('publicFilesDir', $request->getBaseUrl() . '/' . PublicFileManager::getConferenceFilesPath($conference->getId()));
$this->assign('displayPageHeaderTitle', $conference->getPageHeaderTitle());
$this->assign('displayPageHeaderLogo', $conference->getPageHeaderLogo());
$this->assign('displayPageHeaderTitleAltText', $conference->getLocalizedSetting('pageHeaderTitleImageAltText'));
$this->assign('displayPageHeaderLogoAltText', $conference->getLocalizedSetting('pageHeaderLogoImageAltText'));
$this->assign('displayFavicon', $conference->getLocalizedFavicon());
$this->assign('faviconDir', $request->getBaseUrl() . '/' . PublicFileManager::getConferenceFilesPath($conference->getId()));
$this->assign('alternatePageHeader', $conference->getLocalizedSetting('conferencePageHeader'));
$this->assign('metaSearchDescription', $conference->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $conference->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $conference->getLocalizedSetting('customHeaders'));
$this->assign('enableAnnouncements', $conference->getSetting('enableAnnouncements'));
$this->assign('pageFooter', $conference->getLocalizedSetting('conferencePageFooter'));
$this->assign('displayCreativeCommons', $conference->getSetting('postCreativeCommons'));
if (isset($schedConf)) {
// This will be needed if inheriting public conference files from the scheduled conference.
$this->assign('publicSchedConfFilesDir', $request->getBaseUrl() . '/' . PublicFileManager::getSchedConfFilesPath($schedConf->getId()));
$this->assign('primaryLocale', $conference->getSetting('primaryLocale'));
$this->assign('alternateLocales', $conference->getPrimaryLocale());
$this->assign_by_ref('currentSchedConf', $schedConf);
// Assign common sched conf vars:
$currentTime = time();
$submissionsCloseDate = $schedConf->getSetting('submissionsCloseDate');
$this->assign('submissionsCloseDate', $submissionsCloseDate);
$this->assign('schedConfPostTimeline', $schedConf->getSetting('postTimeline'));
$this->assign('schedConfPostOverview', $schedConf->getSetting('postOverview'));
$this->assign('schedConfPostTrackPolicies', $schedConf->getSetting('postTrackPolicies'));
$this->assign('schedConfPostPresentations', $schedConf->getSetting('postPresentations'));
$this->assign('schedConfPostAccommodation', $schedConf->getSetting('postAccommodation'));
$this->assign('schedConfPostSupporters', $schedConf->getSetting('postSupporters'));
$this->assign('schedConfPostPayment', $schedConf->getSetting('postPayment'));
// CFP displayed
$showCFPDate = $schedConf->getSetting('showCFPDate');
$postCFP = $schedConf->getSetting('postCFP');
if ($postCFP && $showCFPDate && $submissionsCloseDate && $currentTime > $showCFPDate && $currentTime < $submissionsCloseDate) {
$this->assign('schedConfShowCFP', true);
}
// Schedule displayed
$postScheduleDate = $schedConf->getSetting('postScheduleDate');
if ($postScheduleDate && $currentTime > $postScheduleDate && $schedConf->getSetting('postSchedule')) {
$this->assign('schedConfPostSchedule', true);
}
// Program
//.........这里部分代码省略.........
示例11: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
*/
function TemplateManager()
{
parent::PKPTemplateManager();
// Are we using implicit authentication?
$this->assign('implicitAuth', Config::getVar('security', 'implicit_auth'));
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$journal =& Request::getJournal();
$site =& Request::getSite();
$siteFilesDir = Request::getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
// May be overridden by journal
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . $siteStyleFilename);
}
if (isset($journal)) {
$this->assign_by_ref('currentJournal', $journal);
$journalTitle = $journal->getJournalTitle();
$this->assign('siteTitle', $journalTitle);
$this->assign('publicFilesDir', Request::getBaseUrl() . '/' . PublicFileManager::getJournalFilesPath($journal->getJournalId()));
$this->assign('primaryLocale', $journal->getPrimaryLocale());
$this->assign('alternateLocales', $journal->getSetting('alternateLocales'));
// Assign additional navigation bar items
$navMenuItems =& $journal->getLocalizedSetting('navItems');
$this->assign_by_ref('navMenuItems', $navMenuItems);
// Assign journal page header
$this->assign('displayPageHeaderTitle', $journal->getJournalPageHeaderTitle());
$this->assign('displayPageHeaderLogo', $journal->getJournalPageHeaderLogo());
$this->assign('alternatePageHeader', $journal->getLocalizedSetting('journalPageHeader'));
$this->assign('metaSearchDescription', $journal->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $journal->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $journal->getLocalizedSetting('customHeaders'));
$this->assign('numPageLinks', $journal->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $journal->getSetting('itemsPerPage'));
$this->assign('enableAnnouncements', $journal->getSetting('enableAnnouncements'));
// Load and apply theme plugin, if chosen
$themePluginPath = $journal->getSetting('journalTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Assign stylesheets and footer
$journalStyleSheet = $journal->getSetting('journalStyleSheet');
if ($journalStyleSheet) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . PublicFileManager::getJournalFilesPath($journal->getJournalId()) . '/' . $journalStyleSheet['uploadName']);
}
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$this->assign('journalPaymentsEnabled', $paymentManager->isConfigured());
$this->assign('pageFooter', $journal->getLocalizedSetting('journalPageFooter'));
} else {
// Add the site-wide logo, if set for this locale or the primary locale
$this->assign('displayPageHeaderTitle', $site->getSitePageHeaderTitle());
$this->assign('siteTitle', $site->getSiteTitle());
}
if (!$site->getRedirect()) {
$this->assign('hasOtherJournals', true);
}
}
}
示例12: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
*/
function TemplateManager()
{
parent::PKPTemplateManager();
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$conference =& Request::getConference();
$schedConf =& Request::getSchedConf();
$site =& Request::getSite();
if (isset($schedConf)) {
$this->assign('schedConfAcronym', $schedConf->getLocalizedSetting('acronym'));
}
$this->assign('siteTitle', $site->getLocalizedTitle());
$siteFilesDir = Request::getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('homeContext', array('conference' => 'index', 'schedConf' => 'index'));
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . $siteStyleFilename);
}
if (isset($conference)) {
$schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
$archivedSchedConfsExist = $schedConfDao->archivedSchedConfsExist($conference->getId());
$currentSchedConfsExist = $schedConfDao->currentSchedConfsExist($conference->getId());
$this->assign('archivedSchedConfsExist', $archivedSchedConfsExist);
$this->assign('currentSchedConfsExist', $currentSchedConfsExist);
$this->assign_by_ref('currentConference', $conference);
$conferenceTitle = $conference->getConferenceTitle();
$this->assign('numPageLinks', $conference->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $conference->getSetting('itemsPerPage'));
// Load and apply theme plugin, if chosen
$themePluginPath = $conference->getSetting('conferenceTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Assign additional navigation bar items
$navMenuItems =& $conference->getLocalizedSetting('navItems');
$this->assign_by_ref('navMenuItems', $navMenuItems);
$this->assign('publicFilesDir', Request::getBaseUrl() . '/' . PublicFileManager::getConferenceFilesPath($conference->getId()));
$this->assign('displayPageHeaderTitle', $conference->getPageHeaderTitle());
$this->assign('displayPageHeaderSubTitle', $conference->getLocalizedSetting('homeHeaderSubTitle'));
$this->assign('displayPageHeaderLogo', $conference->getPageHeaderLogo());
$this->assign('displayPageHeaderTitleAltText', $conference->getLocalizedSetting('pageHeaderTitleImageAltText'));
$this->assign('displayPageHeaderLogoAltText', $conference->getLocalizedSetting('pageHeaderLogoImageAltText'));
$this->assign('displayFavicon', $conference->getLocalizedFavicon());
$this->assign('faviconDir', Request::getBaseUrl() . '/' . PublicFileManager::getConferenceFilesPath($conference->getId()));
$this->assign('alternatePageHeader', $conference->getLocalizedSetting('conferencePageHeader'));
$this->assign('metaSearchDescription', $conference->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $conference->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $conference->getLocalizedSetting('customHeaders'));
$this->assign('enableAnnouncements', $conference->getSetting('enableAnnouncements'));
$this->assign('pageFooter', $conference->getLocalizedSetting('conferencePageFooter'));
$this->assign('displayCreativeCommons', $conference->getSetting('postCreativeCommons'));
$this->assign('analyticsTrackingID', $conference->getSetting('analyticsTrackingID'));
$this->assign('currentConferenceHome', Request::url(null, $conference->getSetting("path"), 'index'));
if (isset($schedConf)) {
// This will be needed if inheriting public conference files from the scheduled conference.
$this->assign('publicSchedConfFilesDir', Request::getBaseUrl() . '/' . PublicFileManager::getSchedConfFilesPath($schedConf->getId()));
$this->assign('primaryLocale', $conference->getSetting('primaryLocale'));
$this->assign('alternateLocales', $conference->getPrimaryLocale());
$this->assign_by_ref('currentSchedConf', $schedConf);
// Assign common sched conf vars:
$currentTime = time();
$submissionsCloseDate = $schedConf->getSetting('submissionsCloseDate');
$this->assign('submissionsCloseDate', $submissionsCloseDate);
// ------------------------------------
$navMenuItemOrder = array();
$navMenuItemNavOrder = array();
$this->assign('schedConfPostOverview', $schedConf->getSetting('postOverview'));
$this->assign('schedConfPostOverviewOrder', $schedConf->getSetting('postOverviewOrder'));
$this->_addNavMenuItemOrder($schedConf, $navMenuItemOrder, 'Overview');
$this->_addNavMenuItemNavOrder($schedConf, $navMenuItemNavOrder, 'Overview');
$this->assign('schedConfPostAnnouncement', $schedConf->getSetting('postAnnouncement'));
$this->assign('schedConfPostAnnouncementOrder', $schedConf->getSetting('postAnnouncementOrder'));
$this->_addNavMenuItemOrder($schedConf, $navMenuItemOrder, 'Announcement');
$this->_addNavMenuItemNavOrder($schedConf, $navMenuItemNavOrder, 'Announcement');
$this->assign('schedConfPostTimeline', $schedConf->getSetting('postTimeline'));
$this->assign('schedConfPostTimelineOrder', $schedConf->getSetting('postTimelineOrder'));
$this->_addNavMenuItemOrder($schedConf, $navMenuItemOrder, 'Timeline');
$this->_addNavMenuItemNavOrder($schedConf, $navMenuItemNavOrder, 'Timeline');
// CFP displayed
$showCFPDate = $schedConf->getSetting('showCFPDate');
$postCFP = $schedConf->getSetting('postCFP');
if ($postCFP && $showCFPDate && $submissionsCloseDate && $currentTime > $showCFPDate && $currentTime < $submissionsCloseDate) {
$this->assign('schedConfShowCFP', true);
$this->assign('schedConfShowCFPOrder', $schedConf->getSetting('postCFPOrder'));
$this->_addNavMenuItemOrder($schedConf, $navMenuItemOrder, 'CFP');
$this->_addNavMenuItemNavOrder($schedConf, $navMenuItemNavOrder, 'CFP');
}
//.........这里部分代码省略.........
示例13: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
* @param $request PKPRequest
*/
function TemplateManager($request = null)
{
parent::PKPTemplateManager($request);
// Retrieve the router
$router = $this->request->getRouter();
assert(is_a($router, 'PKPRouter'));
// Are we using implicit authentication?
$this->assign('implicitAuth', Config::getVar('security', 'implicit_auth'));
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$context = $router->getContext($this->request);
$site = $this->request->getSite();
$publicFileManager = new PublicFileManager();
$siteFilesDir = $this->request->getBaseUrl() . '/' . $publicFileManager->getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
// May be overridden by journal
$siteStyleFilename = $publicFileManager->getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet($this->request->getBaseUrl() . '/' . $siteStyleFilename);
}
$this->assign('siteCategoriesEnabled', $site->getSetting('categoriesEnabled'));
if (isset($context)) {
$this->assign('currentJournal', $context);
$this->assign('siteTitle', $context->getLocalizedName());
$this->assign('publicFilesDir', $this->request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()));
$this->assign('primaryLocale', $context->getPrimaryLocale());
$this->assign('alternateLocales', $context->getSetting('alternateLocales'));
// Assign page header
$this->assign('displayPageHeaderTitle', $context->getLocalizedPageHeaderTitle());
$this->assign('displayPageHeaderLogo', $context->getLocalizedPageHeaderLogo());
$this->assign('displayPageHeaderTitleAltText', $context->getLocalizedSetting('pageHeaderTitleImageAltText'));
$this->assign('displayPageHeaderLogoAltText', $context->getLocalizedSetting('pageHeaderLogoImageAltText'));
$this->assign('displayFavicon', $context->getLocalizedFavicon());
$this->assign('faviconDir', $this->request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()));
$this->assign('alternatePageHeader', $context->getLocalizedSetting('journalPageHeader'));
$this->assign('metaSearchDescription', $context->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $context->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $context->getLocalizedSetting('customHeaders'));
$this->assign('numPageLinks', $context->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $context->getSetting('itemsPerPage'));
$this->assign('enableAnnouncements', $context->getSetting('enableAnnouncements'));
$this->assign('hideRegisterLink', !$context->getSetting('allowRegReviewer') && !$context->getSetting('allowRegReader') && !$context->getSetting('allowRegAuthor'));
// Assign stylesheets and footer
$contextStyleSheet = $context->getSetting('journalStyleSheet');
if ($contextStyleSheet) {
$this->addStyleSheet($this->request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()) . '/' . $contextStyleSheet['uploadName']);
}
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($this->request);
$this->assign('journalPaymentsEnabled', $paymentManager->isConfigured());
// Include footer links if they have been defined.
$footerCategoryDao = DAORegistry::getDAO('FooterCategoryDAO');
$footerCategories = $footerCategoryDao->getNotEmptyByContextId($context->getId());
$this->assign('footerCategories', $footerCategories->toArray());
$footerLinkDao = DAORegistry::getDAO('FooterLinkDAO');
$this->assign('maxLinks', $footerLinkDao->getLargestCategoryTotalbyContextId($context->getId()));
$this->assign('pageFooter', $context->getLocalizedSetting('journalPageFooter'));
} else {
// Add the site-wide logo, if set for this locale or the primary locale
$displayPageHeaderTitle = $site->getLocalizedPageHeaderTitle();
$this->assign('displayPageHeaderTitle', $displayPageHeaderTitle);
if (isset($displayPageHeaderTitle['altText'])) {
$this->assign('displayPageHeaderTitleAltText', $displayPageHeaderTitle['altText']);
}
$this->assign('siteTitle', $site->getLocalizedTitle());
// Load and apply theme plugin, if chosen
$themePluginPath = $site->getSetting('siteTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
}
if (!$site->getRedirect()) {
$this->assign('hasOtherJournals', true);
}
}
}
示例14: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
*/
function TemplateManager()
{
parent::Smarty();
import('file.PublicFileManager');
import('cache.CacheManager');
// Set up Smarty configuration
$baseDir = Core::getBaseDir();
$cachePath = CacheManager::getFileCachePath();
$this->template_dir = $baseDir . DIRECTORY_SEPARATOR . 'templates';
$this->compile_dir = $cachePath . DIRECTORY_SEPARATOR . 't_compile';
$this->config_dir = $cachePath . DIRECTORY_SEPARATOR . 't_config';
$this->cache_dir = $cachePath . DIRECTORY_SEPARATOR . 't_cache';
// Assign common variables
$this->styleSheets = array();
$this->assign_by_ref('stylesheets', $this->styleSheets);
$this->cacheability = CACHEABILITY_NO_STORE;
// Safe default
$this->assign('defaultCharset', Config::getVar('i18n', 'client_charset'));
$this->assign('baseUrl', Request::getBaseUrl());
$this->assign('pageTitle', 'common.openJournalSystems');
$this->assign('requestedPage', Request::getRequestedPage());
$this->assign('currentUrl', Request::getCompleteUrl());
$this->assign('dateFormatTrunc', Config::getVar('general', 'date_format_trunc'));
$this->assign('dateFormatShort', Config::getVar('general', 'date_format_short'));
$this->assign('dateFormatLong', Config::getVar('general', 'date_format_long'));
$this->assign('datetimeFormatShort', Config::getVar('general', 'datetime_format_short'));
$this->assign('datetimeFormatLong', Config::getVar('general', 'datetime_format_long'));
// Are we using implicit authentication?
$this->assign('implicitAuth', Config::getVar('security', 'implicit_auth'));
$locale = Locale::getLocale();
$this->assign('currentLocale', $locale);
if (!defined('SESSION_DISABLE_INIT')) {
/* Kludge to make sure no code that tries to connect to the database is executed
* (e.g., when loading installer pages). */
$this->assign('isUserLoggedIn', Validation::isLoggedIn());
$journal =& Request::getJournal();
$site =& Request::getSite();
$versionDAO =& DAORegistry::getDAO('VersionDAO');
$currentVersion = $versionDAO->getCurrentVersion();
$this->assign('currentVersionString', $currentVersion->getVersionString());
$siteFilesDir = Request::getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
// May be overridden by journal
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . $siteStyleFilename);
}
if (isset($journal)) {
$this->assign_by_ref('currentJournal', $journal);
$journalTitle = $journal->getJournalTitle();
$this->assign('siteTitle', $journalTitle);
$this->assign('publicFilesDir', Request::getBaseUrl() . '/' . PublicFileManager::getJournalFilesPath($journal->getJournalId()));
$this->assign('primaryLocale', $journal->getPrimaryLocale());
$this->assign('alternateLocales', $journal->getSetting('alternateLocales'));
// Assign additional navigation bar items
$navMenuItems =& $journal->getLocalizedSetting('navItems');
$this->assign_by_ref('navMenuItems', $navMenuItems);
// Assign journal page header
$this->assign('displayPageHeaderTitle', $journal->getJournalPageHeaderTitle());
$this->assign('displayPageHeaderLogo', $journal->getJournalPageHeaderLogo());
$this->assign('alternatePageHeader', $journal->getLocalizedSetting('journalPageHeader'));
$this->assign('metaSearchDescription', $journal->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $journal->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $journal->getLocalizedSetting('customHeaders'));
$this->assign('numPageLinks', $journal->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $journal->getSetting('itemsPerPage'));
$this->assign('enableAnnouncements', $journal->getSetting('enableAnnouncements'));
// Load and apply theme plugin, if chosen
$themePluginPath = $journal->getSetting('journalTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Assign stylesheets and footer
$journalStyleSheet = $journal->getSetting('journalStyleSheet');
if ($journalStyleSheet) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . PublicFileManager::getJournalFilesPath($journal->getJournalId()) . '/' . $journalStyleSheet['uploadName']);
}
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$this->assign('journalPaymentsEnabled', $paymentManager->isConfigured());
$this->assign('pageFooter', $journal->getLocalizedSetting('journalPageFooter'));
} else {
// Add the site-wide logo, if set for this locale or the primary locale
$this->assign('displayPageHeaderTitle', $site->getSitePageHeaderTitle());
$this->assign('siteTitle', $site->getSiteTitle());
$this->assign('itemsPerPage', Config::getVar('interface', 'items_per_page'));
$this->assign('numPageLinks', Config::getVar('interface', 'page_links'));
}
if (!$site->getJournalRedirect()) {
$this->assign('hasOtherJournals', true);
}
//.........这里部分代码省略.........