update row count in left frame bug #1243908

This commit is contained in:
Sebastian Mendel
2005-10-18 10:00:46 +00:00
parent 071a068442
commit 889b2e9f2e
6 changed files with 31 additions and 20 deletions

View File

@@ -7,6 +7,8 @@ $Source$
2005-10-18 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* querywindow.php: wrong handling of linebreaks in query: bug #1243888
* left.php, sql.php, tbl_change.php, libraries/common.lib.php,
libraries/querywindow.js: update row count in left frame bug #1243908
2005-10-17 Michal Čihař <michal@cihar.com>
* lang/czech: Translation fixes.

View File

@@ -178,9 +178,9 @@ if ( $num_dbs === 0 ) {
// within left.php. With no JS (<noscript>) the whole frameset will
// be rebuilt with the new target frame.
$img_plus = '<img id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
$img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
.' width="9" height="9" alt="+" />';
$img_minus = '<img id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
$img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
.' width="9" height="9" alt="-" />';
$href_left = '<a onclick="if ( toggle(\'%d\') ) return false;"'
@@ -450,17 +450,19 @@ function PMA_displayTableList( $tables, $visible = false,
echo '<a title="' . $GLOBALS['strBrowse'] . ': '
. htmlspecialchars( $table['Comment'] )
.' (' . $table['Rows'] . ' ' . $GLOBALS['strRows'] . ')"'
.' id="' . htmlspecialchars( $table_db . '.' . $table['Name'] ) . '"'
.' id="browse_' . htmlspecialchars( $table_db . '.' . $table['Name'] ) . '"'
.' href="sql.php?' . $GLOBALS['common_url_query']
.'&amp;table=' . urlencode( $table['Name'] )
.'&amp;goto=' . $GLOBALS['cfg']['DefaultTabTable']
.'&amp;sql_query=' . urlencode('SELECT * FROM `'
. $table['Name'] . '`') . '" '
.' >'
.'<img src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"'
.' width="10" height="10" alt="*" /></a>' . "\n"
.'<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"'
.' id="icon_' . htmlspecialchars( $table_db . '.' . $table['Name'] ) . '"'
.' width="10" height="10" alt="' . $GLOBALS['strBrowse'] . '" /></a>' . "\n"
.'<a href="' . $href . '" title="' . $table['Comment']
.' (' . $table['Rows'] . ' ' . $GLOBALS['strRows'] . ')">'
.' (' . $table['Rows'] . ' ' . $GLOBALS['strRows'] . ')"'
.' id="' . htmlspecialchars( $table_db . '.' . $table['Name'] ) . '">'
. htmlspecialchars( $table['disp_name'] ) . '</a>';
echo '</li>' . "\n";
}

View File

@@ -1837,7 +1837,7 @@ if ($is_minimum_common == FALSE) {
echo "\n";
$reload_url = './left.php?' . PMA_generate_common_url((isset($GLOBALS['db']) ? $GLOBALS['db'] : ''), '', '&');
?>
<script type="text/javascript" language="javascript1.2">
<script type="text/javascript">
//<![CDATA[
if (typeof(window.parent) != 'undefined'
&& typeof(window.parent.frames[0]) != 'undefined') {
@@ -1876,19 +1876,12 @@ if (typeof(window.parent) != 'undefined'
: $tbl_status['Comment'] . ' ';
$tooltip .= '(' . $tbl_status['Rows'] . ' ' . $GLOBALS['strRows'] . ')';
PMA_DBI_free_result($result);
$uni_tbl = PMA_jsFormat( $GLOBALS['db'] . '.' . $GLOBALS['table'] );
$uni_tbl = PMA_jsFormat( $GLOBALS['db'] . '.' . $GLOBALS['table'], false );
echo "\n";
?>
<script type="text/javascript" language="javascript1.2">
<script type="text/javascript">
//<![CDATA[
if (typeof(document.getElementById) != 'undefined'
&& typeof(window.parent.frames[0]) != 'undefined'
&& typeof(window.parent.frames[0].document) != 'undefined' && typeof(window.parent.frames[0].document) != 'unknown'
&& (window.parent.frames[0].document.getElementById('<?php echo $uni_tbl; ?>'))
&& typeof(window.parent.frames[0].document.getElementById('<?php echo $uni_tbl; ?>')) != 'undefined'
&& typeof(window.parent.frames[0].document.getElementById('<?php echo $uni_tbl; ?>').title) == 'string') {
window.parent.frames[0].document.getElementById('<?php echo $uni_tbl; ?>').title = '<?php echo PMA_jsFormat($tooltip, FALSE); ?>';
}
window.parent.updateTableTitle( '<?php echo $uni_tbl; ?>', '<?php echo PMA_jsFormat($tooltip, false); ?>' );
//]]>
</script>
<?php

View File

@@ -2,6 +2,7 @@ var querywindow = '';
// sets current selected table (called from footer.inc.php)
function setTable( new_db, new_table ) {
//alert('setTable');
if ( new_db != db || new_table != table ) {
// table or db has changed
@@ -90,6 +91,7 @@ function refreshQuerywindow( url ) {
}
function goTo( targeturl, target ) {
//alert('goto');
if ( target == 'main' ) {
target = window.frames[1];
} else if ( target == 'query' ) {
@@ -118,7 +120,21 @@ function goTo( targeturl, target ) {
// opens selected db in main frame
function openDb( db ) {
//alert('opendb');
goTo( opendb_url + '?' + common_query + '&db=' + db,
window.parent.frames[1] );
return true;
}
function updateTableTitle( table_link_id, new_title ) {
//alert('updateTableTitle');
if ( window.parent.frames[0].document.getElementById(table_link_id) ) {
var left = window.parent.frames[0].document;
left.getElementById(table_link_id).title = new_title;
new_title = left.getElementById('icon_' + table_link_id).alt + ': ' + new_title;
left.getElementById('browse_' + table_link_id).title = new_title;
return true;
}
return false;
}

View File

@@ -272,8 +272,7 @@ else {
if ((!isset($reload) || $reload == 0)
&& (preg_match('@^CREATE TABLE[[:space:]]+(.*)@i', $sql_query)
|| preg_match('@^ALTER TABLE[[:space:]]+(.*)RENAME@i', $sql_query)
|| preg_match('@^TRUNCATE@i', $sql_query))) {
|| preg_match('@^ALTER TABLE[[:space:]]+(.*)RENAME@i', $sql_query))) {
$reload = 1;
}
// Gets the number of rows per page

View File

@@ -183,7 +183,6 @@ document.onkeydown = onKeyDownArrowsHandler;
<input type="hidden" name="dontlimitchars" value="<?php echo (isset($dontlimitchars) ? $dontlimitchars : 0); ?>" />
<input type="hidden" name="err_url" value="<?php echo urlencode($err_url); ?>" />
<input type="hidden" name="sql_query" value="<?php echo isset($sql_query) ? urlencode($sql_query) : ''; ?>" />
<input type="hidden" name="reload" value="1" />
<?php
if (isset($primary_key_array)) {
foreach ($primary_key_array AS $primary_key) {