00001 <?php
00002
00015 import('classes.handler.Handler');
00016
00017 class InformationHandler extends Handler {
00021 function InformationHandler() {
00022 parent::Handler();
00023 }
00024
00030 function index($args, &$request) {
00031 $this->validate();
00032 $this->setupTemplate($request);
00033 $press = $request->getPress();
00034 $contentOnly = $request->getUserVar('contentOnly');
00035
00036 if ($press == null) {
00037 $request->redirect('index');
00038 return;
00039 }
00040
00041 switch(isset($args[0])?$args[0]:null) {
00042 case 'readers':
00043 $content = $press->getLocalizedSetting('readerInformation');
00044 $pageTitle = 'navigation.infoForReaders.long';
00045 $pageCrumbTitle = 'navigation.infoForReaders';
00046 break;
00047 case 'authors':
00048 $content = $press->getLocalizedSetting('authorInformation');
00049 $pageTitle = 'navigation.infoForAuthors.long';
00050 $pageCrumbTitle = 'navigation.infoForAuthors';
00051 break;
00052 case 'librarians':
00053 $content = $press->getLocalizedSetting('librarianInformation');
00054 $pageTitle = 'navigation.infoForLibrarians.long';
00055 $pageCrumbTitle = 'navigation.infoForLibrarians';
00056 break;
00057 case 'competingInterestPolicy':
00058 $content = $press->getLocalizedSetting('competingInterestPolicy');
00059 $pageTitle = $pageCrumbTitle = 'navigation.competingInterestPolicy';
00060 break;
00061 case 'sampleCopyrightWording':
00062 $content = __('manager.setup.authorCopyrightNotice.sample');
00063 $pageTitle = $pageCrumbTitle = 'manager.setup.copyrightNotice';
00064 break;
00065 default:
00066 $request->redirect($press->getPath());
00067 return;
00068 }
00069
00070 $templateMgr =& TemplateManager::getManager();
00071 $templateMgr->assign('pageCrumbTitle', $pageCrumbTitle);
00072 $templateMgr->assign('pageTitle', $pageTitle);
00073 $templateMgr->assign('content', $content);
00074 $templateMgr->assign('contentOnly', $contentOnly);
00075
00076 $templateMgr->display('information/information.tpl');
00077 }
00078
00079 function readers($args, &$request) {
00080 $this->index(array('readers'), $request);
00081 }
00082
00083 function authors($args, &$request) {
00084 $this->index(array('authors'), $request);
00085 }
00086
00087 function librarians($args, &$request) {
00088 $this->index(array('librarians'), $request);
00089 }
00090
00091 function competingInterestPolicy($args, &$request) {
00092 return $this->index(array('competingInterestPolicy'), $request);
00093 }
00094
00095 function sampleCopyrightWording($args, &$request) {
00096 $this->index(array('sampleCopyrightWording'), $request);
00097 }
00098
00103 function setupTemplate($request) {
00104 $press =& $request->getPress();
00105 AppLocale::requireComponents(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_MANAGER);
00106 $templateMgr =& TemplateManager::getManager();
00107 if (!$press || !$press->getSetting('restrictSiteAccess')) {
00108 $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
00109 }
00110 }
00111 }
00112
00113 ?>