diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
commit | 8ca6cc32b2c789a3149861159ad258f2cb9491e3 (patch) | |
tree | 2492de6f1528dd44eaa169a5c1555026d9cb75ec /modules/monitoring/library/Monitoring/Hook/ObjectDetailsTabHook.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-a598b28402ead15d3701df32e198513e7b1f299c.tar.xz icingaweb2-a598b28402ead15d3701df32e198513e7b1f299c.zip |
Adding upstream version 2.11.4.upstream/2.11.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | modules/monitoring/library/Monitoring/Hook/ObjectDetailsTabHook.php | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/monitoring/library/Monitoring/Hook/ObjectDetailsTabHook.php b/modules/monitoring/library/Monitoring/Hook/ObjectDetailsTabHook.php new file mode 100644 index 0000000..15fa9bb --- /dev/null +++ b/modules/monitoring/library/Monitoring/Hook/ObjectDetailsTabHook.php @@ -0,0 +1,60 @@ +<?php +/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */ + +namespace Icinga\Module\Monitoring\Hook; + +use Icinga\Authentication\Auth; +use Icinga\Module\Monitoring\Object\MonitoredObject; +use Icinga\Web\Request; + +/** + * Base class for object host details custom tab hooks + */ +abstract class ObjectDetailsTabHook +{ + /** + * Return the tab name - it must be unique + * + * @return string + */ + abstract public function getName(); + + /** + * Return the tab label + * + * @return string + */ + abstract public function getLabel(); + + /** + * Return the tab header + * + * @param MonitoredObject $monitoredObject The monitored object related to that page + * @param Request $request + * @return string/bool The HTML string that compose the tab header, + * bool True if the default header should be shown, False to display nothing + */ + public function getHeader(MonitoredObject $monitoredObject, Request $request) + { + return true; + } + + /** + * Return the tab content + * + * @param MonitoredObject $monitoredObject The monitored object related to that page + * @param Request $request + * @return string The HTML string that compose the tab content + */ + abstract public function getContent(MonitoredObject $monitoredObject, Request $request); + + /** + * This method returns true if the tab is visible for the logged user, otherwise false + * + * @return bool True if the tab is visible for the logged user, otherwise false + */ + public function shouldBeShown(MonitoredObject $monitoredObject, Auth $auth) + { + return true; + } +} |