From 407b68441d3a847f32658550c790d17ee7de3e98 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 12 Nov 2015 17:41:11 +1100 Subject: [PATCH 1/3] Fix #11641 Ability to disable the navigationhiding Feature Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/relation.lib.php | 84 +++++++++++++++++++++++--------------- 2 files changed, 52 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index afd9e27a68..3e81f37054 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ phpMyAdmin - ChangeLog - issue #11550 Regression in Find and replace + issue #11619 TokuDB Tables Show Size as "unknown" + issue #11654 Use a slider for Internal relations ++ issue #11641 Ability to disable the navigationhiding Feature 4.5.2.0 (not yet released) - issue #11589 Incorrect parameter in mysqli_fetch_fields() diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 53437f7773..67b8a23814 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -452,25 +452,31 @@ function PMA_checkRelationsParam() $cfgRelation = array(); $cfgRelation['PMA_VERSION'] = PMA_VERSION; - $cfgRelation['relwork'] = false; - $cfgRelation['displaywork'] = false; - $cfgRelation['bookmarkwork'] = false; - $cfgRelation['pdfwork'] = false; - $cfgRelation['commwork'] = false; - $cfgRelation['mimework'] = false; - $cfgRelation['historywork'] = false; - $cfgRelation['recentwork'] = false; - $cfgRelation['favoritework'] = false; - $cfgRelation['uiprefswork'] = false; - $cfgRelation['trackingwork'] = false; - $cfgRelation['userconfigwork'] = false; - $cfgRelation['menuswork'] = false; - $cfgRelation['navwork'] = false; + $workToTable = array( + 'relwork' => 'relation', + 'displaywork' => array('relation', 'table_info'), + 'bookmarkwork' => 'bookmarktable', + 'pdfwork' => array('table_coords', 'pdf_pages'), + 'commwork' => 'column_info', + 'mimework' => 'column_info', + 'historywork' => 'history', + 'recentwork' => 'recent', + 'favoritework' => 'favorite', + 'uiprefswork' => 'table_uiprefs', + 'trackingwork' => 'tracking', + 'userconfigwork' => 'userconfig', + 'menuswork' => array('users', 'usergroups'), + 'navwork' => 'navigationhiding', + 'savedsearcheswork' => 'savedsearches', + 'centralcolumnswork' => 'central_columns', + 'designersettingswork' => 'designer_settings', + 'exporttemplateswork' => 'export_templates', + ); + + foreach ($workToTable as $work => $table) { + $cfgRelation[$work] = false; + } $cfgRelation['allworks'] = false; - $cfgRelation['savedsearcheswork'] = false; - $cfgRelation['centralcolumnswork'] = false; - $cfgRelation['designersettingswork'] = false; - $cfgRelation['exporttemplateswork'] = false; $cfgRelation['user'] = null; $cfgRelation['db'] = null; @@ -554,9 +560,10 @@ function PMA_checkRelationsParam() if (isset($cfgRelation['relation'])) { $cfgRelation['relwork'] = true; - if (isset($cfgRelation['table_info'])) { - $cfgRelation['displaywork'] = true; - } + } + + if (isset($cfgRelation['relation']) && isset($cfgRelation['table_info'])) { + $cfgRelation['displaywork'] = true; } if (isset($cfgRelation['table_coords']) && isset($cfgRelation['pdf_pages'])) { @@ -622,19 +629,30 @@ function PMA_checkRelationsParam() $cfgRelation['exporttemplateswork'] = true; } - if ($cfgRelation['relwork'] && $cfgRelation['displaywork'] - && $cfgRelation['pdfwork'] && $cfgRelation['commwork'] - && $cfgRelation['mimework'] && $cfgRelation['historywork'] - && $cfgRelation['recentwork'] && $cfgRelation['uiprefswork'] - && $cfgRelation['trackingwork'] && $cfgRelation['userconfigwork'] - && $cfgRelation['bookmarkwork'] && $cfgRelation['centralcolumnswork'] - && $cfgRelation['menuswork'] && $cfgRelation['navwork'] - && $cfgRelation['savedsearcheswork'] && $cfgRelation['favoritework'] - && $cfgRelation['designersettingswork'] - && $cfgRelation['exporttemplateswork'] - ) { - $cfgRelation['allworks'] = true; + $allWorks = true; + foreach ($workToTable as $work => $table) { + if (! $cfgRelation[$work]) { + if (is_string($table)) { + if ($GLOBALS['cfg']['Server'][$table] !== null) { + $allWorks = false; + break; + } + } else if (is_array($table)) { + $oneNull = false; + foreach ($table as $t) { + if ($GLOBALS['cfg']['Server'][$t] === null) { + $oneNull = true; + break; + } + } + if (! $oneNull) { + $allWorks = false; + break; + } + } + } } + $cfgRelation['allworks'] = $allWorks; return $cfgRelation; } // end of the 'PMA_checkRelationsParam()' function From 870c2c448b3e0391fb4b8a2ef84d7b16bc3b857a Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 12 Nov 2015 22:17:10 +1100 Subject: [PATCH 2/3] Fix notices about undefined indexes Signed-off-by: Madhura Jayaratne --- libraries/relation.lib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 67b8a23814..b4dade2a45 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -559,7 +559,7 @@ function PMA_checkRelationsParam() $GLOBALS['dbi']->freeResult($tab_rs); if (isset($cfgRelation['relation'])) { - $cfgRelation['relwork'] = true; + $cfgRelation['relwork'] = true; } if (isset($cfgRelation['relation']) && isset($cfgRelation['table_info'])) { @@ -633,14 +633,18 @@ function PMA_checkRelationsParam() foreach ($workToTable as $work => $table) { if (! $cfgRelation[$work]) { if (is_string($table)) { - if ($GLOBALS['cfg']['Server'][$table] !== null) { + if (isset($GLOBALS['cfg']['Server'][$table]) + && $GLOBALS['cfg']['Server'][$table] !== false + ) { $allWorks = false; break; } } else if (is_array($table)) { $oneNull = false; foreach ($table as $t) { - if ($GLOBALS['cfg']['Server'][$t] === null) { + if (isset($GLOBALS['cfg']['Server'][$t]) + && $GLOBALS['cfg']['Server'][$t] === false + ) { $oneNull = true; break; } From 3f62b990082ede8f673b76ebfe3241503c8d8f93 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 12 Nov 2015 22:23:10 +1100 Subject: [PATCH 3/3] Document the newly allowed false value Signed-off-by: Madhura Jayaratne --- doc/config.rst | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index bb591ea874..89474e9fff 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -502,7 +502,7 @@ Server connection settings .. _bookmark: .. config:option:: $cfg['Servers'][$i]['bookmarktable'] - :type: string + :type: string or false :default: ``''`` Since release 2.2.0 phpMyAdmin allows users to bookmark queries. This @@ -516,7 +516,7 @@ Server connection settings .. _relation: .. config:option:: $cfg['Servers'][$i]['relation'] - :type: string + :type: string or false :default: ``''`` Since release 2.2.4 you can describe, in a special 'relation' table, @@ -555,7 +555,7 @@ Server connection settings .. _table_info: .. config:option:: $cfg['Servers'][$i]['table_info'] - :type: string + :type: string or false :default: ``''`` Since release 2.3.0 you can describe, in a special 'table\_info' @@ -576,12 +576,12 @@ Server connection settings .. _table_coords: .. config:option:: $cfg['Servers'][$i]['table_coords'] - :type: string + :type: string or false :default: ``''`` .. config:option:: $cfg['Servers'][$i]['pdf_pages'] - :type: string + :type: string or false :default: ``''`` Since release 2.3.0 you can have phpMyAdmin create :term:`PDF` pages @@ -603,7 +603,7 @@ Server connection settings .. _col_com: .. config:option:: $cfg['Servers'][$i]['column_info'] - :type: string + :type: string or false :default: ``''`` This part requires a content update! Since release 2.3.0 you can @@ -662,7 +662,7 @@ Server connection settings .. _history: .. config:option:: $cfg['Servers'][$i]['history'] - :type: string + :type: string or false :default: ``''`` Since release 2.5.0 you can store your :term:`SQL` history, which means all @@ -687,7 +687,7 @@ Server connection settings .. _recent: .. config:option:: $cfg['Servers'][$i]['recent'] - :type: string + :type: string or false :default: ``''`` Since release 3.5.0 you can show recently used tables in the @@ -710,7 +710,7 @@ Server connection settings .. _table_uiprefs: .. config:option:: $cfg['Servers'][$i]['table_uiprefs'] - :type: string + :type: string or false :default: ``''`` Since release 3.5.0 phpMyAdmin can be configured to remember several @@ -728,12 +728,12 @@ Server connection settings .. _configurablemenus: .. config:option:: $cfg['Servers'][$i]['users'] - :type: string + :type: string or false :default: ``''`` .. config:option:: $cfg['Servers'][$i]['usergroups'] - :type: string + :type: string or false :default: ``''`` Since release 4.1.0 you can create different user groups with menu items @@ -752,7 +752,7 @@ Server connection settings .. _navigationhiding: .. config:option:: $cfg['Servers'][$i]['navigationhiding'] - :type: string + :type: string or false :default: ``''`` Since release 4.1.0 you can hide/show items in the navigation tree. @@ -766,7 +766,7 @@ Server connection settings .. _central_columns: .. config:option:: $cfg['Servers'][$i]['central_columns'] - :type: string + :type: string or false :default: ``''`` Since release 4.3.0 you can have a central list of columns per database. @@ -785,7 +785,7 @@ Server connection settings .. _designer_settings: .. config:option:: $cfg['Servers'][$i]['designer_settings'] - :type: string + :type: string or false :default: ``''`` Since release 4.5.0 your designer settings can be remembered. @@ -801,7 +801,7 @@ Server connection settings .. _savedsearches: .. config:option:: $cfg['Servers'][$i]['savedsearches'] - :type: string + :type: string or false :default: ``''`` Since release 4.2.0 you can save and load query-by-example searches from the Database > Query panel. @@ -815,7 +815,7 @@ Server connection settings .. _export_templates: .. config:option:: $cfg['Servers'][$i]['export_templates'] - :type: string + :type: string or false :default: ``''`` Since release 4.5.0 you can save and load export templates. @@ -829,7 +829,7 @@ Server connection settings .. _tracking: .. config:option:: $cfg['Servers'][$i]['tracking'] - :type: string + :type: string or false :default: ``''`` Since release 3.3.x a tracking mechanism is available. It helps you to @@ -915,7 +915,7 @@ Server connection settings .. _userconfig: .. config:option:: $cfg['Servers'][$i]['userconfig'] - :type: string + :type: string or false :default: ``''`` Since release 3.4.x phpMyAdmin allows users to set most preferences by