baseline
[omp.pkp.sfu.ca.git] / pages / admin / AdminHandler.inc.php
blob0e602a249aa9aad4710c7092346a7bbb82069a2f
1 <?php
3 /**
4 * @file pages/admin/AdminHandler.inc.php
6 * Copyright (c) 2003-2008 John Willinsky
7 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9 * @class AdminHandler
10 * @ingroup pages_admin
12 * @brief Handle requests for site administration functions.
15 // $Id: AdminHandler.inc.php,v 1.6 2009/05/12 20:12:44 asmecher Exp $
18 import('handler.Handler');
20 class AdminHandler extends Handler {
21 /**
22 * Constructor
24 function AdminHandler() {
25 parent::Handler();
27 $this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN)));
28 $this->addCheck(new HandlerValidatorCustom($this, true, null, null, create_function(null, 'return Request::getRequestedPressPath() == \'index\';')));
31 /**
32 * Display site admin index page.
34 function index() {
35 $this->validate();
36 $this->setupTemplate();
38 $templateMgr =& TemplateManager::getManager();
39 $templateMgr->assign('helpTopicId', 'site.index');
40 $templateMgr->display('admin/index.tpl');
43 /**
44 * Setup common template variables.
45 * @param $subclass boolean set to true if caller is below this handler in the hierarchy
47 function setupTemplate($subclass = false) {
48 parent::setupTemplate();
49 Locale::requireComponents(array(LOCALE_COMPONENT_PKP_ADMIN));
50 Locale::requireComponents(array(LOCALE_COMPONENT_OMP_MANAGER));
51 Locale::requireComponents(array(LOCALE_COMPONENT_OMP_ADMIN));
53 $templateMgr =& TemplateManager::getManager();
54 $templateMgr->assign('pageHierarchy',
55 $subclass ? array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'admin'), 'admin.siteAdmin'))
56 : array(array(Request::url(null, 'user'), 'navigation.user'))