From 0b477e9c03473609595696b403860650a32e89a4 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Thu, 20 Oct 2005 08:16:27 +0000 Subject: [PATCH] refresh left frame on view creation --- ChangeLog | 3 +++ footer.inc.php | 28 +++++++++++++++------------- sql.php | 8 ++++---- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcd4c67d4..219faaebb 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-10-19 Sebastian Mendel + * sql.php, footer.inc.php: refresh left frame on view creation + 2005-10-19 Alexander M. Turek * lang/*.inc.php, libraries/mysql_charsets.lib.php: Correct description for collations utf8_esperanto_ci, ucs2_esperanto_ci. diff --git a/footer.inc.php b/footer.inc.php index 3a7dc3c83..7f44259b5 100644 --- a/footer.inc.php +++ b/footer.inc.php @@ -21,14 +21,18 @@ if ( $cfg['QueryFrame'] && $cfg['QueryFrameJS'] ) { - // sets selection in left frame quick db selectbox to current db - window.parent.setAll( '', '', '', '', '' ); + window.parent.setAll( '', '', '', '', '' ); + + window.parent.refreshLeft(); - - window.parent.reload_querywindow( - "", - "", - "" ); + window.parent.reload_querywindow( + "", + "", + "" ); - - if ( parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) { - self.focus(); - } + if ( parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) { + self.focus(); + } diff --git a/sql.php b/sql.php index 9ae07827a..5a9d91cf5 100644 --- a/sql.php +++ b/sql.php @@ -147,7 +147,7 @@ if ($is_select) { $db = $prev_db; } // Nijel: don't change reload, if we already decided to reload in import - if (!isset($reload) || $reload == 0) { + if ( empty( $reload ) ) { $reload = ($db == $prev_db) ? 0 : 1; } } @@ -270,9 +270,9 @@ else { // A table has to be created or renamed -> left frame should be reloaded // TODO: use the parser/analyzer - if ((!isset($reload) || $reload == 0) - && (preg_match('@^CREATE TABLE[[:space:]]+(.*)@i', $sql_query) - || preg_match('@^ALTER TABLE[[:space:]]+(.*)RENAME@i', $sql_query))) { + if ( empty( $reload ) + && (preg_match('@^CREATE (VIEW|TABLE)\s+@i', $sql_query) + || preg_match('@^ALTER TABLE\s+.*RENAME@i', $sql_query))) { $reload = 1; } // Gets the number of rows per page