blob: 7664b84124a588f33e5b5f4a128fd65eeec4ed3a (
plain)
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
|
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CoreHome\SystemSummary;
/**
* This class can be used to add a new entry / item to the system summary widget.
*
* @api
*/
class Item
{
private $key;
private $label;
private $value;
private $urlParams;
private $icon;
private $order;
/**
* Item constructor.
* @param string $key The key or ID for this item. The entry in the widget will have this class so it is possible
* to style it individually and other plugins can use this key to for example remove this item
* from the list of system summary items.
* @param string $label The label that will be displayed for this item. The label may already include the value such as "5 segments"
* @param string|null $value Optional label. If given, the value will be displayed after the label separated by a colon, eg: "Segments: 5"
* @param array|null $urlParams Optional URL to make the item clickable. Accepts an array of URL parameters that need to be modfified.
* @param string $icon Optional icon css class, eg "icon-user".
* @param int $order Optional sort order. The lower the value, the higher up the entry will be shown
*/
public function __construct($key, $label, $value = null, $urlParams = null, $icon = '', $order = 99)
{
$this->key = $key;
$this->label = $label;
$this->value = $value;
$this->urlParams = $urlParams;
$this->icon = $icon;
$this->order = $order;
}
/**
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* @return mixed
*/
public function getValue()
{
return $this->value;
}
/**
* @return array|null
*/
public function getUrlParams()
{
return $this->urlParams;
}
/**
* @return string
*/
public function getIcon()
{
return $this->icon;
}
/**
* @return int
*/
public function getOrder()
{
return $this->order;
}
}
|