Perfdata: Do not show "xx more..." if there is nothing to show

This commit is contained in:
Johannes Meyer 2015-08-11 15:28:37 +02:00
parent 2d7e56c46e
commit 9b25ffa566
1 changed files with 8 additions and 5 deletions

View File

@ -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[] = '<span title="' . $mess . '">...</span>';
if ($compact) {
$results = array_slice($results, 0, $limit);
$title = sprintf($this->view->translate('%d more ...'), $count - $limit);
$results[] = '<span title="' . $title . '">...</span>';
} else {
$table = array_slice($table, 0, $limit);
}
}
}
if ($compact) {