From 3a1d09cfb1c59dfe1652c1d0fb33de93fd0b2f3b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 26 Jan 2018 13:06:25 +0100 Subject: [PATCH] ImportsourceHookTable: add new classes, deal with ...empty rows --- library/Director/Web/Table/ImportsourceHookTable.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/library/Director/Web/Table/ImportsourceHookTable.php b/library/Director/Web/Table/ImportsourceHookTable.php index 55d04015..bfc2ef79 100644 --- a/library/Director/Web/Table/ImportsourceHookTable.php +++ b/library/Director/Web/Table/ImportsourceHookTable.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Director\Web\Table; +use dipl\Html\ValidHtml; use Icinga\Data\DataArray\ArrayDatasource; use Icinga\Module\Director\Hook\ImportSourceHook; use Icinga\Module\Director\Import\SyncUtils; @@ -21,6 +22,11 @@ class ImportsourceHookTable extends SimpleQueryBasedTable protected $sourceHook; + protected function assemble() + { + $this->attributes()->add('class', 'raw-data-table collapsed'); + } + public function getColumns() { if ($this->columnCache === null) { @@ -55,12 +61,16 @@ class ImportsourceHookTable extends SimpleQueryBasedTable public function renderRow($row) { + // Find a better place! + if ($row === null) { + return null; + } $tr = $this::tr(); foreach ($this->getColumnsToBeRendered() as $column) { $td = $this::td(); if (property_exists($row, $column)) { - if (is_string($row->$column)) { + if (is_string($row->$column) || $row->$column instanceof ValidHtml) { $td->setContent($row->$column); } else { $html = Html::tag('pre', null, PlainObjectRenderer::render($row->$column));