bug #1477576 with rtl langs, navi links open in wrong frame

This commit is contained in:
Sebastian Mendel
2006-07-03 15:01:45 +00:00
parent cd00d5f600
commit 506b3cb938
7 changed files with 38 additions and 45 deletions

View File

@@ -6,8 +6,9 @@ $Id$
$Source$ $Source$
2006-07-03 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2006-07-03 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/footer.inc.php: bug #1477576 with rtl langs, navi links open in * index.php, js\querywindow.js, querywindow.php, libraries\common.lib.php,
wrong frame libraries\footer.inc.php, libraries\sql_query_form.lib.php:
bug #1477576 with rtl langs, navi links open in wrong frame
2006-07-02 Marc Delisle <lem9@users.sourceforge.net> 2006-07-02 Marc Delisle <lem9@users.sourceforge.net>
* db_operations.php: undefined $table when copying a db * db_operations.php: undefined $table when copying a db

View File

@@ -128,6 +128,13 @@ header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
var db = '<?php echo $GLOBALS['db']; ?>'; var db = '<?php echo $GLOBALS['db']; ?>';
var text_dir = '<?php echo $GLOBALS['text_dir']; ?>'; var text_dir = '<?php echo $GLOBALS['text_dir']; ?>';
var pma_absolute_uri = '<?php echo $GLOBALS['cfg']['PmaAbsoluteUri']; ?>'; var pma_absolute_uri = '<?php echo $GLOBALS['cfg']['PmaAbsoluteUri']; ?>';
<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
var frame_content = window.frames[1];
var frame_navigation = window.frames[0];
<?php } else { ?>
var frame_content = window.frames[0];
var frame_navigation = window.frames[1];
<?php } ?>
// ]]> // ]]>
</script> </script>
<script src="./js/querywindow.js" type="text/javascript" language="javascript"> <script src="./js/querywindow.js" type="text/javascript" language="javascript">

View File

