From 3807799d22793e5163687ac1146fdd5f2ddb9fa7 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Sat, 15 Nov 2008 18:12:40 +0000 Subject: [PATCH] minor fix for r43517: float tables to the right on RTL wikis --- includes/specials/SpecialSearch.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 46e64e5e2e..83b855bc9b 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -586,7 +586,7 @@ class SpecialSearch { * @return $out string: HTML form */ function powerSearchBox( $term ) { - global $wgScript; + global $wgScript, $wgContLang; $namespaces = SearchEngine::searchableNamespaces(); @@ -613,11 +613,16 @@ class SpecialSearch { // be arranged nicely while still accommodating different screen widths $rowsPerTable = 3; // seems to look nice + // float to the right on RTL wikis + $tableStyle = ( $wgContLang->isRTL() ? + 'float: right; margin: 0 0 1em 1em' : + 'float: left; margin: 0 1em 1em 0' ); + $tables = ""; for( $i = 0; $i < $numRows; $i += $rowsPerTable ) { - $tables .= Xml::openElement( 'table', array( 'style' => 'float: left; margin: 0 1em 1em 0' ) ); + $tables .= Xml::openElement( 'table', array( 'style' => $tableStyle ) ); for( $j = $i; $j < $i + $rowsPerTable && $j < $numRows; $j++ ) { - $tables .= Xml::openElement( 'tr' ) . "\n" . $rows[$j] . Xml::closeElement( 'tr' ); + $tables .= "\n" . $rows[$j] . ""; } $tables .= Xml::closeElement( 'table' ) . "\n"; } @@ -635,7 +640,7 @@ class SpecialSearch { wfMsgExt( 'powersearch-ns', array( 'parseinline' ) ) . "

\n" . $tables . - "
\n" . + "
\n" . "

" . $redirect . " " . $redirectLabel . "

\n" . -- 2.20.1