Various navigation tree fixes

This commit is contained in:
Rouslan Placella 2012-07-22 13:22:28 +01:00
parent 1191cab2e8
commit 89da93ab1f
2 changed files with 11 additions and 4 deletions

View File

@ -242,6 +242,7 @@ class PMA_NavigationTree
*/
private function _buildPathPart($path, $type2, $pos2, $type3, $pos3)
{
$retval = true;
if (count($path) > 1) {
array_shift($path); // remove 'root'
$db = $this->_tree->getChild($path[0]);
@ -478,7 +479,6 @@ class PMA_NavigationTree
}
$this->groupNode($node);
foreach ($node->children as $child) {
$this->groupNode($child);
$this->groupTree($child);
}
}
@ -704,7 +704,10 @@ class PMA_NavigationTree
{
$retval = '';
$paths = $node->getPaths();
if ($node->hasSiblings() || isset($_REQUEST['results'])) {
if ($node->hasSiblings()
|| isset($_REQUEST['results'])
|| $node->realParent() === false
) {
if ( $node->type == Node::CONTAINER
&& count($node->children) == 0
&& $GLOBALS['is_ajax_request'] != true
@ -841,7 +844,7 @@ class PMA_NavigationTree
$link = vsprintf($node->links['icon'], $args);
$retval .= "<a$linkClass href='$link'>{$node->icon}</a>";
} else {
$retval .= "<a>{$node->icon}</a>";
$retval .= "<a href='#'>{$node->icon}</a>";
}
$retval .= "</div>";
}

View File

@ -239,7 +239,11 @@ class Node
public function realParent()
{
$retval = $this->parents();
return $retval[0];
if (count($retval) > 0) {
return $retval[0];
} else {
return false;
}
}
/**