@@ -22,7 +22,7 @@ function setDb( new_db ) {
var old_db = db; var old_db = db;
db = new_db; db = new_db;
if ( window.frames[0].document.getElementById(db) == null ) { if ( window.frame_navigation.document.getElementById(db) == null ) {
// db is unknown, reload complete left frame // db is unknown, reload complete left frame
refreshLeft(); refreshLeft();
} else { } else {
@@ -50,7 +50,7 @@ function setTable( new_table ) {
table = new_table; table = new_table;
if ( window.frames[0].document.getElementById( db + '.' + table ) == null if ( window.frame_navigation.document.getElementById( db + '.' + table ) == null
&& table != '' ) { && table != '' ) {
// table is unknown, reload complete left frame // table is unknown, reload complete left frame
refreshLeft(); refreshLeft();
@@ -114,13 +114,13 @@ function removeClass(element, classname)
function unmarkDbTable(db, table) function unmarkDbTable(db, table)
{ {
var element_reference = window.frames[0].document.getElementById(db); var element_reference = window.frame_navigation.document.getElementById(db);
if (element_reference != null) { if (element_reference != null) {
//alert('remove from: ' + db); //alert('remove from: ' + db);
removeClass(element_reference.parentNode, 'marked'); removeClass(element_reference.parentNode, 'marked');
} }
element_reference = window.frames[0].document.getElementById(db + '.' + table); element_reference = window.frame_navigation.document.getElementById(db + '.' + table);
if (element_reference != null) { if (element_reference != null) {
//alert('remove from: ' + db + '.' + table); //alert('remove from: ' + db + '.' + table);
removeClass(element_reference.parentNode, 'marked'); removeClass(element_reference.parentNode, 'marked');
@@ -129,7 +129,7 @@ function unmarkDbTable(db, table)
function markDbTable(db, table) function markDbTable(db, table)
{ {
var element_reference = window.frames[0].document.getElementById(db); var element_reference = window.frame_navigation.document.getElementById(db);
if (element_reference != null) { if (element_reference != null) {
addClass(element_reference.parentNode, 'marked'); addClass(element_reference.parentNode, 'marked');
// scrolldown // scrolldown
@@ -138,7 +138,7 @@ function markDbTable(db, table)
element_reference.blur(); element_reference.blur();
} }
element_reference = window.frames[0].document.getElementById(db + '.' + table); element_reference = window.frame_navigation.document.getElementById(db + '.' + table);
if (element_reference != null) { if (element_reference != null) {
addClass(element_reference.parentNode, 'marked'); addClass(element_reference.parentNode, 'marked');
// scrolldown // scrolldown
@@ -148,7 +148,7 @@ function markDbTable(db, table)
} }
// return to main frame ... // return to main frame ...
window.frames[1].focus(); window.frame_content.focus();
} }
/** /**
@@ -172,8 +172,8 @@ function setAll( new_lang, new_collation_connection, new_server, new_db, new_tab
db = new_db; db = new_db;
table = new_table; table = new_table;
if ( window.frames[0].document.getElementById( db ) == null if ( window.frame_navigation.document.getElementById( db ) == null
&& window.frames[0].document.getElementById( db + '.' + table ) == null ) { && window.frame_navigation.document.getElementById( db + '.' + table ) == null ) {
// table or db is unknown, reload complete left frame // table or db is unknown, reload complete left frame
refreshLeft(); refreshLeft();
} else { } else {
@@ -292,20 +292,12 @@ function refreshQuerywindow( url ) {
function goTo( targeturl, target ) { function goTo( targeturl, target ) {
//alert('goto'); //alert('goto');
if ( target == 'main' ) { if ( target == 'main' ) {
if (text_dir == 'ltr') { target = window.frame_content;
target = window.frames[1];
} else {
target = window.frames[0];
}
} else if ( target == 'query' ) { } else if ( target == 'query' ) {
target = querywindow; target = querywindow;
//return open_querywindow( targeturl ); //return open_querywindow( targeturl );
} else if ( ! target ) { } else if ( ! target ) {
if (text_dir == 'ltr') { target = window.frame_content;
target = window.frames[0];
} else {
target = window.frames[1];
}
} }
if ( target ) { if ( target ) {
@@ -336,8 +328,8 @@ function openDb( new_db ) {
function updateTableTitle( table_link_id, new_title ) { function updateTableTitle( table_link_id, new_title ) {
//alert('updateTableTitle'); //alert('updateTableTitle');
if ( window.parent.frames[0].document.getElementById(table_link_id) ) { if ( window.parent.frame_navigation.document.getElementById(table_link_id) ) {
var left = window.parent.frames[0].document; var left = window.parent.frame_navigation.document;
left.getElementById(table_link_id).title = new_title; left.getElementById(table_link_id).title = new_title;
new_title = left.getElementById('icon_' + table_link_id).alt + ': ' + new_title; new_title = left.getElementById('icon_' + table_link_id).alt + ': ' + new_title;
left.getElementById('browse_' + table_link_id).title = new_title; left.getElementById('browse_' + table_link_id).title = new_title;

View File

@@ -1386,7 +1386,7 @@ if (!defined('PMA_MINIMUM_COMMON')) {
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
//<![CDATA[ //<![CDATA[
if (typeof(window.parent) != 'undefined' if (typeof(window.parent) != 'undefined'
&& typeof(window.parent.frames[0]) != 'undefined') { && typeof(window.parent.frame_navigation) != 'undefined') {
window.parent.goTo('<?php echo $reload_url; ?>'); window.parent.goTo('<?php echo $reload_url; ?>');
} }
//]]> //]]>

View File

@@ -65,26 +65,19 @@ if (window.parent.refreshLeft) {
if (parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) { if (parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) {
self.focus(); self.focus();
} }
<?php } <?php } ?>
if ($GLOBALS['text_dir'] === 'ltr') { if (window.parent.frame_content) {
$mainframe_number = 1;
} else {
$mainframe_number = 0;
}
?>
if (window.parent.frames[<?php echo $mainframe_number; ?>]) {
// reset content frame name, as querywindow needs to set a unique name // reset content frame name, as querywindow needs to set a unique name
// before submitting form data, and navigation frame needs the original name // before submitting form data, and navigation frame needs the original name
if (window.parent.frames[<?php echo $mainframe_number; ?>].name != 'frame_content') { if (window.parent.frame_content.name != 'frame_content') {
window.parent.frames[<?php echo $mainframe_number; ?>].name = 'frame_content'; window.parent.frame_content.name = 'frame_content';
} }
if (window.parent.frames[<?php echo $mainframe_number; ?>].id != 'frame_content') { if (window.parent.frame_content.id != 'frame_content') {
window.parent.frames[<?php echo $mainframe_number; ?>].id = 'frame_content'; window.parent.frame_content.id = 'frame_content';
} }
//window.parent.frames[<?php echo $mainframe_number; ?>].setAttribute('name', 'frame_content'); //window.parent.frame_content.setAttribute('name', 'frame_content');
//window.parent.frames[<?php echo $mainframe_number; ?>].setAttribute('id', 'frame_content'); //window.parent.frame_content.setAttribute('id', 'frame_content');
} }
//]]> //]]>
</script> </script>

View File

@@ -104,9 +104,9 @@ function PMA_sqlQueryForm($query = true, $display_tab = false)
?> ?>
<form method="post" id="sqlqueryform" target="frame_content" <form method="post" id="sqlqueryform" target="frame_content"
action="import.php"<?php echo $enctype; ?> name="sqlform" action="import.php"<?php echo $enctype; ?> name="sqlform"
onsubmit="var save_name = window.opener.parent.frames[1].name; onsubmit="var save_name = window.opener.parent.frame_content.name;
window.opener.parent.frames[1].name = save_name + '<?php echo time(); ?>'; window.opener.parent.frame_content.name = save_name + '<?php echo time(); ?>';
this.target = window.opener.parent.frames[1].name; this.target = window.opener.parent.frame_content.name;
return checkSqlQuery( this );" > return checkSqlQuery( this );" >
<?php <?php
} else { } else {
@@ -223,7 +223,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false)
. '?' . PMA_generate_common_url($db) . '"'; . '?' . PMA_generate_common_url($db) . '"';
if ($is_querywindow) { if ($is_querywindow) {
$strDBLink .= ' target="_self"' $strDBLink .= ' target="_self"'
. ' onclick="this.target=window.opener.frames[1].name"'; . ' onclick="this.target=window.opener.frame_content.name"';
} }
$strDBLink .= '>' $strDBLink .= '>'
. htmlspecialchars($db) . '</a>'; . htmlspecialchars($db) . '</a>';
@@ -248,7 +248,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false)
. '?' . PMA_generate_common_url($db) . '"'; . '?' . PMA_generate_common_url($db) . '"';
if ($is_querywindow) { if ($is_querywindow) {
$strDBLink .= ' target="_self"' $strDBLink .= ' target="_self"'
. ' onclick="this.target=window.opener.frames[1].name"'; . ' onclick="this.target=window.opener.frame_content.name"';
} }
$strDBLink .= '>' $strDBLink .= '>'
. htmlspecialchars($db) . '</a>'; . htmlspecialchars($db) . '</a>';

View File

@@ -56,7 +56,7 @@ require_once('./libraries/header_meta_style.inc.php');
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
//<![CDATA[ //<![CDATA[
function query_auto_commit() { function query_auto_commit() {
document.getElementById( 'sqlqueryform' ).target = window.opener.frames[1].name; document.getElementById( 'sqlqueryform' ).target = window.opener.frame_content.name;
document.getElementById( 'sqlqueryform' ).submit(); document.getElementById( 'sqlqueryform' ).submit();
return; return;
} }