blob: 0c5b67696f66ed712ef168ff3ef3af8676100374 (
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
|
<?php
/* Icinga DB Web | (c) 2021 Icinga GmbH | GPLv2 */
namespace Icinga\Module\Icingadb\Hook;
use Icinga\Module\Icingadb\Common\Auth;
use Icinga\Module\Icingadb\Common\Database;
use Icinga\Module\Icingadb\Hook\Common\HookUtils;
use ipl\Html\ValidHtml;
use ipl\Orm\Model;
abstract class TabHook
{
use Auth;
use Database;
use HookUtils;
/**
* Get the tab's name
*
* The name is used to identify this hook later on. It must be unique.
* Multiple words in the name should be separated by dashes. (-)
*
* @return string
*/
abstract public function getName(): string;
/**
* Get the tab's label
*
* The label is shown on the tab and in the browser's title.
*
* @return string
*/
abstract public function getLabel(): string;
/**
* Get tab content for the given object
*
* @param Model $object
*
* @return ValidHtml[]
*/
abstract public function getContent(Model $object): array;
/**
* Get tab controls for the given object
*
* @param Model $object
*
* @return ValidHtml[]
*/
public function getControls(Model $object): array
{
return [];
}
/**
* Get tab footer for the given object
*
* @param Model $object
*
* @return ValidHtml[]
*/
public function getFooter(Model $object): array
{
return [];
}
/**
* Get whether this tab should be shown
*
* @param Model $object
*
* @return bool
*/
public function shouldBeShown(Model $object): bool
{
return true;
}
}
|