Open Preprint Systems
3.3.0
StatsHandler.inc.php
1
<?php
2
16
import
(
'lib.pkp.pages.stats.PKPStatsHandler'
);
17
18
class
StatsHandler
extends
PKPStatsHandler
{
22
public
function
__construct
() {
23
parent::__construct();
24
HookRegistry::register
(
'TemplateManager::display'
, array($this,
'addSectionFilters'
));
25
}
26
35
public
function
addSectionFilters
($hookName, $args) {
36
$templateMgr = $args[0];
37
$template = $args[1];
38
39
if
(!in_array($template, [
'stats/publications.tpl'
,
'stats/editorial.tpl'
])) {
40
return
;
41
}
42
43
$sectionFilters =
APP\components\listPanels\SubmissionsListPanel::getSectionFilters
();
44
45
if
(count($sectionFilters) < 2) {
46
return
;
47
}
48
49
$filters = $templateMgr->getState(
'filters'
);
50
if
(is_null($filters)) {
51
$filters = [];
52
}
53
$filters[] = [
54
'heading'
=> __(
'section.sections'
),
55
'filters'
=> $sectionFilters,
56
];
57
$templateMgr->setState([
58
'filters'
=> $filters
59
]);
60
}
61
}
StatsHandler\__construct
__construct()
Definition:
StatsHandler.inc.php:22
StatsHandler\addSectionFilters
addSectionFilters($hookName, $args)
Definition:
StatsHandler.inc.php:35
StatsHandler
Handle requests for statistics pages.
Definition:
StatsHandler.inc.php:18
APP\components\listPanels\SubmissionsListPanel\getSectionFilters
static getSectionFilters($activeOnly=false)
Definition:
SubmissionsListPanel.inc.php:63
PKPStatsHandler
Handle requests for statistics pages.
Definition:
PKPStatsHandler.inc.php:19
HookRegistry\register
static register($hookName, $callback, $hookSequence=HOOK_SEQUENCE_NORMAL)
Definition:
HookRegistry.inc.php:70
pages
stats
StatsHandler.inc.php
Generated on Fri Aug 28 2020 14:52:06 for Open Preprint Systems by
1.8.17