From 22ba2d81479446d1e1b41027c828a420f9a4e136 Mon Sep 17 00:00:00 2001 From: Spun Nakandala Date: Fri, 10 May 2013 12:09:51 +0530 Subject: [PATCH 1/5] Bug #3919 PropertiesIconic not honored fixed (cherry picked from commit 01c57f71ca535e853dbb0c3a3a03cdfc3ea49b6b) --- libraries/Util.class.php | 16 +++++++++------- test/libraries/common/PMA_getIcon_test.php | 4 +++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 5d3e77b38f..0c844946cc 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -95,11 +95,13 @@ class PMA_Util * @param string $icon name of icon file * @param string $alternate alternate text * @param boolean $force_text whether to force alternate text to be displayed + * @param boolean $menu_icon whether this icon is for the menu bar or not * * @return string an html snippet */ - public static function getIcon($icon, $alternate = '', $force_text = false) - { + public static function getIcon($icon, $alternate = '', $force_text = false, + $menu_icon = false + ) { // $cfg['PropertiesIconic'] is true or both $include_icon = ($GLOBALS['cfg']['PropertiesIconic'] !== false); // $cfg['PropertiesIconic'] is false or both @@ -107,8 +109,9 @@ class PMA_Util $include_text = ($force_text || ($GLOBALS['cfg']['PropertiesIconic'] !== true)); - // Always use a span (we rely on this in js/sql.js) - $button = ''; + // Sometimes use a span (we rely on this in js/sql.js). But for menu bar + // we don't need a span + $button = $menu_icon ? '' : ''; if ($include_icon) { $button .= self::getImage($icon, $alternate); } @@ -118,7 +121,7 @@ class PMA_Util if ($include_text) { $button .= $alternate; } - $button .= ''; + $button .= $menu_icon ? '' : ''; return $button; } @@ -1797,8 +1800,7 @@ class PMA_Util // avoid generating an alt tag, because it only illustrates // the text that follows and if browser does not display // images, the text is duplicated - $tab['text'] = self::getImage(htmlentities($tab['icon'])) - . $tab['text']; + $tab['text'] = self::getIcon($tab['icon'], $tab['text'], false, true); } elseif (empty($tab['text'])) { // check to not display an empty link-text diff --git a/test/libraries/common/PMA_getIcon_test.php b/test/libraries/common/PMA_getIcon_test.php index bc3f0581ed..781af64532 100644 --- a/test/libraries/common/PMA_getIcon_test.php +++ b/test/libraries/common/PMA_getIcon_test.php @@ -57,10 +57,12 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['PropertiesIconic'] = true; $alternate_text = 'alt_str'; + // Here we are checking for an icon embeded inside a span (i.e not a menu + // bar icon $this->assertEquals( '' . $alternate_text
             . ' ' . $alternate_text . '', - PMA_Util::getIcon('b_comment.png', $alternate_text, true) + PMA_Util::getIcon('b_comment.png', $alternate_text, true, false) ); } From 04ee24ffd933a944d24e15a1e40fcf9517fb11f1 Mon Sep 17 00:00:00 2001 From: Randall Fan Date: Tue, 14 May 2013 06:43:44 +0200 Subject: [PATCH 2/5] Translated using Weblate (Simplified Chinese) Currently translated at 99.7% (2600 of 2607) --- po/zh_CN.po | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index 412c892505..4d4424616a 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -4,10 +4,10 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.1-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-05-02 13:12+0200\n" -"PO-Revision-Date: 2013-04-20 18:43+0200\n" -"Last-Translator: greensea g \n" -"Language-Team: Simplified Chinese \n" +"PO-Revision-Date: 2013-05-14 06:43+0200\n" +"Last-Translator: Randall Fan \n" +"Language-Team: Simplified Chinese " +"\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,7 +19,7 @@ msgstr "" #: libraries/DisplayResults.class.php:809 #: libraries/server_privileges.lib.php:2604 msgid "Show all" -msgstr "显示所有" +msgstr "显示全部" #: browse_foreigners.php:77 libraries/PDF.class.php:66 #: libraries/Util.class.php:2547 @@ -3415,7 +3415,7 @@ msgstr "从一组最多64个成员的集合中选择的单个值" #: libraries/Types.class.php:358 msgid "A type that can store a geometry of any type" -msgstr "一个能存储任何类型几何形状的类型" +msgstr "一个能存储任何几何形状的类型" #: libraries/Types.class.php:360 msgid "A point in 2-dimensional space" @@ -6334,7 +6334,7 @@ msgstr "正在上传要导入的文件…" #: libraries/display_import.lib.php:94 #, php-format msgid "%s/sec." -msgstr "%s/秒" +msgstr "%s/秒。" #: libraries/display_import.lib.php:101 msgid "About %MIN min. %SEC sec. remaining." @@ -11545,11 +11545,11 @@ msgstr "没有可显示数据" #: tbl_chart.php:62 tbl_gis_visualization.php:24 msgid "No SQL query was set to fetch data." -msgstr "没有设置SQL 查询来检索数据" +msgstr "没有设置SQL 查询来检索数据。" #: tbl_chart.php:124 msgid "No numeric columns present in the table to plot." -msgstr "在将表格转为图标是没有找到数字类型的列" +msgstr "在将表格转为图表时没有找到数字类型的列。" #: tbl_chart.php:154 msgctxt "Chart type" @@ -11744,10 +11744,9 @@ msgid "No index defined! Create one below" msgstr "没有已定义的索引!在下面创建一个" #: tbl_structure.php:125 -#, fuzzy #| msgid "No rows selected" msgid "No column selected." -msgstr "没有选中任何行" +msgstr "没有选中任何列。" #: tbl_structure.php:149 #, php-format From 8473a5f78915f1b25dcdb2c8fc51428744cfb678 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 14 May 2013 12:01:07 +0200 Subject: [PATCH 3/5] add changelog entry for bug #3919 PropertiesIconic not honored --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index cadd66f981..373736065e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ phpMyAdmin - ChangeLog values - bug #3898 Structure not refreshed after column drop - bug #3926 View is not updatable +- bug #3919 PropertiesIconic not honored 4.0.1.0 (not yet released) - bug #3879 Import broken for CSV using LOAD DATA From e2ea214267ef6777a2a5334a07f4a27d0f46362d Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 14 May 2013 16:04:49 +0200 Subject: [PATCH 4/5] Fix bug #3930 Databases to choose for specific privileges show up escaped --- ChangeLog | 1 + libraries/server_privileges.lib.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 373736065e..8411f2875e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ values - bug #3898 Structure not refreshed after column drop - bug #3926 View is not updatable - bug #3919 PropertiesIconic not honored +- bug #3930 Databases to choose for specific privileges show up escaped 4.0.1.0 (not yet released) - bug #3879 Import broken for CSV using LOAD DATA diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index d0cc5bb421..7933d24ed6 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -2273,14 +2273,15 @@ function PMA_getHTmlForDisplaySelectDbInEditPrivs($found_rows) . '' . "\n"; foreach ($pred_db_array as $current_db) { + $current_db_show = $current_db; $current_db = PMA_Util::escapeMysqlWildcards($current_db); // cannot use array_diff() once, outside of the loop, // because the list of databases has special characters // already escaped in $found_rows, // contrary to the output of SHOW DATABASES - if (empty($found_rows) || ! in_array($current_db, $found_rows)) { + if (empty($found_rows) || ! in_array($current_db_show, $found_rows)) { $html_output .= '' . "\n"; + . htmlspecialchars($current_db_show) . '' . "\n"; } } $html_output .= '' . "\n"; From 3f7bd7f8a759d0ad52b04448c6fbb91e08c2908d Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 14 May 2013 16:07:38 +0200 Subject: [PATCH 5/5] Use PEAR standard in PMA_getHtmlForDisplaySelectDbInEditPrivs function name --- libraries/server_privileges.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 7933d24ed6..a05f52bc9e 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -2262,9 +2262,9 @@ function PMA_getTableForDisplayAllTableSpecificRights($username, $hostname * * @return string HTML snippet */ -function PMA_getHTmlForDisplaySelectDbInEditPrivs($found_rows) +function PMA_getHtmlForDisplaySelectDbInEditPrivs($found_rows) { - $pred_db_array =PMA_DBI_fetch_result('SHOW DATABASES;'); + $pred_db_array = PMA_DBI_fetch_result('SHOW DATABASES;'); $html_output = '' . "\n"; @@ -3056,7 +3056,7 @@ function PMA_getHtmlForDisplayUserProperties($dbname_is_wildcard,$url_dbname, if (! strlen($dbname)) { // no database name was given, display select db - $html_output .= PMA_getHTmlForDisplaySelectDbInEditPrivs($found_rows); + $html_output .= PMA_getHtmlForDisplaySelectDbInEditPrivs($found_rows); } else { $html_output .= PMA_displayTablesInEditPrivs($dbname, $found_rows);