Simplify code for rendering node

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2014-05-08 13:49:21 +02:00
parent 8c178843e4
commit 54a17f5230

View File

@ -1003,20 +1003,16 @@ class PMA_NavigationTree
$children = $node->children;
usort($children, array('PMA_NavigationTree', 'sortNode'));
$buffer = '';
$extra_class = '';
for ($i=0, $nbChildren = count($children); $i < $nbChildren; $i++) {
if ($i + 1 != $nbChildren) {
$buffer .= $this->_renderNode(
$children[$i],
true,
$children[$i]->classes
);
} else {
$buffer .= $this->_renderNode(
$children[$i],
true,
$children[$i]->classes . ' last'
);
if ($i + 1 == $nbChildren) {
$extra_class = ' last';
}
$buffer .= $this->_renderNode(
$children[$i],
true,
$children[$i]->classes . $extra_class
);
}
if (! empty($buffer)) {
if ($wrap) {