isConfigured() public method

Determine whether the payment system is configured.
public isConfigured ( ) : boolean
return boolean true iff configured
示例#1
0
 /**
  * Display about index page.
  * @param $args array
  * @param $request PKPRequest
  */
 function index($args, &$request)
 {
     $this->validate();
     $this->setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $journalDao =& DAORegistry::getDAO('JournalDAO');
     $journalPath = $request->getRequestedJournalPath();
     if ($journalPath != 'index' && $journalDao->journalExistsByPath($journalPath)) {
         $journal =& $request->getJournal();
         $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
         $templateMgr->assign_by_ref('journalSettings', $journalSettingsDao->getJournalSettings($journal->getId()));
         $customAboutItems =& $journalSettingsDao->getSetting($journal->getId(), 'customAboutItems');
         if (isset($customAboutItems[AppLocale::getLocale()])) {
             $templateMgr->assign('customAboutItems', $customAboutItems[AppLocale::getLocale()]);
         } elseif (isset($customAboutItems[AppLocale::getPrimaryLocale()])) {
             $templateMgr->assign('customAboutItems', $customAboutItems[AppLocale::getPrimaryLocale()]);
         }
         foreach ($this->_getPublicStatisticsNames() as $name) {
             if ($journal->getSetting($name)) {
                 $templateMgr->assign('publicStatisticsEnabled', true);
                 break;
             }
         }
         // Hide membership if the payment method is not configured
         import('classes.payment.ojs.OJSPaymentManager');
         $paymentManager = new OJSPaymentManager($request);
         $templateMgr->assign('paymentConfigured', $paymentManager->isConfigured());
         if ($journal->getSetting('boardEnabled')) {
             $groupDao =& DAORegistry::getDAO('GroupDAO');
             $groups =& $groupDao->getGroups(ASSOC_TYPE_JOURNAL, $journal->getId(), GROUP_CONTEXT_PEOPLE);
             $templateMgr->assign_by_ref('peopleGroups', $groups);
         }
         $templateMgr->assign('helpTopicId', 'user.about');
         $templateMgr->display('about/index.tpl');
     } else {
         $site =& $request->getSite();
         $about = $site->getLocalizedAbout();
         $templateMgr->assign('about', $about);
         $journals =& $journalDao->getJournals(true);
         $templateMgr->assign_by_ref('journals', $journals);
         $templateMgr->display('about/site.tpl');
     }
 }
示例#2
0
 /**
  * Constructor.
  * Initialize template engine and assign basic template variables.
  * @param $request PKPRequest
  */
 function TemplateManager($request)
 {
     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).
          */
         $context = $request->getContext();
         $site = $request->getSite();
         $publicFileManager = new PublicFileManager();
         $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, STYLE_SEQUENCE_LAST);
         }
         $this->assign('siteCategoriesEnabled', $site->getSetting('categoriesEnabled'));
         if (isset($context)) {
             $this->assign('currentJournal', $context);
             $this->assign('siteTitle', $context->getLocalizedName());
             $this->assign('publicFilesDir', $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('displayPageHeaderLogoAltText', $context->getLocalizedSetting('pageHeaderLogoImageAltText'));
             $this->assign('displayFavicon', $context->getLocalizedFavicon());
             $this->assign('faviconDir', $request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()));
             $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('contextSettings', $context->getSettingsDAO()->getSettings($context->getId()));
             // Assign stylesheets and footer
             $contextStyleSheet = $context->getSetting('journalStyleSheet');
             if ($contextStyleSheet) {
                 $this->addStyleSheet($request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()) . '/' . $contextStyleSheet['uploadName'], STYLE_SEQUENCE_LAST);
             }
             // Get a link to the settings page for the current context.
             // This allows us to reduce template duplication by using this
             // variable in templates/common/header.tpl, instead of
             // reproducing a lot of OMP/OJS-specific logic there.
             $router = $request->getRouter();
             $dispatcher = $request->getDispatcher();
             $this->assign('contextSettingsUrl', $dispatcher->url($request, ROUTE_PAGE, null, 'management', 'settings', 'journal'));
             import('classes.payment.ojs.OJSPaymentManager');
             $paymentManager = new OJSPaymentManager($request);
             $this->assign('journalPaymentsEnabled', $paymentManager->isConfigured());
             $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());
             $this->assign('primaryLocale', $site->getPrimaryLocale());
         }
     }
 }
 /**
  * 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');
         }
     }
 }
示例#4
0
 /**
  * Constructor.
  * Initialize template engine and assign basic template variables.
  * @param $request PKPRequest
  */
 function TemplateManager($request)
 {
     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).
          */
         $context = $request->getContext();
         $site = $request->getSite();
         $publicFileManager = new PublicFileManager();
         $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, STYLE_SEQUENCE_LAST);
         }
         $this->assign('siteCategoriesEnabled', $site->getSetting('categoriesEnabled'));
         if (isset($context)) {
             $this->assign('currentJournal', $context);
             $this->assign('siteTitle', $context->getLocalizedName());
             $this->assign('publicFilesDir', $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', $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'));
             // Assign stylesheets and footer
             $contextStyleSheet = $context->getSetting('journalStyleSheet');
             if ($contextStyleSheet) {
                 $this->addStyleSheet($request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()) . '/' . $contextStyleSheet['uploadName'], STYLE_SEQUENCE_LAST);
             }
             import('classes.payment.ojs.OJSPaymentManager');
             $paymentManager = new OJSPaymentManager($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());
             $this->assign('primaryLocale', $site->getPrimaryLocale());
         }
     }
 }
