From c2afea9040e555c4131a75475394a781705eeca2 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Thu, 8 Jan 2015 07:15:53 +0530 Subject: [PATCH] Fix bug#4695 Changing ['DefaultTabTable'] doesn't update link and title Signed-off-by: Atul Pratap Singh --- ChangeLog | 1 + js/navigation.js | 4 +++- libraries/navigation/Nodes/Node.class.php | 5 +++++ .../navigation/Nodes/Node_Table.class.php | 19 ++++++++++++++++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f45502663..749ba9c526 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog 4.3.7.0 (not yet released) - bug #4694 js error on marking table as favorite in Safari (in private mode) +- bug #4695 Changing $cfg['DefaultTabTable'] doesn't update link and title 4.3.6.0 (2015-01-07) - bug Undefined index notices while configuring recent and favorite tables diff --git a/js/navigation.js b/js/navigation.js index 472b231157..af470a9dd7 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -359,7 +359,9 @@ $(function () { var storage = window.sessionStorage; // remove tree from storage if Navi_panel config form is submitted $(document).on('submit', 'form.config-form', function(event) { - if ($(this).attr('action').indexOf('form=Navi_panel') >= 0) { + if ($(this).attr('action').indexOf('form=Navi_panel') >= 0 || + $(this).attr('action').indexOf('form=Main_panel') >= 0 + ) { storage.removeItem('navTree'); } }); diff --git a/libraries/navigation/Nodes/Node.class.php b/libraries/navigation/Nodes/Node.class.php index dd714624e0..a9bb228edd 100644 --- a/libraries/navigation/Nodes/Node.class.php +++ b/libraries/navigation/Nodes/Node.class.php @@ -90,6 +90,11 @@ class Node */ public $links; + /** + * @var string HTML title + */ + public $title; + /** * @var string Extra CSS classes for the node */ diff --git a/libraries/navigation/Nodes/Node_Table.class.php b/libraries/navigation/Nodes/Node_Table.class.php index 4bcc8d4829..9ac1a34487 100644 --- a/libraries/navigation/Nodes/Node_Table.class.php +++ b/libraries/navigation/Nodes/Node_Table.class.php @@ -48,6 +48,23 @@ class Node_Table extends Node_DatabaseChild $this->icon = PMA_Util::getImage('b_browse.png', __('Browse')); break; } + switch($GLOBALS['cfg']['DefaultTabTable']) { + case 'tbl_structure.php': + $this->title = __('Structure'); + break; + case 'tbl_select.php': + $this->title = __('Search'); + break; + case 'tbl_change.php': + $this->title = __('Insert'); + break; + case 'tbl_sql.php': + $this->title = __('SQL'); + break; + case 'sql.php': + $this->title = __('Browse'); + break; + } $this->links = array( 'text' => $GLOBALS['cfg']['DefaultTabTable'] . '?server=' . $GLOBALS['server'] @@ -57,7 +74,7 @@ class Node_Table extends Node_DatabaseChild . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&token=' . $_SESSION[' PMA_token '], - 'title' => __('Browse') + 'title' => $this->title ); $this->classes = 'table'; }