From: Ilmari Karonen
Date: Sat, 15 Nov 2008 18:12:40 +0000 (+0000)
Subject: minor fix for r43517: float tables to the right on RTL wikis
X-Git-Tag: 1.31.0-rc.0~44330
X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=3807799d22793e5163687ac1146fdd5f2ddb9fa7;p=lhc%2Fweb%2Fwiklou.git
minor fix for r43517: float tables to the right on RTL wikis
---
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" .