From 41813c09aa0260c94509f11ac0aec627fcfc635f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 10 Feb 2011 13:47:24 +0100 Subject: [PATCH] [interface] Indicate shared bookmarks in interface. --- ChangeLog | 1 + libraries/bookmark.lib.php | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f5d105df..c3abab557 100644 --- a/ChangeLog +++ b/ChangeLog @@ -137,6 +137,7 @@ - bug #3175227 [auth] Reset user cache on login. - rfe #3148361 [interface] Replace hard coded limit with $cfg['LimitChars']. - bug #3177136 [interface] Indicate that bookmark is being used on browse. +- [interface] Indicate shared bookmarks in interface. 3.3.10.0 (not yet released) - patch #3147400 [structure] Aria table size printed as unknown, diff --git a/libraries/bookmark.lib.php b/libraries/bookmark.lib.php index dba279d9c..b5d83bd13 100644 --- a/libraries/bookmark.lib.php +++ b/libraries/bookmark.lib.php @@ -69,10 +69,25 @@ function PMA_Bookmark_getList($db) $query = 'SELECT label, id FROM '. PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' - . ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' - . ' OR user = \'\')' + . ' AND user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' . ' ORDER BY label'; - return PMA_DBI_fetch_result($query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE); + $per_user = PMA_DBI_fetch_result($query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE); + + $query = 'SELECT label, id FROM '. PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) + . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' + . ' AND user = \'\'' + . ' ORDER BY label'; + $global = PMA_DBI_fetch_result($query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE); + + foreach($global as $key => $val) { + $global[$key] = $val . ' (' . __('shared') . ')'; + } + + $ret = $global + $per_user; + + asort($ret); + + return $ret; } // end of the 'PMA_Bookmark_getList()' function