diff options
author | Sebastian Mendel <cybot_tm@users.sourceforge.net> | 2006-02-05 14:22:32 +0300 |
---|---|---|
committer | Sebastian Mendel <cybot_tm@users.sourceforge.net> | 2006-02-05 14:22:32 +0300 |
commit | 395741c9299fd5c0d23f20a3920e1d3f5ac40678 (patch) | |
tree | 17427a3065294d2090f5e75c2aab274b9b3a5c71 /import.php | |
parent | 0ec11cfc975898c5a16d23fc19d31e79f32ca9b0 (diff) |
refresh left frame also on multiqueries and bookmarks
Diffstat (limited to 'import.php')
-rw-r--r-- | import.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/import.php b/import.php index d9532d3bd7..d749081c6d 100644 --- a/import.php +++ b/import.php @@ -10,12 +10,21 @@ require_once('./libraries/common.lib.php'); $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) if (!empty($sql_query)) { // run SQL query $import_text = $sql_query; $import_type = 'query'; $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); } elseif (!empty($sql_localfile)) { // run SQL file on server @@ -113,7 +122,6 @@ $file_to_unlink = ''; $sql_query = ''; $sql_query_disabled = FALSE; $go_sql = FALSE; -$reload = FALSE; $executed_queries = 0; $run_query = TRUE; $charset_conversion = FALSE; @@ -129,6 +137,12 @@ if (!empty($id_bookmark)) { if (isset($bookmark_variable) && !empty($bookmark_variable)) { $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; case 1: // bookmarked query that have to be displayed $import_text = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark); |