http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97657
Revision: 97657
Author: robin
Date: 2011-09-20 19:47:57 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
Fix support of legacy skins Standard & CologneBlue for user language direction:
the topbar and footer used a "quickbar compensator" which relied on the topbar
and footer following the content language direction.
Therefore it's easier to do it via CSS (which simplifies PHP code).
See also bug 31031.
Modified Paths:
--------------
trunk/phase3/includes/SkinLegacy.php
trunk/phase3/skins/CologneBlue.php
trunk/phase3/skins/Standard.php
Modified: trunk/phase3/includes/SkinLegacy.php
===================================================================
--- trunk/phase3/includes/SkinLegacy.php 2011-09-20 19:39:17 UTC (rev
97656)
+++ trunk/phase3/includes/SkinLegacy.php 2011-09-20 19:47:57 UTC (rev
97657)
@@ -90,11 +90,10 @@
}
function doBeforeContent() {
- global $wgContLang;
+ global $wgLang;
wfProfileIn( __METHOD__ );
$s = '';
- $qb = $this->getSkin()->qbSetting();
$langlinks = $this->otherLanguages();
if ( $langlinks ) {
@@ -107,25 +106,20 @@
}
$s .= "\n<div id='content'>\n<div id='topbar'>\n" .
- "<table border='0' cellspacing='0' width='98%'>\n<tr>\n";
+ "<table border='0' cellspacing='0' width='100%'>\n<tr>\n";
- $shove = ( $qb != 0 );
- $left = ( $qb == 1 || $qb == 3 );
-
- if ( !$shove ) {
+ if ( $this->getSkin()->qbSetting() == 0 ) {
$s .= "<td class='top' align='left' valign='top'
rowspan='{$rows}'>\n" .
- $this->getSkin()->logoText() . '</td>';
- } elseif ( $left ) {
- $s .= $this->getQuickbarCompensator( $rows );
+ $this->getSkin()->logoText(
$wgLang->alignStart() ) . '</td>';
}
- $l = $wgContLang->alignStart();
+ $l = $wgLang->alignStart();
$s .= "<td {$borderhack} align='$l' valign='top'>\n";
$s .= $this->topLinks();
$s .= '<p class="subtitle">' . $this->pageTitleLinks() .
"</p>\n";
- $r = $wgContLang->alignEnd();
+ $r = $wgLang->alignEnd();
$s .= "</td>\n<td {$borderhack} valign='top' align='$r'
nowrap='nowrap'>";
$s .= $this->nameAndLogin();
$s .= "\n<br />" . $this->searchForm() . '</td>';
@@ -134,10 +128,6 @@
$s .= "</tr>\n<tr>\n<td class='top'
colspan=\"2\">$langlinks</td>\n";
}
- if ( $shove && !$left ) { # Right
- $s .= $this->getQuickbarCompensator( $rows );
- }
-
$s .= "</tr>\n</table>\n</div>\n";
$s .= "\n<div id='article'>\n";
@@ -593,6 +583,9 @@
return $wgLang->pipeList( $s );
}
+ /**
+ * @deprecated in 1.19
+ */
function getQuickbarCompensator( $rows = 1 ) {
return "<td width='152' rowspan='{$rows}'> </td>";
}
Modified: trunk/phase3/skins/CologneBlue.php
===================================================================
--- trunk/phase3/skins/CologneBlue.php 2011-09-20 19:39:17 UTC (rev 97656)
+++ trunk/phase3/skins/CologneBlue.php 2011-09-20 19:47:57 UTC (rev 97657)
@@ -32,19 +32,23 @@
if ( 2 == $qb ) { # Right
$rules[] = "/* @noflip */#quickbar { position:
absolute; right: 4px; }";
$rules[] = "/* @noflip */#article { margin-left: 4px;
margin-right: 148px; }";
+ $rules[] = "/* @noflip */#topbar, #footer {
margin-right: 152px; }";
} elseif ( 1 == $qb ) {
$rules[] = "/* @noflip */#quickbar { position:
absolute; left: 4px; }";
$rules[] = "/* @noflip */#article { margin-left: 148px;
margin-right: 4px; }";
+ $rules[] = "/* @noflip */#topbar, #footer {
margin-left: 152px; }";
} elseif ( 3 == $qb ) { # Floating left
$rules[] = "/* @noflip */#quickbar { position:absolute;
left:4px }";
$rules[] = "/* @noflip */#topbar { margin-left: 148px
}";
$rules[] = "/* @noflip */#article { margin-left:148px;
margin-right: 4px; }";
$rules[] = "/* @noflip */body>#quickbar {
position:fixed; left:4px; top:4px; overflow:auto; bottom:4px;}"; # Hides from IE
+ $rules[] = "/* @noflip */#topbar, #footer {
margin-left: 152px; }";
} elseif ( 4 == $qb ) { # Floating right
$rules[] = "/* @noflip */#quickbar { position: fixed;
right: 4px; }";
$rules[] = "/* @noflip */#topbar { margin-right: 148px
}";
$rules[] = "/* @noflip */#article { margin-right:
148px; margin-left: 4px; }";
$rules[] = "/* @noflip */body>#quickbar { position:
fixed; right: 4px; top: 4px; overflow: auto; bottom:4px;}"; # Hides from IE
+ $rules[] = "/* @noflip */#topbar, #footer {
margin-left: 152px; }";
}
$style = implode( "\n", $rules );
$out->addInlineStyle( $style, 'flip' );
@@ -105,10 +109,6 @@
$s .= "\n<div id='footer'>";
$s .= '<table width="98%" border="0" cellspacing="0"><tr>';
- $qb = $this->getSkin()->qbSetting();
- if ( 1 == $qb || 3 == $qb ) { # Left
- $s .= $this->getQuickbarCompensator();
- }
$s .= '<td class="bottom">';
$s .= $this->bottomLinks();
@@ -127,12 +127,9 @@
$s .= "\n<br />" . $this->pageStats();
$s .= '</td>';
- if ( 2 == $qb ) { # Right
- $s .= $this->getQuickbarCompensator();
- }
$s .= "</tr></table>\n</div>\n</div>\n";
- if ( 0 != $qb ) {
+ if ( $this->getSkin()->qbSetting() != 0 ) {
$s .= $this->quickBar();
}
return $s;
Modified: trunk/phase3/skins/Standard.php
===================================================================
--- trunk/phase3/skins/Standard.php 2011-09-20 19:39:17 UTC (rev 97656)
+++ trunk/phase3/skins/Standard.php 2011-09-20 19:47:57 UTC (rev 97657)
@@ -31,9 +31,11 @@
if ( 2 == $qb ) { # Right
$rules[] = "/* @noflip */#quickbar { position:
absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
$rules[] = "/* @noflip */#article,
#mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
+ $rules[] = "/* @noflip */#topbar, #footer {
margin-right: 152px; }";
} elseif ( 1 == $qb || 3 == $qb ) {
$rules[] = "/* @noflip */#quickbar { position:
absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
$rules[] = "/* @noflip */#article,
#mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
+ $rules[] = "/* @noflip */#topbar, #footer {
margin-left: 152px; }";
if( 3 == $qb ) {
$rules[] = "/* @noflip */#quickbar { position:
fixed; padding: 4px; }";
}
@@ -41,6 +43,7 @@
$rules[] = "/* @noflip */#quickbar { position: fixed;
right: 0px; top: 0px; padding: 4px;}";
$rules[] = "/* @noflip */#quickbar { border-right: 1px
solid gray; }";
$rules[] = "/* @noflip */#article,
#mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
+ $rules[] = "/* @noflip */#topbar, #footer {
margin-right: 152px; }";
}
$style = implode( "\n", $rules );
$out->addInlineStyle( $style, 'flip' );
@@ -54,7 +57,6 @@
* @return string
*/
function doAfterContent() {
- global $wgContLang;
wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__ . '-1' );
@@ -64,17 +66,7 @@
wfProfileOut( __METHOD__ . '-1' );
wfProfileIn( __METHOD__ . '-2' );
-
- $qb = $this->getSkin()->qbSetting();
- $shove = ( $qb != 0 );
- $left = ( $qb == 1 || $qb == 3 );
-
- if ( $shove && $left ) { # Left
- $s .= $this->getQuickbarCompensator();
- }
- wfProfileOut( __METHOD__ . '-2' );
- wfProfileIn( __METHOD__ . '-3' );
- $l = $wgContLang->alignStart();
+ $l = $this->getSkin()->getLang()->alignStart();
$s .= "<td class='bottom' align='$l' valign='top'>";
$s .= $this->bottomLinks();
@@ -86,17 +78,14 @@
. '<br /><span id="pagestats">' . $this->pageStats() .
'</span>';
$s .= '</td>';
- if ( $shove && !$left ) { # Right
- $s .= $this->getQuickbarCompensator();
- }
$s .= "</tr></table>\n</div>\n</div>\n";
- wfProfileOut( __METHOD__ . '-3' );
- wfProfileIn( __METHOD__ . '-4' );
- if ( 0 != $qb ) {
+ wfProfileOut( __METHOD__ . '-2' );
+ wfProfileIn( __METHOD__ . '-3' );
+ if ( $this->getSkin()->qbSetting() != 0 ) {
$s .= $this->quickBar();
}
- wfProfileOut( __METHOD__ . '-4' );
+ wfProfileOut( __METHOD__ . '-3' );
wfProfileOut( __METHOD__ );
return $s;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs