refresh left frame also on multiqueries and bookmarks

This commit is contained in:
Sebastian Mendel
2006-02-05 11:22:32 +00:00
parent 0ec11cfc97
commit 395741c929
2 changed files with 16 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ $Source$
* libraries/mult_submits.inc.php, server_databases.php: array to string * libraries/mult_submits.inc.php, server_databases.php: array to string
conversion (sorry to late :-( ), use of $_REQUEST conversion (sorry to late :-( ), use of $_REQUEST
* sql.php: fixed some 'not refreshing left frame' * sql.php: fixed some 'not refreshing left frame'
* import.php: refresh left frame also on multiqueries and bookmarks
2006-02-04 Marc Delisle <lem9@users.sourceforge.net> 2006-02-04 Marc Delisle <lem9@users.sourceforge.net>
* libraries/Config.class.php: bug #1409770 auto-detection and dirname on * libraries/Config.class.php: bug #1409770 auto-detection and dirname on

View File

@@ -10,12 +10,21 @@
require_once('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
// default values
$GLOBALS['reload'] = false;
// Are we just executing plain query or sql file? (eg. non import, but query box/window run) // Are we just executing plain query or sql file? (eg. non import, but query box/window run)
if (!empty($sql_query)) { if (!empty($sql_query)) {
// run SQL query // run SQL query
$import_text = $sql_query; $import_text = $sql_query;
$import_type = 'query'; $import_type = 'query';
$format = 'sql'; $format = 'sql';
// refresh left frame on changes in table or db structure
if (preg_match('/^(CREATE|ALTER|DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) {
$GLOBALS['reload'] = true;
}
unset($sql_query); unset($sql_query);
} elseif (!empty($sql_localfile)) { } elseif (!empty($sql_localfile)) {
// run SQL file on server // run SQL file on server
@@ -113,7 +122,6 @@ $file_to_unlink = '';
$sql_query = ''; $sql_query = '';
$sql_query_disabled = FALSE; $sql_query_disabled = FALSE;
$go_sql = FALSE; $go_sql = FALSE;
$reload = FALSE;
$executed_queries = 0; $executed_queries = 0;
$run_query = TRUE; $run_query = TRUE;
$charset_conversion = FALSE; $charset_conversion = FALSE;
@@ -129,6 +137,12 @@ if (!empty($id_bookmark)) {
if (isset($bookmark_variable) && !empty($bookmark_variable)) { if (isset($bookmark_variable) && !empty($bookmark_variable)) {
$import_text = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $import_text); $import_text = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $import_text);
} }
// refresh left frame on changes in table or db structure
if (preg_match('/^(CREATE|ALTER|DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $import_text)) {
$GLOBALS['reload'] = true;
}
break; break;
case 1: // bookmarked query that have to be displayed case 1: // bookmarked query that have to be displayed
$import_text = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark); $import_text = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);