From 961b26755cd7b8ac24cd86ebfd1482469604b0ee Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 9 Jul 2003 04:57:32 +0000 Subject: [PATCH] Fix sidebar spacing for right-to-left languages --- includes/Skin.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 7f68821632..2360bed567 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -187,7 +187,7 @@ class Skin { function doBeforeContent() { - global $wgUser, $wgOut, $wgTitle; + global $wgUser, $wgOut, $wgTitle, $wgLang; wfProfileIn( "Skin::doBeforeContent" ); $s = ""; @@ -205,10 +205,14 @@ class Skin { $s .= "\n
\n
" . ""; - if ( 0 == $qb ) { + $shove = ($qb != 0); + $left = ($qb == 1 || $qb == 3); + if($wgLang->isRTL()) $left = !$left; + + if ( !$shove ) { $s .= ""; - } else if ( 1 == $qb || 3 == $qb ) { # Left + } elseif( $left ) { $s .= $this->getQuickbarCompensator( $rows ); } $s .= "\n"; } - if ( 2 == $qb ) { # Right + if ( $shove && !$left ) { # Right $s .= $this->getQuickbarCompensator( $rows ); } $s .= "
" . $this->logoText() . ""; @@ -224,7 +228,7 @@ class Skin { $s .= "
$langlinks
\n
\n"; @@ -266,7 +270,7 @@ class Skin { function doAfterContent() { - global $wgUser, $wgOut; + global $wgUser, $wgOut, $wgLang; wfProfileIn( "Skin::doAfterContent" ); $s = "\n

\n"; @@ -275,7 +279,11 @@ class Skin { $s .= ""; $qb = $this->qbSetting(); - if ( 1 == $qb || 3 == $qb ) { # Left + $shove = ($qb != 0); + $left = ($qb == 1 || $qb == 3); + if($wgLang->isRTL()) $left = !$left; + + if ( $shove && $left ) { # Left $s .= $this->getQuickbarCompensator(); } $s .= ""; - if ( 2 == $qb ) { # Right + if ( $shove && !$left ) { # Right $s .= $this->getQuickbarCompensator(); } $s .= "
"; @@ -288,7 +296,7 @@ class Skin { . "
" . $this->pageStats(); $s .= "
\n\n\n"; -- 2.20.1