diff --git a/libraries/navigation/NavigationTree.class.php b/libraries/navigation/NavigationTree.class.php index ce03f58e95..80ce657a45 100644 --- a/libraries/navigation/NavigationTree.class.php +++ b/libraries/navigation/NavigationTree.class.php @@ -873,21 +873,11 @@ class PMA_NavigationTree if (strpos($class, 'last') === false) { $retval .= ""; } - $icon = PMA_Util::getImage('b_plus.png', __('Expand/Collapse')); $match = $this->_findTreeMatch($this->_aPath, 'aPath_clean'); $match |= $this->_findTreeMatch($this->_vPath, 'vPath_clean'); - if ($match && ! $node->is_group) { - $icon = PMA_Util::getImage( - 'b_minus.png' - ); - } $retval .= '_pos; $retval .= ""; $retval .= $this->_getPaginationParamsHtml($node); - $retval .= $icon; + $retval .= $node->getIcon($match); $retval .= ""; $retval .= ""; diff --git a/libraries/navigation/Nodes/Node.class.php b/libraries/navigation/Nodes/Node.class.php index c310008c27..655f61aa82 100644 --- a/libraries/navigation/Nodes/Node.class.php +++ b/libraries/navigation/Nodes/Node.class.php @@ -482,5 +482,23 @@ class Node return implode(' ', $result); } + + /** + * Returns icon for the node + * + * @param boolean $match Whether the node matched loaded tree + * + * @return String with image name + */ + public function getIcon($match) + { + if ($GLOBALS['cfg']['NavigationTreeDisableDatabaseExpansion']) { + return ''; + } elseif ($match && ! $node->is_group) { + return PMA_Util::getImage('b_minus.png'); + } else { + return PMA_Util::getImage('b_plus.png', __('Expand/Collapse')); + } + } } ?>