forked from bozana/usageStats
-
Notifications
You must be signed in to change notification settings - Fork 34
/
UsageStatsOptoutBlockPlugin.inc.php
97 lines (81 loc) · 1.94 KB
/
UsageStatsOptoutBlockPlugin.inc.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* @file plugins/generic/usageStats/UsageStatsOptoutBlockPlugin.inc.php
*
* Copyright (c) 2013-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class UsageStatsOptoutBlockPlugin
* @ingroup plugins_generic_usageStats
*
* @brief Opt-out component.
*/
import('lib.pkp.classes.plugins.BlockPlugin');
class UsageStatsOptoutBlockPlugin extends BlockPlugin {
/** @var UsageStatsPlugin */
protected $_usageStatsPlugin;
/**
* Constructor
* @param $usageStatsPlugin UsageStatsPlugin
*/
function __construct($usageStatsPlugin) {
$this->_usageStatsPlugin = $usageStatsPlugin;
parent::__construct();
}
/**
* @copydoc Plugin::getHideManagement()
*/
function getHideManagement() {
return true;
}
/**
* @copydoc Plugin::getName()
*/
function getName() {
return 'UsageStatsOptoutBlockPlugin';
}
/**
* @copydoc Plugin::getDisplayName()
*/
function getDisplayName() {
return __('plugins.generic.usageStats.optout.displayName');
}
/**
* @copydoc Plugin::getDescription()
*/
function getDescription() {
return __('plugins.generic.usageStats.optout.description');
}
/**
* @copydoc Plugin::isSitePlugin()
*/
function isSitePlugin() {
return false;
}
/**
* @copydoc Plugin::getPluginPath()
*/
public function getPluginPath() {
return $this->_usageStatsPlugin->getPluginPath();
}
/**
* @copydoc BlockPlugin::getEnabled()
*/
function getEnabled($contextId = null) {
return $this->_usageStatsPlugin->getEnabled($contextId);
}
/**
* @copydoc BlockPlugin::getContents()
*/
function getContents($templateMgr, $request = null) {
return $templateMgr->fetch($this->getTemplateResource($this->getBlockTemplateFilename()));
}
/**
* copydoc BlockPlugin::getBlockTemplateFilename()
*/
function getBlockTemplateFilename() {
// Return the opt-out template.
return 'optoutBlock.tpl';
}
}