From 9b25ffa5665e9ba049a635c8ecca4e37fead749c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 11 Aug 2015 15:28:37 +0200 Subject: [PATCH] Perfdata: Do not show "xx more..." if there is nothing to show --- .../application/views/helpers/Perfdata.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/application/views/helpers/Perfdata.php b/modules/monitoring/application/views/helpers/Perfdata.php index 8957027c6..090aff03e 100644 --- a/modules/monitoring/application/views/helpers/Perfdata.php +++ b/modules/monitoring/application/views/helpers/Perfdata.php @@ -89,12 +89,15 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract } } if ($limit > 0) { - $count = max(count($table), count($results)); - $table = array_slice($table, 0, $limit); - $results = array_slice($results, 0, $limit); + $count = $compact ? count($results) : count($table); if ($count > $limit) { - $mess = sprintf($this->view->translate('%d more ...'), $count - $limit); - $results[] = '...'; + if ($compact) { + $results = array_slice($results, 0, $limit); + $title = sprintf($this->view->translate('%d more ...'), $count - $limit); + $results[] = '...'; + } else { + $table = array_slice($table, 0, $limit); + } } } if ($compact) {