Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
InformationHandler.inc.php
1 <?php
2 
16 import('classes.handler.Handler');
17 
18 class InformationHandler extends Handler {
22  function InformationHandler() {
23  parent::Handler();
24  }
25 
31  function index($args, $request) {
32  $this->validate();
33  $press = $request->getPress();
34  if ($press == null) $request->redirect('index');
35 
36  $this->setupTemplate($request, $press);
37 
38  $contentOnly = $request->getUserVar('contentOnly');
39 
40  switch(array_shift($args)) {
41  case 'readers':
42  $content = $press->getLocalizedSetting('readerInformation');
43  $pageTitle = 'navigation.infoForReaders.long';
44  $pageCrumbTitle = 'navigation.infoForReaders';
45  break;
46  case 'authors':
47  $content = $press->getLocalizedSetting('authorInformation');
48  $pageTitle = 'navigation.infoForAuthors.long';
49  $pageCrumbTitle = 'navigation.infoForAuthors';
50  break;
51  case 'librarians':
52  $content = $press->getLocalizedSetting('librarianInformation');
53  $pageTitle = 'navigation.infoForLibrarians.long';
54  $pageCrumbTitle = 'navigation.infoForLibrarians';
55  break;
56  case 'competingInterestPolicy':
57  $content = $press->getLocalizedSetting('competingInterestPolicy');
58  $pageTitle = $pageCrumbTitle = 'navigation.competingInterestPolicy';
59  break;
60  case 'sampleCopyrightWording':
61  $content = __('manager.setup.authorCopyrightNotice.sample');
62  $pageTitle = $pageCrumbTitle = 'manager.setup.copyrightNotice';
63  break;
64  default:
65  $request->redirect($press->getPath());
66  return;
67  }
68 
69  $templateMgr = TemplateManager::getManager($request);
70  $templateMgr->assign('pageCrumbTitle', $pageCrumbTitle);
71  $templateMgr->assign('pageTitle', $pageTitle);
72  $templateMgr->assign('content', $content);
73  $templateMgr->assign('contentOnly', $contentOnly); // Hide the header and footer code
74 
75  $templateMgr->display('information/information.tpl');
76  }
77 
78  function readers($args, $request) {
79  $this->index(array('readers'), $request);
80  }
81 
82  function authors($args, $request) {
83  $this->index(array('authors'), $request);
84  }
85 
86  function librarians($args, $request) {
87  $this->index(array('librarians'), $request);
88  }
89 
90  function competingInterestPolicy($args, $request) {
91  return $this->index(array('competingInterestPolicy'), $request);
92  }
93 
94  function sampleCopyrightWording($args, $request) {
95  $this->index(array('sampleCopyrightWording'), $request);
96  }
97 
102  function setupTemplate($request, $press) {
103  parent::setupTemplate($request);
104  AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER); // FIXME needed?
105  if (!$press->getSetting('restrictSiteAccess')) {
106  $templateMgr = TemplateManager::getManager($request);
107  $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
108  }
109  }
110 }
111 
112 ?>
Display press information.
static requireComponents()
validate($requiredContexts=null, $request=null)
Base request handler application class.
Definition: Handler.inc.php:20
setupTemplate($request, $press)