From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- skins/ArchLinux.php | 53 +-- skins/Chick.php | 5 +- skins/CologneBlue.php | 78 ++-- skins/Modern.php | 13 +- skins/MonoBook.php | 53 +-- skins/Nostalgia.php | 35 +- skins/Simple.php | 10 +- skins/Standard.php | 84 +++-- skins/Vector.php | 76 ++-- skins/archlinux/IE50Fixes.css | 67 ---- skins/archlinux/IE55Fixes.css | 85 ----- skins/archlinux/IE60Fixes.css | 3 - skins/archlinux/IE70Fixes.css | 6 +- skins/archlinux/main.css | 430 +++------------------ skins/chick/IE50Fixes.css | 67 ---- skins/chick/IE55Fixes.css | 81 ---- skins/chick/IE60Fixes.css | 6 +- skins/chick/main.css | 18 - skins/cologneblue/screen.css | 13 +- skins/common/IE80Fixes.css | 2 +- skins/common/IEFixes.js | 5 + skins/common/ajax.js | 4 +- skins/common/commonContent.css | 122 ++++++ skins/common/commonElements.css | 251 +++++++++++++ skins/common/commonInterface.css | 64 ++++ skins/common/commonPrint.css | 113 +++--- skins/common/config-cc.css | 55 +-- skins/common/config.css | 3 - skins/common/config.js | 4 +- skins/common/images/add.png | Bin 3222 -> 555 bytes skins/common/images/cc-0.png | Bin 1124 -> 1103 bytes skins/common/images/cc-by.png | Bin 4739 -> 4063 bytes skins/common/images/closewindow19x19.png | Bin 0 -> 3357 bytes skins/common/images/critical-32.png | Bin 1914 -> 1892 bytes skins/common/images/sort_both.gif | Bin 1184 -> 0 bytes skins/common/images/sort_down.gif | Bin 464 -> 0 bytes skins/common/images/sort_up.gif | Bin 466 -> 0 bytes skins/common/mwsuggest.js | 14 +- skins/common/oldshared.css | 20 +- skins/common/preview.js | 4 +- skins/common/protect.js | 26 +- skins/common/shared.css | 512 +++++++++++++++++--------- skins/common/upload.js | 77 ++-- skins/common/wikibits.js | 48 ++- skins/common/wikiprintable.css | 43 ++- skins/common/wikistandard.css | 10 +- skins/modern/main.css | 48 ++- skins/monobook/IE50Fixes.css | 67 ---- skins/monobook/IE55Fixes.css | 85 ----- skins/monobook/IE60Fixes.css | 3 - skins/monobook/IE70Fixes.css | 6 +- skins/monobook/main.css | 430 +++------------------ skins/nostalgia/screen.css | 5 +- skins/simple/main.css | 377 ++++++++++--------- skins/vector/images/arrow-down-focus-icon.png | Bin 0 -> 175 bytes skins/vector/images/arrow-down-icon.png | Bin 241 -> 188 bytes skins/vector/screen.css | 404 +------------------- skins/vector/vector.js | 30 +- 58 files changed, 1591 insertions(+), 2424 deletions(-) delete mode 100644 skins/archlinux/IE50Fixes.css delete mode 100644 skins/archlinux/IE55Fixes.css delete mode 100644 skins/chick/IE50Fixes.css delete mode 100644 skins/chick/IE55Fixes.css create mode 100644 skins/common/commonContent.css create mode 100644 skins/common/commonElements.css create mode 100644 skins/common/commonInterface.css create mode 100644 skins/common/images/closewindow19x19.png delete mode 100644 skins/common/images/sort_both.gif delete mode 100644 skins/common/images/sort_down.gif delete mode 100644 skins/common/images/sort_up.gif delete mode 100644 skins/monobook/IE50Fixes.css delete mode 100644 skins/monobook/IE55Fixes.css create mode 100644 skins/vector/images/arrow-down-focus-icon.png (limited to 'skins') diff --git a/skins/ArchLinux.php b/skins/ArchLinux.php index 02598641..7a30b6e2 100644 --- a/skins/ArchLinux.php +++ b/skins/ArchLinux.php @@ -20,6 +20,9 @@ class SkinArchLinux extends SkinTemplate { var $skinname = 'archlinux', $stylename = 'archlinux', $template = 'ArchLinuxTemplate', $useHeadElement = true; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ) { global $wgHandheldStyle; parent::setupSkinUserCss( $out ); @@ -33,8 +36,6 @@ class SkinArchLinux extends SkinTemplate { } // TODO: Migrate all of these - $out->addStyle( 'archlinux/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); - $out->addStyle( 'archlinux/IE55Fixes.css', 'screen', 'IE 5.5000' ); $out->addStyle( 'archlinux/IE60Fixes.css', 'screen', 'IE 6' ); $out->addStyle( 'archlinux/IE70Fixes.css', 'screen', 'IE 7' ); @@ -47,11 +48,6 @@ class SkinArchLinux extends SkinTemplate { */ class ArchLinuxTemplate extends BaseTemplate { - /** - * @var Skin - */ - var $skin; - /** * Template filter callback for ArchLinux skin. * Takes an associative array of data set from a SkinTemplate-based @@ -62,8 +58,6 @@ class ArchLinuxTemplate extends BaseTemplate { */ function execute() { global $wgArchNavBar, $wgArchHome, $wgArchNavBarSelected, $wgArchNavBarSelectedDefault; - $this->skin = $this->data['skin']; - // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -98,8 +92,8 @@ class ArchLinuxTemplate extends BaseTemplate { data['sitenotice']) { ?>
html('sitenotice') ?>
-

html('title') ?>

-
+

html('title') ?>

+
msg('tagline') ?>
html('userlangattributes') ?>>html('subtitle') ?>
data['undelete']) { ?> @@ -107,7 +101,7 @@ class ArchLinuxTemplate extends BaseTemplate { data['newtalk'] ) { ?>
html('newtalk') ?>
data['showjumplinks']) { ?> - + html('bodytext') ?> @@ -131,15 +125,13 @@ class ArchLinuxTemplate extends BaseTemplate {
- renderPortals( $this->data['sidebar'] ); ?> @@ -159,7 +151,7 @@ class ArchLinuxTemplate extends BaseTemplate { foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?>
- skin->makeFooterIcon( $icon ); ?> + getSkin()->makeFooterIcon( $icon ); ?> @@ -245,25 +237,8 @@ echo $footerEnd;
    data['content_actions'] as $key => $tab) { - $linkAttribs = array( 'href' => $tab['href'] ); - - if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) { - $title = Linker::titleAttrib( "ca-$key" ); - if ( $title !== false ) { - $linkAttribs['title'] = $title; - } - } else { - $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" ); - } - $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] ); - - /* Surround with a
  • */ - $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) ); - if( $tab['class'] ) { - $liAttribs['class'] = $tab['class']; - } - echo ' - ' . Html::rawElement( 'li', $liAttribs, $linkHtml ); + echo ' + ' . $this->makeListItem( $key, $tab ); } ?>
diff --git a/skins/Chick.php b/skins/Chick.php index b7cef695..2362263c 100644 --- a/skins/Chick.php +++ b/skins/Chick.php @@ -21,14 +21,15 @@ class SkinChick extends SkinTemplate { var $skinname = 'chick', $stylename = 'chick', $template = 'MonoBookTemplate', $useHeadElement = true; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ){ parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.chick' ); // TODO: Migrate all of these to RL - $out->addStyle( 'chick/IE50Fixes.css', 'screen,handheld', 'lt IE 5.5000' ); - $out->addStyle( 'chick/IE55Fixes.css', 'screen,handheld', 'IE 5.5000' ); $out->addStyle( 'chick/IE60Fixes.css', 'screen,handheld', 'IE 6' ); } } diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 58b00fc6..c5b3b11d 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -19,6 +19,9 @@ class SkinCologneBlue extends SkinLegacy { var $skinname = 'cologneblue', $stylename = 'cologneblue', $template = 'CologneBlueTemplate'; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ){ parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.cologneblue' ); @@ -55,6 +58,9 @@ class SkinCologneBlue extends SkinLegacy { class CologneBlueTemplate extends LegacyTemplate { + /** + * @return string + */ function doBeforeContent() { $mainPageObj = Title::newMainPage(); @@ -62,7 +68,7 @@ class CologneBlueTemplate extends LegacyTemplate { ''; $s .= '
'; - $s .= ''; + $s .= ''; $s .= '' . wfMsg( 'sitetitle' ) . ''; $s .= ''; $s .= $this->bottomLinks(); - $s .= $wgLang->pipeList( array( + $s .= $this->getSkin()->getLanguage()->pipeList( array( "\n
" . Linker::link( Title::newMainPage(), null, @@ -129,8 +135,10 @@ class CologneBlueTemplate extends LegacyTemplate { return $s; } + /** + * @return string + */ function sysLinks() { - global $wgUser, $wgLang; $li = SpecialPage::getTitleFor( 'Userlogin' ); $lo = SpecialPage::getTitleFor( 'Userlogout' ); @@ -165,7 +173,7 @@ class CologneBlueTemplate extends LegacyTemplate { if( $this->extensionTabLinks() ) { $s[] = $this->extensionTabLinks(); } - if ( $wgUser->isLoggedIn() ) { + if ( $this->data['loggedin'] ) { $s[] = Linker::linkKnown( $lo, wfMsg( 'logout' ), @@ -181,18 +189,16 @@ class CologneBlueTemplate extends LegacyTemplate { ); } - return $wgLang->pipeList( $s ); + return $this->getSkin()->getLanguage()->pipeList( $s ); } /** * Compute the sidebar * @access private + * + * @return string */ function quickBar(){ - global $wgOut, $wgUser; - - $tns = $this->getSkin()->getTitle()->getNamespace(); - $s = "\n
"; $sep = '
'; @@ -229,7 +235,9 @@ class CologneBlueTemplate extends LegacyTemplate { $barnumber++; } - if ( $wgOut->isArticle() ) { + $user = $this->getSkin()->getUser(); + + if ( $this->data['isarticle'] ) { $s .= $this->menuHead( 'qbedit' ); $s .= '' . $this->editThisPage() . ''; @@ -238,16 +246,16 @@ class CologneBlueTemplate extends LegacyTemplate { wfMsg( 'edithelp' ) ); - if( $wgUser->isLoggedIn() ) { + if( $this->data['loggedin'] ) { $s .= $sep . $this->moveThisPage(); } - if ( $wgUser->isAllowed( 'delete' ) ) { + if ( $user->isAllowed( 'delete' ) ) { $dtp = $this->deleteThisPage(); if ( $dtp != '' ) { $s .= $sep . $dtp; } } - if ( $wgUser->isAllowed( 'protect' ) ) { + if ( $user->isAllowed( 'protect' ) ) { $ptp = $this->protectThisPage(); if ( $ptp != '' ) { $s .= $sep . $ptp; @@ -259,7 +267,7 @@ class CologneBlueTemplate extends LegacyTemplate { $s .= $this->talkLink() . $sep . $this->commentLink() . $sep . $this->printableLink(); - if ( $wgUser->isLoggedIn() ) { + if ( $this->data['loggedin'] ) { $s .= $sep . $this->watchThisPage(); } @@ -270,8 +278,10 @@ class CologneBlueTemplate extends LegacyTemplate { . $sep . $this->whatLinksHere() . $sep . $this->watchPageLinksLink(); - if( $tns == NS_USER || $tns == NS_USER_TALK ) { - $id = User::idFromName( $this->getSkin()->getTitle()->getText() ); + $title = $this->getSkin()->getTitle(); + $tns = $title->getNamespace(); + if ( $tns == NS_USER || $tns == NS_USER_TALK ) { + $id = User::idFromName( $title->getText() ); if( $id != 0 ) { $s .= $sep . $this->userContribsLink(); if( $this->getSkin()->showEmailUser( $id ) ) { @@ -283,20 +293,20 @@ class CologneBlueTemplate extends LegacyTemplate { } $s .= $this->menuHead( 'qbmyoptions' ); - if ( $wgUser->isLoggedIn() ) { + if ( $this->data['loggedin'] ) { $tl = Linker::link( - $wgUser->getTalkPage(), + $user->getTalkPage(), wfMsg( 'mytalk' ), array(), array(), array( 'known', 'noclasses' ) ); - if ( $wgUser->getNewtalk() ) { + if ( $user->getNewtalk() ) { $tl .= ' *'; } $s .= Linker::link( - $wgUser->getUserPage(), + $user->getUserPage(), wfMsg( 'mypage' ), array(), array(), @@ -304,7 +314,7 @@ class CologneBlueTemplate extends LegacyTemplate { ) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' ) . $sep . Linker::link( - SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), + SpecialPage::getSafeTitleFor( 'Contributions', $user->getName() ), wfMsg( 'mycontris' ), array(), array(), @@ -319,7 +329,7 @@ class CologneBlueTemplate extends LegacyTemplate { . Linker::specialLink( 'Newpages' ) . $sep . Linker::specialLink( 'Listfiles' ) . $sep . Linker::specialLink( 'Statistics' ); - if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { + if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) { $s .= $sep . $this->getUploadLink(); } @@ -342,15 +352,23 @@ class CologneBlueTemplate extends LegacyTemplate { return $s; } + /** + * @param $key string + * @return string + */ function menuHead( $key ) { $s = "\n
" . wfMsg( $key ) . "
"; return $s; } + /** + * @param $label string + * @return string + */ function searchForm( $label = '' ) { - global $wgRequest, $wgUseTwoButtonsSearchForm; + global $wgUseTwoButtonsSearchForm; - $search = $wgRequest->getText( 'search' ); + $search = $this->getSkin()->getRequest()->getText( 'search' ); $action = $this->data['searchaction']; $s = "
searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">"; if( $label != '' ) { diff --git a/skins/Modern.php b/skins/Modern.php index c4070b5d..ebd574f4 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -21,6 +21,9 @@ class SkinModern extends SkinTemplate { var $skinname = 'modern', $stylename = 'modern', $template = 'ModernTemplate', $useHeadElement = true; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ){ parent::setupSkinUserCss( $out ); $out->addModuleStyles ('skins.modern'); @@ -33,10 +36,6 @@ class SkinModern extends SkinTemplate { */ class ModernTemplate extends MonoBookTemplate { - /** - * @var Skin - */ - var $skin; /** * Template filter callback for Modern skin. * Takes an associative array of data set from a SkinTemplate-based @@ -46,8 +45,6 @@ class ModernTemplate extends MonoBookTemplate { * @access private */ function execute() { - $this->skin = $skin = $this->data['skin']; - // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -55,7 +52,7 @@ class ModernTemplate extends MonoBookTemplate { ?> -

html('title') ?>

+

html('title') ?>

@@ -134,7 +131,7 @@ class ModernTemplate extends MonoBookTemplate {
- skin->makeFooterIcon( $icon, 'withoutImage' ); ?> + getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?> diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 0cf72e93..f1fe5090 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -23,6 +23,9 @@ class SkinMonoBook extends SkinTemplate { var $skinname = 'monobook', $stylename = 'monobook', $template = 'MonoBookTemplate', $useHeadElement = true; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ) { global $wgHandheldStyle; parent::setupSkinUserCss( $out ); @@ -36,8 +39,6 @@ class SkinMonoBook extends SkinTemplate { } // TODO: Migrate all of these - $out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); - $out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' ); $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' ); $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' ); @@ -50,11 +51,6 @@ class SkinMonoBook extends SkinTemplate { */ class MonoBookTemplate extends BaseTemplate { - /** - * @var Skin - */ - var $skin; - /** * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based @@ -64,8 +60,6 @@ class MonoBookTemplate extends BaseTemplate { * @access private */ function execute() { - $this->skin = $this->data['skin']; - // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -75,8 +69,8 @@ class MonoBookTemplate extends BaseTemplate { data['sitenotice']) { ?>
html('sitenotice') ?>
-

html('title') ?>

-
+

html('title') ?>

+
msg('tagline') ?>
html('userlangattributes') ?>>html('subtitle') ?>
data['undelete']) { ?> @@ -84,7 +78,7 @@ class MonoBookTemplate extends BaseTemplate { data['newtalk'] ) { ?>
html('newtalk') ?>
data['showjumplinks']) { ?> - + html('bodytext') ?> @@ -108,15 +102,13 @@ class MonoBookTemplate extends BaseTemplate {
- renderPortals( $this->data['sidebar'] ); ?> @@ -136,7 +128,7 @@ class MonoBookTemplate extends BaseTemplate { foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?>
- skin->makeFooterIcon( $icon ); ?> + getSkin()->makeFooterIcon( $icon ); ?> @@ -222,25 +214,8 @@ echo $footerEnd;
    data['content_actions'] as $key => $tab) { - $linkAttribs = array( 'href' => $tab['href'] ); - - if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) { - $title = Linker::titleAttrib( "ca-$key" ); - if ( $title !== false ) { - $linkAttribs['title'] = $title; - } - } else { - $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" ); - } - $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] ); - - /* Surround with a
  • */ - $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) ); - if( $tab['class'] ) { - $liAttribs['class'] = $tab['class']; - } - echo ' - ' . Html::rawElement( 'li', $liAttribs, $linkHtml ); + echo ' + ' . $this->makeListItem( $key, $tab ); } ?>
diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php index a4fd985d..21d3578d 100644 --- a/skins/Nostalgia.php +++ b/skins/Nostalgia.php @@ -18,6 +18,9 @@ class SkinNostalgia extends SkinLegacy { var $skinname = 'nostalgia', $stylename = 'nostalgia', $template = 'NostalgiaTemplate'; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ){ parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.nostalgia' ); @@ -27,6 +30,9 @@ class SkinNostalgia extends SkinLegacy { class NostalgiaTemplate extends LegacyTemplate { + /** + * @return string + */ function doBeforeContent() { $s = "\n
\n
\n"; $s .= ''; @@ -48,10 +54,7 @@ class NostalgiaTemplate extends LegacyTemplate { $s .= '
' . $ol; } - $cat = ''; - if( $cat ) { - $s .= '
' . $cat; - } + $s .= $this->getSkin()->getCategories(); $s .= "

\n
\n"; $s .= "\n
"; @@ -59,14 +62,16 @@ class NostalgiaTemplate extends LegacyTemplate { return $s; } + /** + * @return string + */ function topLinks() { - global $wgOut, $wgUser; $sep = " |\n"; $s = $this->getSkin()->mainPageLink() . $sep . Linker::specialLink( 'Recentchanges' ); - if ( $wgOut->isArticle() ) { + if ( $this->data['isarticle'] ) { $s .= $sep . '' . $this->editThisPage() . '' . $sep . $this->talkLink() . $sep . $this->historyLink(); } @@ -74,30 +79,31 @@ class NostalgiaTemplate extends LegacyTemplate { /* show links to different language variants */ $s .= $this->variantLinks(); $s .= $this->extensionTabLinks(); - if ( $wgUser->isAnon() ) { + if ( !$this->data['loggedin'] ) { $s .= $sep . Linker::specialLink( 'Userlogin' ); } else { /* show user page and user talk links */ - $s .= $sep . Linker::link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) ); - $s .= $sep . Linker::link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) ); - if ( $wgUser->getNewtalk() ) { + $user = $this->getSkin()->getUser(); + $s .= $sep . Linker::link( $user->getUserPage(), wfMsgHtml( 'mypage' ) ); + $s .= $sep . Linker::link( $user->getTalkPage(), wfMsgHtml( 'mytalk' ) ); + if ( $user->getNewtalk() ) { $s .= ' *'; } /* show watchlist link */ $s .= $sep . Linker::specialLink( 'Watchlist' ); /* show my contributions link */ $s .= $sep . Linker::link( - SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), + SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ), wfMsgHtml( 'mycontris' ) ); /* show my preferences link */ $s .= $sep . Linker::specialLink( 'Preferences' ); /* show upload file link */ - if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { + if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) { $s .= $sep . $this->getUploadLink(); } /* show log out link */ - $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' ); + $s .= $sep . Linker::specialLink( 'Userlogout' ); } $s .= $sep . $this->specialPagesList(); @@ -105,6 +111,9 @@ class NostalgiaTemplate extends LegacyTemplate { return $s; } + /** + * @return string + */ function doAfterContent() { $s = "\n

\n"; diff --git a/skins/Simple.php b/skins/Simple.php index 61b6e786..54be9f7d 100644 --- a/skins/Simple.php +++ b/skins/Simple.php @@ -21,22 +21,24 @@ class SkinSimple extends SkinTemplate { var $skinname = 'simple', $stylename = 'simple', $template = 'MonoBookTemplate', $useHeadElement = true; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.simple' ); /* Add some userprefs specific CSS styling */ - global $wgUser; $rules = array(); $underline = ""; - if ( $wgUser->getOption( 'underline' ) < 2 ) { - $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline !important' : 'none' . ";"; + if ( $this->getUser()->getOption( 'underline' ) < 2 ) { + $underline = "text-decoration: " . $this->getUser()->getOption( 'underline' ) ? 'underline !important' : 'none' . ";"; } /* Also inherits from resourceloader */ - if( !$wgUser->getOption( 'highlightbroken' ) ) { + if( !$this->getUser()->getOption( 'highlightbroken' ) ) { $rules[] = "a.new, a.stub { color: inherit; text-decoration: inherit;}"; $rules[] = "a.new:after { color: #CC2200; $underline;}"; $rules[] = "a.stub:after { $underline; }"; diff --git a/skins/Standard.php b/skins/Standard.php index 8ae4b3b1..bd0c41a5 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -18,9 +18,12 @@ class SkinStandard extends SkinLegacy { var $skinname = 'standard', $stylename = 'standard', $template = 'StandardTemplate'; + /** + * @param $out OutputPage + */ function setupSkinUserCss( OutputPage $out ){ parent::setupSkinUserCss( $out ); - $out->AddModuleStyles( 'skins.standard' ); + $out->addModuleStyles( 'skins.standard' ); $qb = $this->qbSetting(); $rules = array(); @@ -37,12 +40,12 @@ class SkinStandard extends SkinLegacy { $rules[] = "/* @noflip */#quickbar { position: fixed; padding: 4px; }"; } } elseif ( 4 == $qb ) { - $rules[] = "/* @noflip */#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}"; + $rules[] = "/* @noflip */#quickbar { position: fixed; right: 0; top: 0; 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 ); + $style = implode( "\n", $rules ); $out->addInlineStyle( $style, 'flip' ); } @@ -50,8 +53,10 @@ class SkinStandard extends SkinLegacy { class StandardTemplate extends LegacyTemplate { + /** + * @return string + */ function doAfterContent() { - global $wgContLang, $wgLang; wfProfileIn( __METHOD__ ); wfProfileIn( __METHOD__ . '-1' ); @@ -61,11 +66,11 @@ class StandardTemplate extends LegacyTemplate { wfProfileOut( __METHOD__ . '-1' ); wfProfileIn( __METHOD__ . '-2' ); - $l = $this->getSkin()->getLang()->alignStart(); + $l = $this->getSkin()->getLanguage()->alignStart(); $s .= "
"; $s .= $this->bottomLinks(); - $s .= "\n
" . $wgLang->pipeList( array( + $s .= "\n
" . $this->getSkin()->getLanguage()->pipeList( array( $this->getSkin()->mainPageLink(), $this->getSkin()->aboutLink(), Linker::specialLink( 'Recentchanges' ), @@ -85,14 +90,18 @@ class StandardTemplate extends LegacyTemplate { return $s; } + /** + * @return string + */ function quickBar() { - global $wgOut, $wgUser, $wgRequest, $wgContLang; + global $wgContLang; wfProfileIn( __METHOD__ ); - $action = $wgRequest->getText( 'action' ); - $wpPreview = $wgRequest->getBool( 'wpPreview' ); - $tns = $this->getSkin()->getTitle()->getNamespace(); + $action = $this->getSkin()->getRequest()->getText( 'action' ); + $wpPreview = $this->getSkin()->getRequest()->getBool( 'wpPreview' ); + $title = $this->getSkin()->getTitle(); + $tns = $title->getNamespace(); $s = "\n
"; $s .= "\n" . $this->getSkin()->logoText() . "\n
"; @@ -120,13 +129,13 @@ class StandardTemplate extends LegacyTemplate { } if ( $barnumber == 1 ) { // only show watchlist link if logged in - if( $wgUser->isLoggedIn() ) { + if( $this->data['loggedin'] ) { $s.= Linker::specialLink( 'Watchlist' ) ; $s .= $sep . Linker::linkKnown( SpecialPage::getTitleFor( 'Contributions' ), wfMsg( 'mycontris' ), array(), - array( 'target' => $wgUser->getName() ) + array( 'target' => $this->data['username'] ) ); } } @@ -134,9 +143,9 @@ class StandardTemplate extends LegacyTemplate { } $s .= "\n
"; - $articleExists = $this->getSkin()->getTitle()->getArticleId(); - if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) { - if( $wgOut->isArticle() ) { + $articleExists = $title->getArticleId(); + if ( $this->data['isarticle'] || $action == 'edit' || $action == 'history' || $wpPreview ) { + if( $this->data['isarticle'] ) { $s .= '' . $this->editThisPage() . ''; } else { # backlink to the article in edit or history mode if( $articleExists ){ # no backlink if no article @@ -179,14 +188,14 @@ class StandardTemplate extends LegacyTemplate { $text = wfMsg( 'articlepage' ); } - $link = $this->getSkin()->getTitle()->getText(); + $link = $title->getText(); $nstext = $wgContLang->getNsText( $tns ); if( $nstext ) { # add namespace if necessary $link = $nstext . ':' . $link; } $s .= Linker::link( Title::newFromText( $link ), $text ); - } elseif( $this->getSkin()->getTitle()->getNamespace() != NS_SPECIAL ) { + } elseif( $title->getNamespace() != NS_SPECIAL ) { # we just throw in a "New page" text to tell the user that he's in edit mode, # and to avoid messing with the separator that is prepended to the next item $s .= '' . wfMsg( 'newpage' ) . ''; @@ -194,32 +203,31 @@ class StandardTemplate extends LegacyTemplate { } # "Post a comment" link - if( ( $this->getSkin()->getTitle()->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) - $s .= '
' . $this->getSkin()->link( - $this->getSkin()->getTitle(), + if( ( $title->isTalkPage() || $this->getSkin()->getOutput()->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) + $s .= '
' . Linker::link( + $title, wfMsg( 'postcomment' ), array(), array( 'action' => 'edit', 'section' => 'new' - ), - array( 'known', 'noclasses' ) + ) ); - /* - watching could cause problems in edit mode: - if user edits article, then loads "watch this article" in background and then saves - article with "Watch this article" checkbox disabled, the article is transparently - unwatched. Therefore we do not show the "Watch this page" link in edit mode - */ - if ( $wgUser->isLoggedIn() && $articleExists ) { + /** + * Watching could cause problems in edit mode: + * if user edits article, then loads "watch this article" in background and then saves + * article with "Watch this article" checkbox disabled, the article is transparently + * unwatched. Therefore we do not show the "Watch this page" link in edit mode. + */ + if ( $this->data['loggedin'] && $articleExists ) { if( $action != 'edit' && $action != 'submit' ) { $s .= $sep . $this->watchThisPage(); } - if ( $this->getSkin()->getTitle()->userCan( 'edit' ) ) + if ( $title->userCan( 'edit' ) ) $s .= $sep . $this->moveThisPage(); } - if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) { + if ( $this->getSkin()->getUser()->isAllowed( 'delete' ) && $articleExists ) { $s .= $sep . $this->deleteThisPage() . $sep . $this->protectThisPage(); } @@ -229,17 +237,17 @@ class StandardTemplate extends LegacyTemplate { } $s .= $sep . $this->whatLinksHere(); - if( $wgOut->isArticleRelated() ) { + if( $this->getSkin()->getOutput()->isArticleRelated() ) { $s .= $sep . $this->watchPageLinksLink(); } if ( - NS_USER == $this->getSkin()->getTitle()->getNamespace() || - $this->getSkin()->getTitle()->getNamespace() == NS_USER_TALK + NS_USER == $title->getNamespace() || + $title->getNamespace() == NS_USER_TALK ) { - $id = User::idFromName( $this->getSkin()->getTitle()->getText() ); - $ip = User::isIP( $this->getSkin()->getTitle()->getText() ); + $id = User::idFromName( $title->getText() ); + $ip = User::isIP( $title->getText() ); if( $id || $ip ){ $s .= $sep . $this->userContribsLink(); @@ -251,7 +259,7 @@ class StandardTemplate extends LegacyTemplate { $s .= "\n

"; } - if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { + if( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getSkin()->getUser() ) === true ) { $s .= $this->getUploadLink() . $sep; } @@ -260,7 +268,7 @@ class StandardTemplate extends LegacyTemplate { global $wgSiteSupportPage; if( $wgSiteSupportPage ) { $s .= "\n
' . wfMsg( 'sitesupport' ) . ''; + '" class="internal">' . wfMsg( 'sitesupport' ) . ''; } $s .= "\n
\n"; diff --git a/skins/Vector.php b/skins/Vector.php index 97161611..4b6433d6 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -26,14 +26,14 @@ class SkinVector extends SkinTemplate { * @param $out OutputPage object to initialize */ public function initPage( OutputPage $out ) { - global $wgLocalStylePath, $wgRequest; + global $wgLocalStylePath; parent::initPage( $out ); // Append CSS which includes IE only behavior fixes for hover support - // this is better than including this in a CSS fille since it doesn't // wait for the CSS file to load before fetching the HTC file. - $min = $wgRequest->getFuzzyBool( 'debug' ) ? '' : '.min'; + $min = $this->getRequest()->getFuzzyBool( 'debug' ) ? '' : '.min'; $out->addHeadItem( 'csshover', ' -
+
data['sitenotice'] ): ?> @@ -144,7 +134,9 @@ class VectorTemplate extends BaseTemplate { -

html( 'title' ) ?>

+

+ html( 'title' ) ?> +

@@ -168,7 +160,7 @@ class VectorTemplate extends BaseTemplate { data['showjumplinks'] ): ?> -
+ @@ -236,7 +228,7 @@ class VectorTemplate extends BaseTemplate { $footerIcons ): ?> @@ -246,9 +238,6 @@ class VectorTemplate extends BaseTemplate {
- - - printTrail(); ?> @@ -298,7 +287,7 @@ class VectorTemplate extends BaseTemplate { } private function renderPortal( $name, $content, $msg = null, $hook = null ) { - if ( !isset( $msg ) ) { + if ( $msg === null ) { $msg = $name; } ?> @@ -314,7 +303,7 @@ class VectorTemplate extends BaseTemplate { @@ -332,16 +321,18 @@ class VectorTemplate extends BaseTemplate { /** * Render one or more navigations elements by name, automatically reveresed * when UI is in RTL mode + * + * @param $elements array */ private function renderNavigation( $elements ) { - global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser, $wgLang; + global $wgVectorUseSimpleSearch; // If only one element was given, wrap it in an array, allowing more // flexible arguments if ( !is_array( $elements ) ) { $elements = array( $elements ); // If there's a series of elements, reverse them when in RTL mode - } elseif ( $wgLang->isRTL() ) { + } elseif ( $this->data['rtl'] ) { $elements = array_reverse( $elements ); } // Render elements @@ -363,15 +354,13 @@ class VectorTemplate extends BaseTemplate { case 'VARIANTS': ?>
- -

- data['variant_urls'] as $link ): ?> - - - - -

- +

+ data['variant_urls'] as $link ): ?> + + + + +

msg( 'variants' ) ?>