From 7e84b564f6918a2557cb248fd5db41131be281f7 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 2 Jun 2015 17:32:19 +0200 Subject: [PATCH] QuickTable: render only columns with titles --- library/Director/Web/Table/QuickTable.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/library/Director/Web/Table/QuickTable.php b/library/Director/Web/Table/QuickTable.php index 3882d962..e392a439 100644 --- a/library/Director/Web/Table/QuickTable.php +++ b/library/Director/Web/Table/QuickTable.php @@ -13,15 +13,14 @@ abstract class QuickTable protected $connection; - protected function renderRow($row, $actionColumn = false) + protected function renderRow($row) { $htm = " \n"; - $idKey = key($row); $firstRow = true; - foreach ($row as $key => $val) { + foreach ($this->getTitles() as $key => $title) { + $val = $row->$key; $value = null; - if ($key === $idKey) continue; if ($firstRow) { if ($val !== null && $url = $this->getActionUrl($row)) { @@ -44,6 +43,8 @@ abstract class QuickTable return $htm . " \n"; } + abstract protected function getTitles(); + protected function getActionUrl($row) { return false;