-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReviewersControlReportPlugin.php
More file actions
54 lines (44 loc) · 1.53 KB
/
Copy pathReviewersControlReportPlugin.php
File metadata and controls
54 lines (44 loc) · 1.53 KB
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
46
47
48
49
50
51
52
53
54
<?php
namespace APP\plugins\generic\reviewersControlReport;
use APP\plugins\generic\reviewersControlReport\controllers\grid\ReviewersGridHandler;
use PKP\plugins\GenericPlugin;
use PKP\plugins\Hook;
use PKP\plugins\PluginRegistry;
class ReviewersControlReportPlugin extends GenericPlugin
{
public function register($category, $path, $mainContextId = null)
{
$success = parent::register($category, $path, $mainContextId);
if ($success && $this->getEnabled($mainContextId)) {
PluginRegistry::register('reports', $this->getReportPlugin(), $this->getPluginPath(), $mainContextId);
Hook::add('LoadComponentHandler', $this->setupGridHandler(...));
}
return $success;
}
public function getReportPlugin()
{
return new ReviewersControlReportReportPlugin();
}
public function getName(): string
{
return 'ReviewersControlReportPlugin';
}
public function getDisplayName(): string
{
return __('plugins.reports.reviewersControlReport.displayName');
}
public function getDescription(): string
{
return __('plugins.reports.reviewersControlReport.description');
}
public function setupGridHandler($hookName, $params)
{
$component = &$params[0];
if ($component == 'plugins.generic.reviewersControlReport.controllers.grid.ReviewersGridHandler') {
$handler = &$params[2];
$handler = new ReviewersGridHandler();
return true;
}
return false;
}
}