Therefore it's easier to do it via CSS (which simplifies PHP code).
See also bug 31031.
}
function doBeforeContent() {
- global $wgContLang;
+ global $wgLang;
wfProfileIn( __METHOD__ );
$s = '';
- $qb = $this->getSkin()->qbSetting();
$langlinks = $this->otherLanguages();
if ( $langlinks ) {
}
$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>';
$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";
return $wgLang->pipeList( $s );
}
+ /**
+ * @deprecated in 1.19
+ */
function getQuickbarCompensator( $rows = 1 ) {
return "<td width='152' rowspan='{$rows}'> </td>";
}
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' );
$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();
$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;
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; }";
}
$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' );
* @return string
*/
function doAfterContent() {
- global $wgContLang;
wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__ . '-1' );
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();
. '<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;
}