From 5579a927ad813134a61d2a5ee469701a5f71b689 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 21 Jul 2017 12:04:20 +0200 Subject: [PATCH] ZfQueryBasedTable: improve readability --- .../ipl/Web/Table/ZfQueryBasedTable.php | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/library/vendor/ipl/Web/Table/ZfQueryBasedTable.php b/library/vendor/ipl/Web/Table/ZfQueryBasedTable.php index 6a43f71c..54abd79d 100644 --- a/library/vendor/ipl/Web/Table/ZfQueryBasedTable.php +++ b/library/vendor/ipl/Web/Table/ZfQueryBasedTable.php @@ -16,7 +16,6 @@ use ipl\Web\Widget\ControlsAndContent; use ipl\Web\Widget\Paginator; use ipl\Web\Table\Extension\QuickSearch; use ipl\Web\Url; -use Zend_Db_Exception as Expr; abstract class ZfQueryBasedTable extends Table { @@ -138,7 +137,6 @@ abstract class ZfQueryBasedTable extends Table /** * @param int $timestamp - * @return string */ protected function renderDayIfNew($timestamp) { @@ -148,16 +146,17 @@ abstract class ZfQueryBasedTable extends Table $day = strftime('%A, %e. %B, %Y', $timestamp); } - if ($this->lastDay === $day) { - return; + if ($this->lastDay !== $day) { + $this->nextHeader()->add( + $this::th($day, [ + 'colspan' => 2, + 'class' => 'table-header-day' + ]) + ); + + $this->lastDay = $day; + $this->nextBody(); } - - $this->nextHeader()->add( - $this::th($day, ['colspan' => 2])->addAttributes(['class' => 'table-header-day']) - ); - - $this->lastDay = $day; - $this->nextBody(); } public function fetch()