From 63ef473dcce5cb15b6f7d20f702443c0b958192a Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Wed, 27 Jun 2012 15:50:30 +0100 Subject: [PATCH] Don't use an href attribute on navigation expander links. These links can't be opened in a new window anyway. --- js/functions.js | 4 ++-- js/navigation.js | 7 ++++++- libraries/NavigationHeader.class.php | 7 +++---- libraries/navigation/CollapsibleTree.class.php | 9 +++++---- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/js/functions.js b/js/functions.js index 5081777edc..07ecd5dc8f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3786,8 +3786,8 @@ AJAX.registerOnload('functions.js', function () { // Load the navigation into the initial page $(function () { if ($('#pma_navigation_tree').length) { - var url = $('#pma_navigation_tree').find('a').attr('href'); - $.get(url, function (data) { + var url = $('#pma_navigation').find('a.navigation_url').attr('href'); + $.get(url, 'full=true', function (data) { if (data.success) { $('#pma_navigation_tree').html(data.message).children('div').show(); } diff --git a/js/navigation.js b/js/navigation.js index 0035bdb2e1..926dacf6db 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -29,7 +29,12 @@ $(document).ready(function() { var $throbber = $('.throbber').first().clone().show(); $icon.hide(); $throbber.insertBefore($icon); - $.get($this.attr('href'), {ajax_request: true}, function (data) { + var params = { + a_path: $(this).find('span.a_path').text(), + v_path: $(this).find('span.v_path').text() + }; + var url = $('#pma_navigation').find('a.navigation_url').attr('href'); + $.get(url, params, function (data) { if (data.success === true) { $this.addClass('loaded'); $destination.find('div.list_container').remove(); // FIXME: Hack, there shouldn't be a list container there diff --git a/libraries/NavigationHeader.class.php b/libraries/NavigationHeader.class.php index a60105c440..2d5319f72e 100644 --- a/libraries/NavigationHeader.class.php +++ b/libraries/NavigationHeader.class.php @@ -19,16 +19,16 @@ class PMA_NavigationHeader $link_url = PMA_generate_common_url( array( - 'ajax_request' => true, - 'full' => true + 'ajax_request' => true ) ); $link = sprintf( - '', + '', $link_url ); $buffer = '
'; + $buffer .= $link; $buffer .= '
'; $buffer .= '
'; $buffer .= $this->logo(); @@ -36,7 +36,6 @@ class PMA_NavigationHeader $buffer .= $this->serverChoice(); $buffer .= $this->recent(); $buffer .= '
'; - $buffer .= $link; $buffer .= '
'; $buffer .= $this->_commonFunctions->getImage( 'ajax_clock_small.gif', diff --git a/libraries/navigation/CollapsibleTree.class.php b/libraries/navigation/CollapsibleTree.class.php index 505202e356..470e9bfe46 100644 --- a/libraries/navigation/CollapsibleTree.class.php +++ b/libraries/navigation/CollapsibleTree.class.php @@ -479,15 +479,14 @@ class CollapsibleTree { ) { $a_path = array(); foreach ($node->parents(true, true, false) as $parent) { - $a_path[] = urlencode(base64_encode($parent->real_name)); + $a_path[] = base64_encode($parent->real_name); } $a_path = implode('.', array_reverse($a_path)); $v_path = array(); foreach ($node->parents(true, true, true) as $parent) { - $v_path[] = urlencode(base64_encode($parent->name)); + $v_path[] = base64_encode($parent->name); } $v_path = implode('.', array_reverse($v_path)); - $link = "navigation.php?" . PMA_generate_common_url() . "&a_path=$a_path&v_path=$v_path"; $loaded = ''; if ($node->is_group || $GLOBALS['cfg']['LeftFrameLight'] != true || $this->is_loaded) { $loaded = ' loaded'; @@ -501,7 +500,9 @@ class CollapsibleTree { if (strpos($class, 'last') === false) { $retval .= ""; } - $retval .= ""; + $retval .= ""; + $retval .= "" . $a_path . ""; + $retval .= "" . $v_path . ""; $retval .= $this->_commonFunctions->getImage('b_plus.png'); $retval .= ""; $retval .= "
";