示例#5
0
 /**
  * Display journal author index page.
  * @param $args array
  * @param $request PKPRequest
  */
 function index($args, $request)
 {
     $this->validate($request);
     $this->setupTemplate($request);
     $journal =& $request->getJournal();
     $user =& $request->getUser();
     $rangeInfo =& $this->getRangeInfo('submissions');
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $page = array_shift($args);
     switch ($page) {
         case 'completed':
             $active = false;
             break;
         default:
             $page = 'active';
             $active = true;
     }
     $sort = $request->getUserVar('sort');
     $sort = isset($sort) ? $sort : 'title';
     $sortDirection = $request->getUserVar('sortDirection');
     $sortDirection = isset($sortDirection) && ($sortDirection == SORT_DIRECTION_ASC || $sortDirection == SORT_DIRECTION_DESC) ? $sortDirection : SORT_DIRECTION_ASC;
     if ($sort == 'status') {
         // FIXME Does not pass $rangeInfo else we only get partial results
         $unsortedSubmissions = $authorSubmissionDao->getAuthorSubmissions($user->getId(), $journal->getId(), $active, null, $sort, $sortDirection);
         // Sort all submissions by status, which is too complex to do in the DB
         $submissionsArray = $unsortedSubmissions->toArray();
         $compare = create_function('$s1, $s2', 'return strcmp($s1->getSubmissionStatus(), $s2->getSubmissionStatus());');
         usort($submissionsArray, $compare);
         if ($sortDirection == SORT_DIRECTION_DESC) {
             $submissionsArray = array_reverse($submissionsArray);
         }
         // Convert submission array back to an ItemIterator class
         import('lib.pkp.classes.core.ArrayItemIterator');
         $submissions =& ArrayItemIterator::fromRangeInfo($submissionsArray, $rangeInfo);
     } else {
         $submissions = $authorSubmissionDao->getAuthorSubmissions($user->getId(), $journal->getId(), $active, $rangeInfo, $sort, $sortDirection);
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageToDisplay', $page);
     if (!$active) {
         // Make view counts available if enabled.
         $templateMgr->assign('statViews', $journal->getSetting('statViews'));
     }
     $templateMgr->assign_by_ref('submissions', $submissions);
     // assign payment
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     if ($paymentManager->isConfigured()) {
         $templateMgr->assign('submissionEnabled', $paymentManager->submissionEnabled());
         $templateMgr->assign('fastTrackEnabled', $paymentManager->fastTrackEnabled());
         $templateMgr->assign('publicationEnabled', $paymentManager->publicationEnabled());
         $completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
         $templateMgr->assign_by_ref('completedPaymentDAO', $completedPaymentDAO);
     }
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
     $templateMgr->assign('helpTopicId', 'editorial.authorsRole.submissions');
     $templateMgr->assign('sort', $sort);
     $templateMgr->assign('sortDirection', $sortDirection);
     $templateMgr->display('author/index.tpl');
 }
示例#6
0
 /**
  * Constructor.
  * Initialize template engine and assign basic template variables.
  * @param $request PKPRequest
  */
 function __construct($request)
 {
     parent::__construct($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).
          */
         $context = $request->getContext();
         $site = $request->getSite();
         $publicFileManager = new PublicFileManager();
         $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('siteStylesheet', $request->getBaseUrl() . '/' . $siteStyleFilename, array('priority' => STYLE_SEQUENCE_LATE));
         }
         // Pass app-specific details to template
         $this->assign(array('brandImage' => 'templates/images/ojs_brand.png', 'packageKey' => 'common.openJournalSystems', 'pkpLink' => 'http://pkp.sfu.ca/ojs'));
         // Get a count of unread tasks.
         if ($user = $request->getUser()) {
             $notificationDao = DAORegistry::getDAO('NotificationDAO');
             // Exclude certain tasks, defined in the notifications grid handler
             import('lib.pkp.controllers.grid.notifications.TaskNotificationsGridHandler');
             $this->assign('unreadNotificationCount', $notificationDao->getNotificationCount(false, $user->getId(), null, NOTIFICATION_LEVEL_TASK));
         }
         if (isset($context)) {
             $this->assign(array('currentJournal' => $context, 'siteTitle' => $context->getLocalizedName(), 'publicFilesDir' => $request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()), 'primaryLocale' => $context->getPrimaryLocale(), 'supportedLocales' => $context->getSupportedLocaleNames(), 'displayPageHeaderTitle' => $context->getLocalizedPageHeaderTitle(), 'displayPageHeaderLogo' => $context->getLocalizedPageHeaderLogo(), 'displayPageHeaderLogoAltText' => $context->getLocalizedSetting('pageHeaderLogoImageAltText'), 'numPageLinks' => $context->getSetting('numPageLinks'), 'itemsPerPage' => $context->getSetting('itemsPerPage'), 'enableAnnouncements' => $context->getSetting('enableAnnouncements'), 'contextSettings' => $context->getSettingsDAO()->getSettings($context->getId()), 'disableUserReg' => $context->getSetting('disableUserReg')));
             // Assign meta tags
             $favicon = $context->getLocalizedFavicon();
             if (!empty($favicon)) {
                 $faviconDir = $request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId());
                 $this->addHeader('favicon', '<link rel="icon" href="' . $faviconDir . '/' . $favicon['uploadName'] . '">');
             }
             // Assign stylesheets and footer
             $contextStyleSheet = $context->getSetting('styleSheet');
             if ($contextStyleSheet) {
                 $this->addStyleSheet('contextStylesheet', $request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($context->getId()) . '/' . $contextStyleSheet['uploadName'], array('priority' => STYLE_SEQUENCE_LATE));
             }
             // Get a link to the settings page for the current context.
             // This allows us to reduce template duplication by using this
             // variable in templates/common/header.tpl, instead of
             // reproducing a lot of OMP/OJS-specific logic there.
             $dispatcher = $request->getDispatcher();
             $this->assign('contextSettingsUrl', $dispatcher->url($request, ROUTE_PAGE, null, 'management', 'settings', 'journal'));
             import('classes.payment.ojs.OJSPaymentManager');
             $paymentManager = new OJSPaymentManager($request);
             $this->assign('journalPaymentsEnabled', $paymentManager->isConfigured());
             $this->assign('pageFooter', $context->getLocalizedSetting('pageFooter'));
         } else {
             // Check if registration is open for any contexts
             $contextDao = Application::getContextDAO();
             $contexts = $contextDao->getAll(true)->toArray();
             $contextsForRegistration = array();
             foreach ($contexts as $context) {
                 if (!$context->getSetting('disableUserReg')) {
                     $contextsForRegistration[] = $context;
                 }
             }
             $this->assign(array('contexts' => $contextsForRegistration, 'disableUserReg' => empty($contextsForRegistration), 'displayPageHeaderTitle' => $site->getLocalizedPageHeaderTitle(), 'displayPageHeaderLogo' => $site->getLocalizedSetting('pageHeaderTitleImage'), 'siteTitle' => $site->getLocalizedTitle(), 'primaryLocale' => $site->getPrimaryLocale(), 'supportedLocales' => $site->getSupportedLocaleNames(), 'pageFooter' => $site->getLocalizedSetting('pageFooter')));
         }
     }
 }
 /**
  * Display editorialPolicies page.
  * @param $args array
  * @param $request PKPRequest
  */
 function editorialPolicies($args, &$request)
 {
     $this->addCheck(new HandlerValidatorJournal($this));
     $this->validate();
     $this->setupTemplate(true);
     $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $journal =& Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     $sections =& $sectionDao->getJournalSections($journal->getId());
     $sections =& $sections->toArray();
     $templateMgr->assign_by_ref('sections', $sections);
     $sectionEditorEntriesBySection = array();
     foreach ($sections as $section) {
         $sectionEditorEntriesBySection[$section->getId()] =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $section->getId());
     }
     $templateMgr->assign_by_ref('sectionEditorEntriesBySection', $sectionEditorEntriesBySection);
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $templateMgr->assign('paymentConfigured', $paymentManager->isConfigured());
     $templateMgr->display('about/editorialPolicies.tpl');
 }
示例#8
0
 /**
  * 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);
         }
     }
 }