From d4d5a037660dbd2b37813843c702f92ad9e5a524 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 21 Jun 2013 10:00:41 -0400 Subject: [PATCH] Bug #3960 NavigationBarIconic config not honored --- ChangeLog | 2 +- db_tracking.php | 12 +++- doc/config.rst | 24 ++++--- libraries/DisplayResults.class.php | 16 +++-- libraries/Footer.class.php | 6 +- libraries/Menu.class.php | 25 +++++-- libraries/Util.class.php | 66 +++++++++++++------ libraries/config.default.php | 21 ++++-- libraries/config.values.php | 21 +++--- libraries/config/FormDisplay.class.php | 8 --- libraries/config/messages.inc.php | 10 +-- libraries/config/setup.forms.php | 5 +- libraries/config/user_preferences.forms.php | 5 +- libraries/display_create_table.lib.php | 6 +- .../navigation/NavigationHeader.class.php | 6 +- libraries/navigation/NavigationTree.class.php | 12 +++- libraries/operations.lib.php | 36 ++++++++-- libraries/schema/User_Schema.class.php | 6 +- libraries/sql_query_form.lib.php | 6 +- libraries/structure.lib.php | 12 +++- server_binlog.php | 12 +++- server_databases.php | 5 +- tbl_structure.php | 5 +- tbl_tracking.php | 8 ++- test/classes/PMA_DisplayResults_test.php | 8 +-- test/classes/PMA_Footer_test.php | 4 +- test/classes/PMA_Menu_test.php | 2 +- test/classes/PMA_Table_test.php | 2 +- test/libraries/PMA_build_html_for_db_test.php | 2 +- test/libraries/PMA_operations_test.php | 2 +- test/libraries/PMA_transformation_test.php | 2 +- .../common/PMA_buildActionTitles_test.php | 2 +- test/libraries/common/PMA_getIcon_test.php | 12 ++-- 33 files changed, 253 insertions(+), 118 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c64eba1ec..f166942a8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,13 +6,13 @@ phpMyAdmin - ChangeLog - bug #3970 Pressing enter in the filter field reloads page - bug #3984 Cannot insert in this table (PHP < 5.4) - bug #3989 Reloading privileges does not update the interface +- bug #3960 NavigationBarIconic config not honored 4.0.4.0 (2013-06-17) - bug #3959 Using DefaultTabDatabase in NavigationTree for Database Click - bug #3961 Avoid Suhosin warning when in simulation mode - bug #3897 Row Statistics and Space usage bugs - bug #3966 Only display "table has no unique column" message when applicable -- bug #3960 NavigationBarIconic config not honored - bug #3965 Default language wrong with zh-TW - bug #3921 Call to undefined function PMA_isSuperuser() if default server is not set diff --git a/db_tracking.php b/db_tracking.php index e95a7e0a5f..39eed84ee3 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -91,14 +91,20 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) { // Print out information about versions $drop_image_or_text = ''; - if (true == $GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $drop_image_or_text .= PMA_Util::getImage( 'b_drop.png', __('Delete tracking data for this table') ); } - if ('both' === $GLOBALS['cfg']['PropertiesIconic'] - || false === $GLOBALS['cfg']['PropertiesIconic'] + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('text', 'both') + ) ) { $drop_image_or_text .= __('Drop'); } diff --git a/doc/config.rst b/doc/config.rst index 2b9ced27b8..6099d80c3d 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1481,14 +1481,13 @@ Database structure Browse mode ----------- -.. config:option:: $cfg['NavigationBarIconic'] +.. config:option:: $cfg['TableNavigationLinksMode'] :type: string - :default: true + :default: ``'icons'`` - Defines whether navigation bar buttons contain text or symbols only. A - value of true displays icons, false displays text and 'both' displays - both icons and text. + Defines whether the table navigation links contain ``'icons'``, ``'text'`` + or ``'both'``. .. config:option:: $cfg['ShowAll'] @@ -1672,15 +1671,22 @@ Export and import settings Tabs display settings --------------------- -.. config:option:: $cfg['PropertiesIconic'] +.. config:option:: $cfg['TabsMode'] :type: string :default: ``'both'`` - If set to ``true``, will display icons instead of text for db and table + Defines whether the menu tabs contain ``'icons'``, ``'text'`` or ``'both'``. + +.. config:option:: $cfg['ActionLinksMode'] + + :type: string + :default: ``'both'`` + + If set to ``icons``, will display icons instead of text for db and table properties links (like :guilabel:`Browse`, :guilabel:`Select`, - :guilabel:`Insert`, ...) and for the menu tabs. Can be set to ``'both'`` - if you want icons AND text. When set to ``false``, will only show text. + :guilabel:`Insert`, ...). Can be set to ``'both'`` + if you want icons AND text. When set to ``text``, will only show text. .. config:option:: $cfg['PropertiesNumColumns'] diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 35dd112eaf..1c8360bca9 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -535,14 +535,18 @@ class PMA_DisplayResults ) { $caption_output = ''; - // for true or 'both' - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { $caption_output .= $caption; } - // for false or 'both' - if (($GLOBALS['cfg']['NavigationBarIconic'] === false) - || ($GLOBALS['cfg']['NavigationBarIconic'] === self::POSITION_BOTH) + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('text', 'both') + ) ) { $caption_output .= ' ' . $title; } @@ -2553,7 +2557,7 @@ class PMA_DisplayResults // We need to copy the value // or else the == 'both' check will always return true - if ($GLOBALS['cfg']['PropertiesIconic'] === self::POSITION_BOTH) { + if ($GLOBALS['cfg']['ActionLinksMode'] === self::POSITION_BOTH) { $iconic_spacer = '
'; } else { $iconic_spacer = ''; diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php index a0d14ad525..1bf725f868 100644 --- a/libraries/Footer.class.php +++ b/libraries/Footer.class.php @@ -131,7 +131,11 @@ class PMA_Footer $retval .= '