Perfdata: Do not show "xx more..." if there is nothing to show
This commit is contained in:
parent
2d7e56c46e
commit
9b25ffa566
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue