-
Notifications
You must be signed in to change notification settings - Fork 1
/
AuthorsIndexPlugin.php
45 lines (36 loc) · 1.08 KB
/
AuthorsIndexPlugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace APP\plugins\generic\authorsIndex;
use PKP\plugins\Hook;
use PKP\plugins\GenericPlugin;
use APP\core\Application;
class AuthorsIndexPlugin extends GenericPlugin
{
public function register($category, $path, $mainContextId = null)
{
$success = parent::register($category, $path, $mainContextId);
if (Application::isUnderMaintenance()) {
return $success;
}
if ($success && $this->getEnabled($mainContextId)) {
Hook::add('LoadHandler', [$this, 'addAuthorsHandler']);
}
return $success;
}
public function getDisplayName()
{
return __('plugins.generic.authorsIndex.displayName');
}
public function getDescription()
{
return __('plugins.generic.authorsIndex.description');
}
public function addAuthorsHandler($hookName, $params)
{
$page = $params[0];
if ($page == 'authors') {
define('HANDLER_CLASS', 'APP\plugins\generic\authorsIndex\pages\authors\AuthorsHandler');
return true;
}
return false;
}
}