From 8e3f1e20cf5125977097d3a1d4eadbfd16c44e06 Mon Sep 17 00:00:00 2001 From: Armel Fauveau Date: Fri, 11 May 2001 00:24:15 +0000 Subject: [PATCH] Bookmark : 'delete' option --- ChangeLog | 3 +++ db_readdump.php3 | 20 +++++++++++++++++--- sql.php3 | 8 +++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 114a87fdd..0ab1a5361 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-05-11 Armel Fauveau + * Added a "delete" option in the phpMyBookmark patch (Olivier Mueller) + 2001-05-10 Loïc Chapeaux * db_readdump.php3: fixed all the special characters problems (Bug #421889) and improve the trick to enforce reloading of the left frame if a table diff --git a/db_readdump.php3 b/db_readdump.php3 index 0324e88fa..0aba70c80 100755 --- a/db_readdump.php3 +++ b/db_readdump.php3 @@ -11,8 +11,22 @@ include("lib.inc.php3"); // Bookmark Support -if(!empty($sql_bookmark)) - $sql_query = $sql_bookmark; +// Bookmark Support + +if(!empty($id_bookmark)) { + if(!empty($action_bookmark)) { + switch($action_bookmark) { + case 0: + $sql_query = query_bookmarks($db, $cfgBookmark, $id_bookmark); + break; + case 1: + $sql_query = delete_bookmarks($db, $cfgBookmark, $id_bookmark); + break; + } + } + else + $sql_query = query_bookmarks($db, $cfgBookmark, $id_bookmark); +} // @@ -25,7 +39,7 @@ else if (get_magic_quotes_gpc()) { $pieces = split_string($sql_query, ";"); -if (count($pieces) == 1 && !empty($pieces[0]) && empty($view_bookmark)) { +if (count($pieces) == 1 && !empty($pieces[0]) && empty($action_bookmark)) { $sql_query = addslashes(trim($pieces[0])); // Enforce reloading of the left frame when a table has to be created if (eregi('^CREATE TABLE (.+)', $sql_query)) { diff --git a/sql.php3 b/sql.php3 index a80cf6525..57c3458dc 100755 --- a/sql.php3 +++ b/sql.php3 @@ -59,11 +59,9 @@ else { $sql_query = isset($sql_query) ? stripslashes($sql_query) : ''; $sql_order = isset($sql_order) ? stripslashes($sql_order) : ''; } - if(isset($sessionMaxRows)) + if(isset($sessionMaxRows) ) $cfgMaxRows = $sessionMaxRows; $sql_limit = (isset($pos) && eregi("^SELECT", $sql_query) && !eregi("LIMIT[ 0-9,]+$", $sql_query)) ? " LIMIT $pos, $cfgMaxRows" : ''; - if (!isset($sql_order)) - $sql_order = ''; $result = mysql_db_query($db, $sql_query.$sql_order.$sql_limit); // the same SELECT without LIMIT if(eregi("^SELECT", $sql_query)) @@ -111,12 +109,12 @@ else { // Bookmark Support - if($cfgBookmark['db'] && $cfgBookmark['table'] && $db!=$cfgBookmark['db'] && empty($sql_bookmark)) + if($cfgBookmark['db'] && $cfgBookmark['table'] && $db!=$cfgBookmark['db'] && empty($id_bookmark)) { echo "
\n"; echo "$strOr

\n"; echo $strBookmarkLabel.":\n"; - $goto="sql.php3?server=$server&lang=$lang&db=$db&table=$table&pos=$pos&sql_bookmark=1&sql_query=".urlencode($sql_query); + $goto="sql.php3?server=$server&lang=$lang&db=$db&table=$table&pos=$pos&id_bookmark=1&sql_query=".urlencode($sql_query); ?>