r43561 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43560‎ | r43561 | r43562 >
Date:18:12, 15 November 2008
Author:vyznev
Status:ok
Tags:
Comment:
minor fix for r43517: float tables to the right on RTL wikis
Modified paths:
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -586,7 +586,7 @@
587587 * @return $out string: HTML form
588588 */
589589 function powerSearchBox( $term ) {
590 - global $wgScript;
 590+ global $wgScript, $wgContLang;
591591
592592 $namespaces = SearchEngine::searchableNamespaces();
593593
@@ -613,11 +613,16 @@
614614 // be arranged nicely while still accommodating different screen widths
615615 $rowsPerTable = 3; // seems to look nice
616616
 617+ // float to the right on RTL wikis
 618+ $tableStyle = ( $wgContLang->isRTL() ?
 619+ 'float: right; margin: 0 0 1em 1em' :
 620+ 'float: left; margin: 0 1em 1em 0' );
 621+
617622 $tables = "";
618623 for( $i = 0; $i < $numRows; $i += $rowsPerTable ) {
619 - $tables .= Xml::openElement( 'table', array( 'style' => 'float: left; margin: 0 1em 1em 0' ) );
 624+ $tables .= Xml::openElement( 'table', array( 'style' => $tableStyle ) );
620625 for( $j = $i; $j < $i + $rowsPerTable && $j < $numRows; $j++ ) {
621 - $tables .= Xml::openElement( 'tr' ) . "\n" . $rows[$j] . Xml::closeElement( 'tr' );
 626+ $tables .= "<tr>\n" . $rows[$j] . "</tr>";
622627 }
623628 $tables .= Xml::closeElement( 'table' ) . "\n";
624629 }
@@ -635,7 +640,7 @@
636641 wfMsgExt( 'powersearch-ns', array( 'parseinline' ) ) .
637642 "</p>\n" .
638643 $tables .
639 - "<hr style=\"clear: left;\" />\n" .
 644+ "<hr style=\"clear: both\" />\n" .
640645 "<p>" .
641646 $redirect . " " . $redirectLabel .
642647 "</p>\n" .

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r43517make the layout of the namespace checkboxes in powerSearchBox() look nicervyznev01:18, 15 November 2008

Status & tagging log