fixed some rtl lang issues

This commit is contained in:
Sebastian Mendel
2005-11-03 17:50:09 +00:00
parent 7f01edcc9b
commit fb923f851a
3 changed files with 44 additions and 25 deletions

View File

@@ -14,6 +14,8 @@ $Source$
fixed different font sizes fixed different font sizes
* footer.inc.php, libraries/dbg/*: * footer.inc.php, libraries/dbg/*:
use $GLOBALS as this scripts can be included from inside a function use $GLOBALS as this scripts can be included from inside a function
* left.php, libraries/common.lib.php:
fixed some rtl lang issues
2005-11-02 Michal Čihař <michal@cihar.com> 2005-11-02 Michal Čihař <michal@cihar.com>
* config.default.php: This is not a configuration file. * config.default.php: This is not a configuration file.

View File

@@ -6,18 +6,13 @@
*/ */
/** /**
* Gets the variables sent to this script, retains the db name that may have * Gets a core script and starts output buffering work
* been defined as startup option and include a core library
*/ */
require_once('./libraries/grab_globals.lib.php'); require_once('./libraries/common.lib.php');
// free the session file, for the other frames to be loaded // free the session file, for the other frames to be loaded
session_write_close(); session_write_close();
/**
* Gets a core script and starts output buffering work
*/
require_once('./libraries/common.lib.php');
require_once('./libraries/ob.lib.php'); require_once('./libraries/ob.lib.php');
if ($GLOBALS['cfg']['OBGzip']) { if ($GLOBALS['cfg']['OBGzip']) {
$ob_mode = PMA_outBufferModeGet(); $ob_mode = PMA_outBufferModeGet();
@@ -160,8 +155,7 @@ if ( $num_dbs === 0 ) {
.'</div>' . "\n"; .'</div>' . "\n";
unset( $_location ); unset( $_location );
} }
?> ?>
<!-- Databases and tables list -->
<div id="left_tableList"> <div id="left_tableList">
<?php <?php
// Don't display expansible/collapsible database info if: // Don't display expansible/collapsible database info if:
@@ -288,7 +282,7 @@ function PMA_displayDbList( $ext_dblist ) {
echo '</a>'; echo '</a>';
// ... and we need to refresh both frames on db selection // ... and we need to refresh both frames on db selection
?> ?>
<a class="item" <a class="item"
id="<?php echo htmlspecialchars( $db['name'] ); ?>" id="<?php echo htmlspecialchars( $db['name'] ); ?>"
href="index.php?<?php echo $common_url_query; ?>" href="index.php?<?php echo $common_url_query; ?>"
@@ -300,20 +294,34 @@ function PMA_displayDbList( $ext_dblist ) {
window.parent.goTo( './<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] window.parent.goTo( './<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
. '?' . $common_url_query; ?>', 'main' ); . '?' . $common_url_query; ?>', 'main' );
return false;"> return false;">
<?php echo htmlspecialchars( $db['disp_name'] ); ?> <?php
(<?php echo $db['num_tables']; ?>) if ( $GLOBALS['text_dir'] === 'rtl' ) {
echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
}
echo htmlspecialchars( $db['disp_name'] );
if ( $GLOBALS['text_dir'] === 'ltr' ) {
echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
}
?>
</a> </a>
<?php <?php
} else { } else {
// with only 1 db available we dont need to refresh left frame // with only 1 db available we dont need to refresh left frame
// on db selection, only phpmain // on db selection, only phpmain
?> ?>
<a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
. '?' . $common_url_query; ?>" . '?' . $common_url_query; ?>"
id="<?php echo htmlspecialchars( $db['name'] ); ?>" id="<?php echo htmlspecialchars( $db['name'] ); ?>"
title="<?php echo htmlspecialchars( $db['comment'] ); ?>"> title="<?php echo htmlspecialchars( $db['comment'] ); ?>">
<?php echo htmlspecialchars( $db['disp_name'] ); ?> <?php
(<?php echo $db['num_tables']; ?>) if ( $GLOBALS['text_dir'] === 'rtl' ) {
echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
}
echo htmlspecialchars( $db['disp_name'] );
if ( $GLOBALS['text_dir'] === 'ltr' ) {
echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
}
?>
</a> </a>
<?php <?php
} }
@@ -410,8 +418,7 @@ function PMA_displayTableList( $tables, $visible = false,
printf( $img_plus, $element_counter ); printf( $img_plus, $element_counter );
} }
echo '</a>'; echo '</a>';
?>
?>
<a href="index.php?<?php echo $common_url_query; ?>" <a href="index.php?<?php echo $common_url_query; ?>"
target="_parent" target="_parent"
onclick=" onclick="
@@ -420,8 +427,15 @@ function PMA_displayTableList( $tables, $visible = false,
window.parent.goTo( './<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] window.parent.goTo( './<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
. '?' . $common_url_query; ?>', 'main' ); . '?' . $common_url_query; ?>', 'main' );
return false;"> return false;">
<?php echo htmlspecialchars( substr( $group, 0, strlen( $group ) - strlen( $sep ) ) ); ?> <?php
(<?php echo $table['tab_count']; ?>) if ( $GLOBALS['text_dir'] === 'rtl' ) {
echo ' <bdo dir="ltr">(' . $table['tab_count'] . ')</bdo> ';
}
echo htmlspecialchars( substr( $group, 0, strlen( $group ) - strlen( $sep ) ) );
if ( $GLOBALS['text_dir'] === 'ltr' ) {
echo ' <bdo dir="ltr">(' . $table['tab_count'] . ')</bdo> ';
}
?>
</a> </a>
<?php <?php
@@ -472,9 +486,9 @@ function PMA_displayTableList( $tables, $visible = false,
echo '</li>' . "\n"; echo '</li>' . "\n";
} }
} }
echo '</ul>' . "\n"; echo '</ul>';
} }
?> ?>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -898,9 +898,12 @@ function PMA_getDbList() {
*/ */
function PMA_getHtmlSelectDb( $selected = '' ) { function PMA_getHtmlSelectDb( $selected = '' ) {
$dblist = PMA_getDbList(); $dblist = PMA_getDbList();
$return = '<select name="db" id="lightm_db"' // TODO: IE can not handle different text directions in select boxes
// so, as mostly names will be in english, we set the whole selectbox to LTR
// and EN
$return = '<select name="db" id="lightm_db" xml:lang="en" dir="ltr"'
.' onchange="window.parent.openDb( this.value );">' . "\n" .' onchange="window.parent.openDb( this.value );">' . "\n"
.'<option value="">(' . $GLOBALS['strDatabases'] . ') ...</option>' .'<option value="" dir="' . $GLOBALS['text_dir'] . '">(' . $GLOBALS['strDatabases'] . ') ...</option>'
."\n"; ."\n";
foreach( $dblist as $group => $dbs ) { foreach( $dblist as $group => $dbs ) {
if ( count( $dbs ) > 1 ) { if ( count( $dbs ) > 1 ) {
@@ -913,8 +916,8 @@ function PMA_getHtmlSelectDb( $selected = '' ) {
$cut = false; $cut = false;
} }
foreach( $dbs as $db ) { foreach( $dbs as $db ) {
$return .= '<option value="' . $db['name'] . '" ' $return .= '<option value="' . $db['name'] . '"'
.'title="' . $db['comment'] . '"'; .' title="' . $db['comment'] . '"';
if ( $db['name'] == $selected ) { if ( $db['name'] == $selected ) {
$return .= ' selected="selected"'; $return .= ' selected="selected"';
} }