Skip to content

Commit

Permalink
Should be the fix for Bug #730718. Moved the hashform from the
Browse files Browse the repository at this point in the history
"nav"-frame to the "queryframe"-frame,      altered the way the form is
submitted in LeftFrameLight mode to      keep the queryframe. Only if
JavaScript is usable, otherwise it's      not necessary to keep the 'opener'
pointer.
  • Loading branch information
Garvin Hicking committed May 2, 2003
1 parent 3177fcc commit b2e5dfc
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 10 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Expand Up @@ -18,6 +18,13 @@ $Source$
Patch Tracker #709383 for further information.
* libraries/display_tbl.lib.php3: Bug #728813 (title for
relations when foreign_db != master_db)
* index.php3, left.php3, tbl_query_box.php3, db_details_common.php3,
main.php3, queryframe.php3, libraries/common.lib.php3: Should be
the fix for Bug #730718.
Moved the hashform from the "nav"-frame to the "queryframe"-frame,
altered the way the form is submitted in LeftFrameLight mode to
keep the queryframe. Only if JavaScript is usable, otherwise it's
not necessary to keep the 'opener' pointer.

2003-04-30 Marc Delisle <lem9@users.sourceforge.net>
* pdf_schema.php3, bug 729517, better comment output,
Expand Down
2 changes: 1 addition & 1 deletion db_details_common.php3
Expand Up @@ -47,7 +47,7 @@ if (!isset($message)) {
?>
<script type="text/javascript" language="javascript1.2">
<!--
window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url($db, '', '&'); ?>&hash=' + window.parent.frames['nav'].document.hashform.hash.value);
window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url($db, '', '&'); ?>');
//-->
</script>
<?php
Expand Down
2 changes: 1 addition & 1 deletion index.php3
Expand Up @@ -82,7 +82,7 @@ $phpmain_hash_js = time();
<?php
} else {
?>
<frame src="left.php3?<?php echo $url_query; ?>&amp;hash=<?php echo $phpmain_hash; ?>" name="nav" frameborder="0" />
<frame src="left.php3?<?php echo $url_query; ?>&amp;hash=' . $phpmain_hash . '" name="nav" frameborder="0" />
<?php
}
?>
Expand Down
30 changes: 26 additions & 4 deletions left.php3
Expand Up @@ -8,6 +8,10 @@
* been defined as startup option and include a core library
*/
require('./libraries/grab_globals.lib.php3');
if (isset($lightm_db) && !empty($lightm_db)) {
$db = urldecode($lightm_db);
}

if (!empty($db)) {
$db_start = $db;
}
Expand Down Expand Up @@ -61,6 +65,19 @@ PMA_setFontSizes();
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> target="phpmain<?php echo $hash; ?>" />

<script type="text/javascript" language="javascript">
<!--
<?php
if (isset($lightm_db) && !empty($lightm_db)) {
?>
window.parent.frames['phpmain<?php echo $hash; ?>'].location.replace('./<?php echo $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&');?>');
<?php
}
?>
//-->
</script>

<?php
// Expandable/collapsible databases list is only used if there is more than one
// database to display
Expand Down Expand Up @@ -155,8 +172,16 @@ if ($num_dbs > 1) {

// Light mode -> beginning of the select combo for databases
if ($cfg['LeftFrameLight']) {
echo ' <form method="post" action="index.php3" name="left" target="_parent">' . "\n";
?>
<script type="text/javascript" language="javascript">
document.writeln('<form method="post" action="left.php3" name="left" target="nav">');
</script>
<noscript>
<form method="post" action="index.php3" name="left" target="_parent">
</noscript>
<?php
echo PMA_generate_common_hidden_inputs();
echo ' <input type="hidden" name="hash" value="' . $hash . '" />' . "\n";
echo ' <select name="lightm_db" onchange="this.form.submit()">' . "\n";
echo ' <option value="">(' . $strDatabases . ') ...</option>' . "\n";
$table_list = '';
Expand Down Expand Up @@ -439,9 +464,6 @@ else {
echo "\n";
?>

<form name="hashform" action="left.php3">
<input type="hidden" name="hash" value="<?php echo $hash; ?>">
</form>
</body>
</html>

Expand Down
2 changes: 1 addition & 1 deletion libraries/common.lib.php3
Expand Up @@ -1267,7 +1267,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
<!--
if (typeof(window.parent) != 'undefined'
&& typeof(window.parent.frames['nav']) != 'undefined') {
window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>&hash=' + window.parent.frames['nav'].document.hashform.hash.value);
window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
}
//-->
</script>
Expand Down
2 changes: 1 addition & 1 deletion main.php3
Expand Up @@ -43,7 +43,7 @@ else if (isset($reload) && $reload) {
?>
<script type="text/javascript" language="javascript1.2">
<!--
window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url('', '', '&'); ?>&hash=' + window.parent.frames['nav'].document.hashform.hash.value);
window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url('', '', '&');?>');
//-->
</script>
<?php
Expand Down
3 changes: 3 additions & 0 deletions queryframe.php3
Expand Up @@ -104,6 +104,9 @@ document.writeln('<a href="<?php echo $href; ?>" <?php echo $target . ' ' . $onc
</noscript>
</center>

<form name="hashform" action="queryframe.php3">
<input type="hidden" name="hash" value="<?php echo $hash; ?>">
</form>
</body>
</html>

Expand Down
4 changes: 2 additions & 2 deletions tbl_query_box.php3
Expand Up @@ -81,7 +81,7 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
?>
<script type="text/javascript">
<!--
document.writeln('<form method="post" target="phpmain' + <?php echo ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) ? 'opener.' : ''); ?>top.frames.nav.document.hashform.hash.value + '" action="read_dump.php3"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; ?> onsubmit="return checkSqlQuery(this)" name="sqlform">');
document.writeln('<form method="post" target="phpmain' + <?php echo ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) ? 'opener.' : '');?>top.frames.queryframe.document.hashform.hash.value + '" action="read_dump.php3"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; ?> onsubmit="return checkSqlQuery(this)" name="sqlform">');
//-->
</script>
<noscript>
Expand Down Expand Up @@ -297,7 +297,7 @@ if (!isset($is_inside_querywindow) ||
?>

<script type="text/javascript">
document.writeln('<div style="margin-bottom: 10px"><a href="<?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? '#' : $ldi_target); ?>" <?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? 'onclick="opener.top.frames.phpmain\' + opener.top.frames.nav.document.hashform.hash.value + \'.location.href = \\\'' . $ldi_target . '\\\'; return false;"' : ''); ?>><?php echo addslashes($strInsertTextfiles); ?></a></div>');
document.writeln('<div style="margin-bottom: 10px"><a href="<?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? '#' : $ldi_target); ?>" <?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? 'onclick="opener.top.frames.phpmain\' + opener.top.frames.queryframe.document.hashform.hash.value + \'.location.href = \\\'' . $ldi_target . '\\\'; return false;"' : ''); ?>><?php echo addslashes($strInsertTextfiles); ?></a></div>');
</script>

<?php
Expand Down

0 comments on commit b2e5dfc

Please sign in to comment.