read_dump.php3: Bug #741256

footer.inc.php, tbl_query_box.php3: Only focus the mainframe
when a query was submitted from the query window
This commit is contained in:
Garvin Hicking
2003-05-24 14:01:37 +00:00
parent 644dc7c90a
commit 5682bac991
4 changed files with 42 additions and 5 deletions

View File

@@ -12,6 +12,9 @@ $Source$
2003-05-24 Garvin Hicking <me@supergarv.de>
* left.php3: Fix bug #742632, thanks to Kai Butchkau!
* read_dump.php3: Bug #741256
* footer.inc.php, tbl_query_box.php3: Only focus the mainframe
when a query was submitted from the query window
2003-05-23 Marc Delisle <lem9@users.sourceforge.net>
* libraries/sqlparser.lib.php3: bug 653964: wrong alias set by

View File

@@ -80,7 +80,16 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
}
reload_querywindow();
self.focus();
<?php
if (isset($focus_querywindow) && $focus_querywindow == "true") {
?>
if (top.frames.queryframe && top.frames.queryframe.querywindow && !top.frames.queryframe.querywindow.closed && top.frames.queryframe.querywindow.location) {
self.focus();
}
<?php
}
?>
//-->
</script>
<?php
@@ -127,4 +136,4 @@ if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
PMA_outBufferPost($GLOBALS['ob_mode']);
}
?>
?>

View File

@@ -27,7 +27,7 @@ if (!isset($goto) || !eregi('^(db_details|tbl_properties)(_[a-z]*)?\.php3$', $go
}
$err_url = $goto
. '?' . PMA_generate_common_url($db)
. (($goto == 'tbl_properties.php3') ? '&amp;table=' . urlencode($table) : '');
. (eregi('^tbl_properties(_[a-z]*)?\.php3$', $goto) ? '&amp;table=' . urlencode($table) : '');
/**
@@ -225,7 +225,7 @@ if ($sql_query != '') {
if (isset($my_die)) {
$js_to_run = 'functions.js';
include('./header.inc.php3');
PMA_mysqlDie('', $my_die, '', $err_url);
PMA_mysqlDie('', $my_die, '', $err_url . '&TEST');
}

View File

@@ -107,6 +107,13 @@ if (!isset($is_inside_querywindow) ||
(isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'sql' || $querydisplay_tab == 'full'))) {
?>
<!-- Query box and bookmark support -->
<?php
if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
?>
<input type="hidden" name="focus_querywindow" value="true" />
<?php
}
?>
<a name="querybox"></a>
<table cellpadding="1" cellspacing="1">
<tr>
@@ -153,6 +160,12 @@ if ($is_upload && (!isset($is_inside_querywindow) ||
<div style="margin-bottom: 5px">
<input type="file" name="sql_file" class="textfield" /><br />
<?php
if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
?>
<input type="hidden" name="focus_querywindow" value="true" />
<?php
}
$is_gzip = ($cfg['GZipDump'] && @function_exists('gzopen'));
$is_bzip = ($cfg['BZipDump'] && @function_exists('bzdecompress'));
if ($is_bzip || $is_gzip) {
@@ -190,6 +203,12 @@ if ($cfg['UploadDir'] != '' && !isset($is_inside_querywindow) ||
($cfg['UploadDir'] != '' && isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'files' || $querydisplay_tab == 'full')) && isset($db) && $db != '') {
if ($handle = @opendir($cfg['UploadDir'])) {
if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
?>
<input type="hidden" name="focus_querywindow" value="true" />
<?php
}
$is_first = 0;
while ($file = @readdir($handle)) {
if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.sql') {
@@ -259,6 +278,12 @@ if (!isset($is_inside_querywindow) ||
if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
echo " " . ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && $querydisplay_tab == 'full') || !isset($is_inside_querywindow) ? "<i>$strOr</i>" : '') . " $strBookmarkQuery&nbsp;:<br />\n";
if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
?>
<input type="hidden" name="focus_querywindow" value="true" />
<?php
}
echo ' <div style="margin-bottom: 5px">' . "\n";
echo ' <select name="id_bookmark" style="vertical-align: middle">' . "\n";
echo ' <option value=""></option>' . "\n";
@@ -287,7 +312,7 @@ if (!isset($is_inside_querywindow) ||
(isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'files' || $querydisplay_tab == 'full')) && isset($db) && $db != '') {
// loic1: displays import dump feature only if file upload available
$ldi_target = 'ldi_table.php3?' . $url_query;
$ldi_target = 'ldi_table.php3?' . $url_query . (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? '&amp;focus_querywindow=true' : '');
if ($is_upload && isset($db) && isset($table)) {
?>