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.
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
{
24 function AdminHandler() {
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\';')));
32 * Display site admin index page.
36 $this->setupTemplate();
38 $templateMgr =& TemplateManager
::getManager();
39 $templateMgr->assign('helpTopicId', 'site.index');
40 $templateMgr->display('admin/index.tpl');
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'))