Bookmark : 'delete' option

This commit is contained in:
Armel Fauveau
2001-05-11 00:24:15 +00:00
parent ea3ec15d62
commit 8e3f1e20cf
3 changed files with 23 additions and 8 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-05-11 Armel Fauveau <armel.fauveau@globalis-ms.com>
* Added a "delete" option in the phpMyBookmark patch (Olivier Mueller)
2001-05-10 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* 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

View File

@@ -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)) {

View File

@@ -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 "<form method=\"post\" action=\"tbl_replace.php3\">\n";
echo "<i>$strOr</i><br><br>\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);
?>
<input type="hidden" name="server" value="<?php echo $server;?>">
<input type="hidden" name="lang" value="<?php echo $lang;?>">