diff --git a/ChangeLog b/ChangeLog index 3f6e315fb..7b06f686c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,13 @@ $Source$ 2005-03-07 Marc Delisle * libraries/relation.lib.php: db comments broken * libraries/dbi/*.php, lang/*: new $strSocketProblem message + * db_details.php, tbl_query_box.php, libraries/bookmark.lib.php: + bookmark improvement, + based on patch #1034161 by Ryan Schmidt - ryandesign: + sort bookmarks by label, remove the number before each bookmark + in the drop-down choice. For this I had to change some logic in the + calling scripts. It's still possible to have the same label more + than once. 2005-03-07 Michal Čihař * db_printview.php, tbl_printview.php, css/phpmyadmin.css.php, diff --git a/db_details.php b/db_details.php index c11c921e7..6c187a420 100644 --- a/db_details.php +++ b/db_details.php @@ -224,7 +224,7 @@ if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) { echo ' ' . "\n"; echo ' '; diff --git a/libraries/bookmark.lib.php b/libraries/bookmark.lib.php index 8906682e2..9c8c5f253 100644 --- a/libraries/bookmark.lib.php +++ b/libraries/bookmark.lib.php @@ -54,15 +54,15 @@ function PMA_listBookmarks($db, $cfgBookmark) $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 = \'\')'; + . ' OR user = \'\')' + . ' ORDER BY label'; $result = PMA_DBI_query($query, $dbh, PMA_DBI_QUERY_STORE); // There are some bookmarks -> store them + // use the unique id as the key if ($result > 0 && PMA_DBI_num_rows($result) > 0) { - $flag = 1; while ($row = PMA_DBI_fetch_row($result)) { - $bookmark_list[$flag . ' - ' . $row[0]] = $row[1]; - $flag++; + $bookmark_list[$row[1]] = $row[0]; } // end while return $bookmark_list; } diff --git a/tbl_query_box.php b/tbl_query_box.php index 6d7243048..8daa7102c 100644 --- a/tbl_query_box.php +++ b/tbl_query_box.php @@ -434,7 +434,7 @@ if (!isset($is_inside_querywindow) || echo ' ' . "   \n"; echo ' ' . $strVar;