From 44abd01ffc2de5992c865533a2d770faffea124b Mon Sep 17 00:00:00 2001 From: Jennifer Mourek Date: Mon, 19 Feb 2018 11:04:39 +0100 Subject: [PATCH] TacticalController: Add OutputFormat and tab creation handling Mimics the behaviour of the ListController --- .../controllers/TacticalController.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php index 3c444dd5b..40ecc4f5f 100644 --- a/modules/monitoring/application/controllers/TacticalController.php +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -8,9 +8,19 @@ use Icinga\Module\Monitoring\Controller; use Icinga\Web\Url; use Icinga\Web\Widget\Tabextension\DashboardAction; use Icinga\Web\Widget\Tabextension\MenuAction; +use Icinga\Web\Widget\Tabextension\OutputFormat; class TacticalController extends Controller { + /** + * @see ActionController::init + */ + public function init() + { + parent::init(); + $this->createTabs(); + } + public function indexAction() { $this->setAutorefreshInterval(15); @@ -51,6 +61,7 @@ class TacticalController extends Controller ); $this->applyRestriction('monitoring/filter/objects', $stats); + $this->handleFormatRequest($stats); $summary = $stats->fetchRow(); $hostSummaryChart = new Donut(); @@ -103,4 +114,15 @@ class TacticalController extends Controller ->render(); $this->view->statusSummary = $summary; } + + + /** + * Return all tabs for this controller + * + * @return Tabs + */ + private function createTabs() + { + $this->getTabs()->extend(new OutputFormat(['pdf'])); + } }