Completely remove support for legacy style skins. All legacy skinning options are...
authorDaniel Friesen <dantman@users.mediawiki.org>
Fri, 4 Feb 2011 04:18:05 +0000 (04:18 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Fri, 4 Feb 2011 04:18:05 +0000 (04:18 +0000)
includes/AutoLoader.php
includes/OutputPage.php
includes/Skin.php
includes/SkinLegacy.php [new file with mode: 0644]
includes/diff/DifferenceEngine.php
skins/CologneBlue.php
skins/Nostalgia.php
skins/Standard.php

index d99a097..1dc5e30 100644 (file)
@@ -223,6 +223,8 @@ $wgAutoloadLocalClasses = array(
        'SiteStatsUpdate' => 'includes/SiteStats.php',
        'Skin' => 'includes/Skin.php',
        'SkinTemplate' => 'includes/SkinTemplate.php',
+       'SkinLegacy' => 'includes/SkinLegacy.php',
+       'LegacyTemplate' => 'includes/SkinLegacy.php',
        'SpecialMycontributions' => 'includes/SpecialPage.php',
        'SpecialMypage' => 'includes/SpecialPage.php',
        'SpecialMytalk' => 'includes/SpecialPage.php',
index 8c5eba7..77fa058 100644 (file)
@@ -128,13 +128,6 @@ class OutputPage {
         *  Should probably get deleted / rewritten ... */
        var $mAllowUserJs;
 
-       /**
-        * This was for the old skins and for users with 640x480 screen.
-        * Please note old skins are still used and might prove useful for
-        * users having old computers or visually impaired.
-        */
-       var $mSuppressQuickbar = false;
-
        /**
         * @EasterEgg I just love the name for this self documenting variable.
         * @todo document
@@ -1071,23 +1064,6 @@ class OutputPage {
                return $this->mCategories;
        }
 
-       /**
-        * Suppress the quickbar from the output, only for skin supporting
-        * the quickbar
-        */
-       public function suppressQuickbar() {
-               $this->mSuppressQuickbar = true;
-       }
-
-       /**
-        * Return whether the quickbar should be suppressed from the output
-        *
-        * @return Boolean
-        */
-       public function isQuickbarSuppressed() {
-               return $this->mSuppressQuickbar;
-       }
-
        /**
         * Remove user JavaScript from scripts to load
         */
index b5f407d..6623d26 100644 (file)
@@ -15,13 +15,11 @@ if ( !defined( 'MEDIAWIKI' ) ) {
  *
  * @ingroup Skins
  */
-class Skin extends Linker {
+abstract class Skin extends Linker {
        /**#@+
         * @private
         */
        var $mWatchLinkNum = 0; // Appended to end of watch link id's
-       // How many search boxes have we made?  Avoid duplicate id's.
-       protected $searchboxes = '';
        /**#@-*/
        protected $mRevisionId; // The revision ID we're looking at, null if not applicable.
        protected $skinname = 'standard';
@@ -181,18 +179,6 @@ class Skin extends Linker {
                return $this->skinname;
        }
 
-       function qbSetting() {
-               global $wgOut, $wgUser;
-
-               if ( $wgOut->isQuickbarSuppressed() ) {
-                       return 0;
-               }
-
-               $q = $wgUser->getOption( 'quickbar', 0 );
-
-               return $q;
-       }
-
        function initPage( OutputPage $out ) {
                global $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI;
 
@@ -439,6 +425,7 @@ class Skin extends Linker {
        /**
         * Outputs the HTML generated by other functions.
         * @param $out Object: instance of OutputPage
+        * @todo Exterminate!
         */
        function outputPage( OutputPage $out ) {
                global $wgDebugComments;
@@ -656,11 +643,9 @@ class Skin extends Linker {
        /**
         * Add skin specific stylesheets
         * @param $out OutputPage
+        * @delete
         */
-       function setupSkinUserCss( OutputPage $out ) {
-               $out->addModuleStyles( 'mediawiki.legacy.shared' );
-               $out->addModuleStyles( 'mediawiki.legacy.oldshared' );
-       }
+       abstract function setupSkinUserCss( OutputPage $out );
 
        function getPageClasses( $title ) {
                $numeric = 'ns-' . $title->getNamespace();
@@ -695,79 +680,6 @@ class Skin extends Linker {
                return $wgLogo;
        }
 
-       /**
-        * This will be called immediately after the <body> tag.  Split into
-        * two functions to make it easier to subclass.
-        */
-       function beforeContent() {
-               return $this->doBeforeContent();
-       }
-
-       function doBeforeContent() {
-               global $wgContLang;
-               wfProfileIn( __METHOD__ );
-
-               $s = '';
-               $qb = $this->qbSetting();
-
-               $langlinks = $this->otherLanguages();
-               if ( $langlinks ) {
-                       $rows = 2;
-                       $borderhack = '';
-               } else {
-                       $rows = 1;
-                       $langlinks = false;
-                       $borderhack = 'class="top"';
-               }
-
-               $s .= "\n<div id='content'>\n<div id='topbar'>\n" .
-                 "<table border='0' cellspacing='0' width='98%'>\n<tr>\n";
-
-               $shove = ( $qb != 0 );
-               $left = ( $qb == 1 || $qb == 3 );
-
-               if ( !$shove ) {
-                       $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" .
-                               $this->logoText() . '</td>';
-               } elseif ( $left ) {
-                       $s .= $this->getQuickbarCompensator( $rows );
-               }
-
-               $l = $wgContLang->alignStart();
-               $s .= "<td {$borderhack} align='$l' valign='top'>\n";
-
-               $s .= $this->topLinks();
-               $s .= '<p class="subtitle">' . $this->pageTitleLinks() . "</p>\n";
-
-               $r = $wgContLang->alignEnd();
-               $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap='nowrap'>";
-               $s .= $this->nameAndLogin();
-               $s .= "\n<br />" . $this->searchForm() . '</td>';
-
-               if ( $langlinks ) {
-                       $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";
-
-               $notice = wfGetSiteNotice();
-
-               if ( $notice ) {
-                       $s .= "\n<div id='siteNotice'>$notice</div>\n";
-               }
-               $s .= $this->pageTitle();
-               $s .= $this->pageSubtitle();
-               $s .= $this->getCategories();
-
-               wfProfileOut( __METHOD__ );
-               return $s;
-       }
-
        function getCategoryLinks() {
                global $wgOut, $wgUseCategoryBrowser;
                global $wgContLang, $wgUser;
@@ -879,10 +791,6 @@ class Skin extends Linker {
                return "<div id='catlinks' class='$classes'>{$catlinks}</div>";
        }
 
-       function getQuickbarCompensator( $rows = 1 ) {
-               return "<td width='152' rowspan='{$rows}'>&#160;</td>";
-       }
-
        /**
         * This runs a hook to allow extensions placing their stuff after content
         * and article metadata (e.g. categories).
@@ -974,15 +882,6 @@ class Skin extends Linker {
                return $ret;
        }
 
-       /**
-        * This gets called shortly before the </body> tag.
-        * @return String HTML to be put before </body>
-        */
-       function afterContent() {
-               $printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
-               return $printfooter . $this->generateDebugHTML() . $this->doAfterContent();
-       }
-
        /**
         * This gets called shortly before the </body> tag.
         * @param $out OutputPage object
@@ -1001,94 +900,6 @@ class Skin extends Linker {
                return wfMsg( 'retrievedfrom', '<a href="' . $url . '">' . $url . '</a>' );
        }
 
-       function printFooter() {
-               return "<p>" .  $this->printSource() .
-                       "</p>\n\n<p>" . $this->pageStats() . "</p>\n";
-       }
-
-       /** overloaded by derived classes */
-       function doAfterContent() {
-               return '</div></div>';
-       }
-
-       function pageTitleLinks() {
-               global $wgOut, $wgUser, $wgRequest, $wgLang;
-
-               $oldid = $wgRequest->getVal( 'oldid' );
-               $diff = $wgRequest->getVal( 'diff' );
-               $action = $wgRequest->getText( 'action' );
-
-               $s[] = $this->printableLink();
-               $disclaimer = $this->disclaimerLink(); # may be empty
-
-               if ( $disclaimer ) {
-                       $s[] = $disclaimer;
-               }
-
-               $privacy = $this->privacyLink(); # may be empty too
-
-               if ( $privacy ) {
-                       $s[] = $privacy;
-               }
-
-               if ( $wgOut->isArticleRelated() ) {
-                       if ( $this->mTitle->getNamespace() == NS_FILE ) {
-                               $name = $this->mTitle->getDBkey();
-                               $image = wfFindFile( $this->mTitle );
-
-                               if ( $image ) {
-                                       $link = htmlspecialchars( $image->getURL() );
-                                       $style = $this->getInternalLinkAttributes( $link, $name );
-                                       $s[] = "<a href=\"{$link}\"{$style}>{$name}</a>";
-                               }
-                       }
-               }
-
-               if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) {
-                       $s[] .= $this->link(
-                                       $this->mTitle,
-                                       wfMsg( 'currentrev' ),
-                                       array(),
-                                       array(),
-                                       array( 'known', 'noclasses' )
-                       );
-               }
-
-               if ( $wgUser->getNewtalk() ) {
-                       # do not show "You have new messages" text when we are viewing our
-                       # own talk page
-                       if ( !$this->mTitle->equals( $wgUser->getTalkPage() ) ) {
-                               $tl = $this->link(
-                                       $wgUser->getTalkPage(),
-                                       wfMsgHtml( 'newmessageslink' ),
-                                       array(),
-                                       array( 'redirect' => 'no' ),
-                                       array( 'known', 'noclasses' )
-                               );
-
-                               $dl = $this->link(
-                                       $wgUser->getTalkPage(),
-                                       wfMsgHtml( 'newmessagesdifflink' ),
-                                       array(),
-                                       array( 'diff' => 'cur' ),
-                                       array( 'known', 'noclasses' )
-                               );
-                               $s[] = '<strong>' . wfMsg( 'youhavenewmessages', $tl, $dl ) . '</strong>';
-                               # disable caching
-                               $wgOut->setSquidMaxage( 0 );
-                               $wgOut->enableClientCache( false );
-                       }
-               }
-
-               $undelete = $this->getUndeleteLink();
-
-               if ( !empty( $undelete ) ) {
-                       $s[] = $undelete;
-               }
-
-               return $wgLang->pipeList( $s );
-       }
-
        function getUndeleteLink() {
                global $wgUser, $wgLang, $wgRequest;
 
@@ -1121,53 +932,6 @@ class Skin extends Linker {
                return '';
        }
 
-       function printableLink() {
-               global $wgOut, $wgFeedClasses, $wgRequest, $wgLang;
-
-               $s = array();
-
-               if ( !$wgOut->isPrintable() ) {
-                       $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
-                       $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
-               }
-
-               if ( $wgOut->isSyndicated() ) {
-                       foreach ( $wgFeedClasses as $format => $class ) {
-                               $feedurl = $wgRequest->escapeAppendQuery( "feed=$format" );
-                               $s[] = "<a href=\"$feedurl\" rel=\"alternate\" type=\"application/{$format}+xml\""
-                                               . " class=\"feedlink\">" . wfMsgHtml( "feed-$format" ) . "</a>";
-                       }
-               }
-               return $wgLang->pipeList( $s );
-       }
-
-       /**
-        * Gets the h1 element with the page title.
-        * @return string
-        */
-       function pageTitle() {
-               global $wgOut;
-               $s = '<h1 class="pagetitle">' . $wgOut->getPageTitle() . '</h1>';
-               return $s;
-       }
-
-       function pageSubtitle() {
-               global $wgOut;
-
-               $sub = $wgOut->getSubtitle();
-
-               if ( $sub == '' ) {
-                       global $wgExtraSubtitle;
-                       $sub = wfMsgExt( 'tagline', 'parsemag' ) . $wgExtraSubtitle;
-               }
-
-               $subpages = $this->subPageSubtitle();
-               $sub .= !empty( $subpages ) ? "</p><p class='subpages'>$subpages" : '';
-               $s = "<p class='subtitle'>{$sub}</p>\n";
-
-               return $s;
-       }
-
        function subPageSubtitle() {
                $subpages = '';
 
@@ -1229,67 +993,6 @@ class Skin extends Linker {
                return $wgShowIPinHeader && session_id() != '';
        }
 
-       function nameAndLogin() {
-               global $wgUser, $wgLang, $wgContLang;
-
-               $logoutPage = $wgContLang->specialPage( 'Userlogout' );
-
-               $ret = '';
-
-               if ( $wgUser->isAnon() ) {
-                       if ( $this->showIPinHeader() ) {
-                               $name = wfGetIP();
-
-                               $talkLink = $this->link( $wgUser->getTalkPage(),
-                                       $wgLang->getNsText( NS_TALK ) );
-
-                               $ret .= "$name ($talkLink)";
-                       } else {
-                               $ret .= wfMsg( 'notloggedin' );
-                       }
-
-                       $returnTo = $this->mTitle->getPrefixedDBkey();
-                       $query = array();
-
-                       if ( $logoutPage != $returnTo ) {
-                               $query['returnto'] = $returnTo;
-                       }
-
-                       $loginlink = $wgUser->isAllowed( 'createaccount' )
-                               ? 'nav-login-createaccount'
-                               : 'login';
-                       $ret .= "\n<br />" . $this->link(
-                               SpecialPage::getTitleFor( 'Userlogin' ),
-                               wfMsg( $loginlink ), array(), $query
-                       );
-               } else {
-                       $returnTo = $this->mTitle->getPrefixedDBkey();
-                       $talkLink = $this->link( $wgUser->getTalkPage(),
-                               $wgLang->getNsText( NS_TALK ) );
-
-                       $ret .= $this->link( $wgUser->getUserPage(),
-                               htmlspecialchars( $wgUser->getName() ) );
-                       $ret .= " ($talkLink)<br />";
-                       $ret .= $wgLang->pipeList( array(
-                               $this->link(
-                                       SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
-                                       array(), array( 'returnto' => $returnTo )
-                               ),
-                               $this->specialLink( 'Preferences' ),
-                       ) );
-               }
-
-               $ret = $wgLang->pipeList( array(
-                       $ret,
-                       $this->link(
-                               Title::newFromText( wfMsgForContent( 'helppage' ) ),
-                               wfMsg( 'help' )
-                       ),
-               ) );
-
-               return $ret;
-       }
-
        function getSearchLink() {
                $searchPage = SpecialPage::getTitleFor( 'Search' );
                return $searchPage->getLocalURL();
@@ -1299,229 +1002,6 @@ class Skin extends Linker {
                return htmlspecialchars( $this->getSearchLink() );
        }
 
-       function searchForm() {
-               global $wgRequest, $wgUseTwoButtonsSearchForm;
-
-               $search = $wgRequest->getText( 'search' );
-
-               $s = '<form id="searchform' . $this->searchboxes . '" name="search" class="inline" method="post" action="'
-                 . $this->escapeSearchLink() . "\">\n"
-                 . '<input type="text" id="searchInput' . $this->searchboxes . '" name="search" size="19" value="'
-                 . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" />\n"
-                 . '<input type="submit" name="go" value="' . wfMsg( 'searcharticle' ) . '" />';
-
-               if ( $wgUseTwoButtonsSearchForm ) {
-                       $s .= '&#160;<input type="submit" name="fulltext" value="' . wfMsg( 'searchbutton' ) . "\" />\n";
-               } else {
-                       $s .= ' <a href="' . $this->escapeSearchLink() . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a>\n";
-               }
-
-               $s .= '</form>';
-
-               // Ensure unique id's for search boxes made after the first
-               $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
-
-               return $s;
-       }
-
-       function topLinks() {
-               global $wgOut;
-
-               $s = array(
-                       $this->mainPageLink(),
-                       $this->specialLink( 'Recentchanges' )
-               );
-
-               if ( $wgOut->isArticleRelated() ) {
-                       $s[] = $this->editThisPage();
-                       $s[] = $this->historyLink();
-               }
-
-               # Many people don't like this dropdown box
-               # $s[] = $this->specialPagesList();
-
-               if ( $this->variantLinks() ) {
-                       $s[] = $this->variantLinks();
-               }
-
-               if ( $this->extensionTabLinks() ) {
-                       $s[] = $this->extensionTabLinks();
-               }
-
-               // @todo FIXME: Is using Language::pipeList impossible here? Do not quite understand the use of the newline
-               return implode( $s, wfMsgExt( 'pipe-separator', 'escapenoentities' ) . "\n" );
-       }
-
-       /**
-        * Compatibility for extensions adding functionality through tabs.
-        * Eventually these old skins should be replaced with SkinTemplate-based
-        * versions, sigh...
-        * @return string
-        */
-       function extensionTabLinks() {
-               $tabs = array();
-               $out = '';
-               $s = array();
-               wfRunHooks( 'SkinTemplateTabs', array( $this, &$tabs ) );
-               foreach ( $tabs as $tab ) {
-                       $s[] = Xml::element( 'a',
-                               array( 'href' => $tab['href'] ),
-                               $tab['text'] );
-               }
-
-               if ( count( $s ) ) {
-                       global $wgLang;
-
-                       $out = wfMsgExt( 'pipe-separator' , 'escapenoentities' );
-                       $out .= $wgLang->pipeList( $s );
-               }
-
-               return $out;
-       }
-
-       /**
-        * Language/charset variant links for classic-style skins
-        * @return string
-        */
-       function variantLinks() {
-               $s = '';
-
-               /* show links to different language variants */
-               global $wgDisableLangConversion, $wgLang, $wgContLang;
-
-               $variants = $wgContLang->getVariants();
-
-               if ( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
-                       foreach ( $variants as $code ) {
-                               $varname = $wgContLang->getVariantname( $code );
-
-                               if ( $varname == 'disable' ) {
-                                       continue;
-                               }
-                               $s = $wgLang->pipeList( array(
-                                       $s,
-                                       '<a href="' . $this->mTitle->escapeLocalURL( 'variant=' . $code ) . '">' . htmlspecialchars( $varname ) . '</a>'
-                               ) );
-                       }
-               }
-
-               return $s;
-       }
-
-       function bottomLinks() {
-               global $wgOut, $wgUser, $wgUseTrackbacks;
-               $sep = wfMsgExt( 'pipe-separator', 'escapenoentities' ) . "\n";
-
-               $s = '';
-               if ( $wgOut->isArticleRelated() ) {
-                       $element[] = '<strong>' . $this->editThisPage() . '</strong>';
-
-                       if ( $wgUser->isLoggedIn() ) {
-                               $element[] = $this->watchThisPage();
-                       }
-
-                       $element[] = $this->talkLink();
-                       $element[] = $this->historyLink();
-                       $element[] = $this->whatLinksHere();
-                       $element[] = $this->watchPageLinksLink();
-
-                       if ( $wgUseTrackbacks ) {
-                               $element[] = $this->trackbackLink();
-                       }
-
-                       if (
-                               $this->mTitle->getNamespace() == NS_USER ||
-                               $this->mTitle->getNamespace() == NS_USER_TALK
-                       ) {
-                               $id = User::idFromName( $this->mTitle->getText() );
-                               $ip = User::isIP( $this->mTitle->getText() );
-
-                               # Both anons and non-anons have contributions list
-                               if ( $id || $ip ) {
-                                       $element[] = $this->userContribsLink();
-                               }
-
-                               if ( $this->showEmailUser( $id ) ) {
-                                       $element[] = $this->emailUserLink();
-                               }
-                       }
-
-                       $s = implode( $element, $sep );
-
-                       if ( $this->mTitle->getArticleId() ) {
-                               $s .= "\n<br />";
-
-                               // Delete/protect/move links for privileged users
-                               if ( $wgUser->isAllowed( 'delete' ) ) {
-                                       $s .= $this->deleteThisPage();
-                               }
-
-                               if ( $wgUser->isAllowed( 'protect' ) ) {
-                                       $s .= $sep . $this->protectThisPage();
-                               }
-
-                               if ( $wgUser->isAllowed( 'move' ) ) {
-                                       $s .= $sep . $this->moveThisPage();
-                               }
-                       }
-
-                       $s .= "<br />\n" . $this->otherLanguages();
-               }
-
-               return $s;
-       }
-
-       function pageStats() {
-               global $wgOut, $wgLang, $wgRequest, $wgUser;
-               global $wgDisableCounters, $wgMaxCredits, $wgShowCreditsIfMax, $wgPageShowWatchingUsers;
-
-               if ( !is_null( $wgRequest->getVal( 'oldid' ) ) || !is_null( $wgRequest->getVal( 'diff' ) ) ) {
-                       return '';
-               }
-
-               if ( !$wgOut->isArticle() || !$this->mTitle->exists() ) {
-                       return '';
-               }
-
-               $article = new Article( $this->mTitle, 0 );
-
-               $s = '';
-
-               if ( !$wgDisableCounters ) {
-                       $count = $wgLang->formatNum( $article->getCount() );
-
-                       if ( $count ) {
-                               $s = wfMsgExt( 'viewcount', array( 'parseinline' ), $count );
-                       }
-               }
-
-               if ( $wgMaxCredits != 0 ) {
-                       $s .= ' ' . Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
-               } else {
-                       $s .= $this->lastModified( $article );
-               }
-
-               if ( $wgPageShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ) ) {
-                       $dbr = wfGetDB( DB_SLAVE );
-                       $res = $dbr->select(
-                               'watchlist',
-                               array( 'COUNT(*) AS n' ),
-                               array(
-                                       'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ),
-                                       'wl_namespace' => $this->mTitle->getNamespace()
-                               ),
-                               __METHOD__
-                       );
-                       $x = $dbr->fetchObject( $res );
-
-                       $s .= ' ' . wfMsgExt( 'number_of_watching_users_pageview',
-                               array( 'parseinline' ), $wgLang->formatNum( $x->n )
-                       );
-               }
-
-               return $s . ' ' .  $this->getCopyright();
-       }
-
        function getCopyright( $type = 'detect' ) {
                global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgRequest;
 
@@ -1655,40 +1135,6 @@ class Skin extends Linker {
                return $s;
        }
 
-       /**
-        * Show a drop-down box of special pages
-        */
-       function specialPagesList() {
-               global $wgContLang, $wgServer, $wgRedirectScript;
-
-               $pages = array_merge( SpecialPage::getRegularPages(), SpecialPage::getRestrictedPages() );
-
-               foreach ( $pages as $name => $page ) {
-                       $pages[$name] = $page->getDescription();
-               }
-
-               $go = wfMsg( 'go' );
-               $sp = wfMsg( 'specialpages' );
-               $spp = $wgContLang->specialPage( 'Specialpages' );
-
-               $s = '<form id="specialpages" method="get" ' .
-                 'action="' . htmlspecialchars( "{$wgServer}{$wgRedirectScript}" ) . "\">\n";
-               $s .= "<select name=\"wpDropdown\">\n";
-               $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
-
-
-               foreach ( $pages as $name => $desc ) {
-                       $p = $wgContLang->specialPage( $name );
-                       $s .= "<option value=\"{$p}\">{$desc}</option>\n";
-               }
-
-               $s .= "</select>\n";
-               $s .= "<input type='submit' value=\"{$go}\" name='redirect' />\n";
-               $s .= "</form>\n";
-
-               return $s;
-       }
-
        /**
         * Renders a $wgFooterIcons icon acording to the method's arguments
         * @param $icon Array: The icon to build the html for, see $wgFooterIcons for the format of this array
@@ -1767,32 +1213,6 @@ class Skin extends Linker {
                return $this->footerLink( 'disclaimers', 'disclaimerpage' );
        }
 
-       function editThisPage() {
-               global $wgOut;
-
-               if ( !$wgOut->isArticleRelated() ) {
-                       $s = wfMsg( 'protectedpage' );
-               } else {
-                       if ( $this->mTitle->quickUserCan( 'edit' ) && $this->mTitle->exists() ) {
-                               $t = wfMsg( 'editthispage' );
-                       } elseif ( $this->mTitle->quickUserCan( 'create' ) && !$this->mTitle->exists() ) {
-                               $t = wfMsg( 'create-this-page' );
-                       } else {
-                               $t = wfMsg( 'viewsource' );
-                       }
-
-                       $s = $this->link(
-                               $this->mTitle,
-                               $t,
-                               array(),
-                               $this->editUrlOptions(),
-                               array( 'known', 'noclasses' )
-                       );
-               }
-
-               return $s;
-       }
-
        /**
         * Return URL options for the 'edit page' link.
         * This may include an 'oldid' specifier, if the current page view is such.
@@ -1810,129 +1230,6 @@ class Skin extends Linker {
                return $options;
        }
 
-       function deleteThisPage() {
-               global $wgUser, $wgRequest;
-
-               $diff = $wgRequest->getVal( 'diff' );
-
-               if ( $this->mTitle->getArticleId() && ( !$diff ) && $wgUser->isAllowed( 'delete' ) ) {
-                       $t = wfMsg( 'deletethispage' );
-
-                       $s = $this->link(
-                               $this->mTitle,
-                               $t,
-                               array(),
-                               array( 'action' => 'delete' ),
-                               array( 'known', 'noclasses' )
-                       );
-               } else {
-                       $s = '';
-               }
-
-               return $s;
-       }
-
-       function protectThisPage() {
-               global $wgUser, $wgRequest;
-
-               $diff = $wgRequest->getVal( 'diff' );
-
-               if ( $this->mTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed( 'protect' ) ) {
-                       if ( $this->mTitle->isProtected() ) {
-                               $text = wfMsg( 'unprotectthispage' );
-                               $query = array( 'action' => 'unprotect' );
-                       } else {
-                               $text = wfMsg( 'protectthispage' );
-                               $query = array( 'action' => 'protect' );
-                       }
-
-                       $s = $this->link(
-                               $this->mTitle,
-                               $text,
-                               array(),
-                               $query,
-                               array( 'known', 'noclasses' )
-                       );
-               } else {
-                       $s = '';
-               }
-
-               return $s;
-       }
-
-       function watchThisPage() {
-               global $wgOut;
-               ++$this->mWatchLinkNum;
-
-               if ( $wgOut->isArticleRelated() ) {
-                       if ( $this->mTitle->userIsWatching() ) {
-                               $text = wfMsg( 'unwatchthispage' );
-                               $query = array( 'action' => 'unwatch' );
-                               $id = 'mw-unwatch-link' . $this->mWatchLinkNum;
-                       } else {
-                               $text = wfMsg( 'watchthispage' );
-                               $query = array( 'action' => 'watch' );
-                               $id = 'mw-watch-link' . $this->mWatchLinkNum;
-                       }
-
-                       $s = $this->link(
-                               $this->mTitle,
-                               $text,
-                               array( 'id' => $id ),
-                               $query,
-                               array( 'known', 'noclasses' )
-                       );
-               } else {
-                       $s = wfMsg( 'notanarticle' );
-               }
-
-               return $s;
-       }
-
-       function moveThisPage() {
-               if ( $this->mTitle->quickUserCan( 'move' ) ) {
-                       return $this->link(
-                               SpecialPage::getTitleFor( 'Movepage' ),
-                               wfMsg( 'movethispage' ),
-                               array(),
-                               array( 'target' => $this->mTitle->getPrefixedDBkey() ),
-                               array( 'known', 'noclasses' )
-                       );
-               } else {
-                       // no message if page is protected - would be redundant
-                       return '';
-               }
-       }
-
-       function historyLink() {
-               return $this->link(
-                       $this->mTitle,
-                       wfMsgHtml( 'history' ),
-                       array( 'rel' => 'archives' ),
-                       array( 'action' => 'history' )
-               );
-       }
-
-       function whatLinksHere() {
-               return $this->link(
-                       SpecialPage::getTitleFor( 'Whatlinkshere', $this->mTitle->getPrefixedDBkey() ),
-                       wfMsgHtml( 'whatlinkshere' ),
-                       array(),
-                       array(),
-                       array( 'known', 'noclasses' )
-               );
-       }
-
-       function userContribsLink() {
-               return $this->link(
-                       SpecialPage::getTitleFor( 'Contributions', $this->mTitle->getDBkey() ),
-                       wfMsgHtml( 'contributions' ),
-                       array(),
-                       array(),
-                       array( 'known', 'noclasses' )
-               );
-       }
-
        function showEmailUser( $id ) {
                global $wgUser;
                $targetUser = User::newFromId( $id );
@@ -1940,182 +1237,6 @@ class Skin extends Linker {
                        $targetUser->canReceiveEmail(); # the target user must have a confirmed email address and allow emails from users
        }
 
-       function emailUserLink() {
-               return $this->link(
-                       SpecialPage::getTitleFor( 'Emailuser', $this->mTitle->getDBkey() ),
-                       wfMsg( 'emailuser' ),
-                       array(),
-                       array(),
-                       array( 'known', 'noclasses' )
-               );
-       }
-
-       function watchPageLinksLink() {
-               global $wgOut;
-
-               if ( !$wgOut->isArticleRelated() ) {
-                       return '(' . wfMsg( 'notanarticle' ) . ')';
-               } else {
-                       return $this->link(
-                               SpecialPage::getTitleFor( 'Recentchangeslinked', $this->mTitle->getPrefixedDBkey() ),
-                               wfMsg( 'recentchangeslinked-toolbox' ),
-                               array(),
-                               array(),
-                               array( 'known', 'noclasses' )
-                       );
-               }
-       }
-
-       function trackbackLink() {
-               return '<a href="' . $this->mTitle->trackbackURL() . '">'
-                       . wfMsg( 'trackbacklink' ) . '</a>';
-       }
-
-       function otherLanguages() {
-               global $wgOut, $wgContLang, $wgHideInterlanguageLinks;
-
-               if ( $wgHideInterlanguageLinks ) {
-                       return '';
-               }
-
-               $a = $wgOut->getLanguageLinks();
-
-               if ( 0 == count( $a ) ) {
-                       return '';
-               }
-
-               $s = wfMsg( 'otherlanguages' ) . wfMsg( 'colon-separator' );
-               $first = true;
-
-               if ( $wgContLang->isRTL() ) {
-                       $s .= '<span dir="LTR">';
-               }
-
-               foreach ( $a as $l ) {
-                       if ( !$first ) {
-                               $s .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
-                       }
-
-                       $first = false;
-
-                       $nt = Title::newFromText( $l );
-                       $url = $nt->escapeFullURL();
-                       $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
-                       $title = htmlspecialchars( $nt->getText() );
-
-                       if ( $text == '' ) {
-                               $text = $l;
-                       }
-
-                       $style = $this->getExternalLinkAttributes();
-                       $s .= "<a href=\"{$url}\" title=\"{$title}\"{$style}>{$text}</a>";
-               }
-
-               if ( $wgContLang->isRTL() ) {
-                       $s .= '</span>';
-               }
-
-               return $s;
-       }
-
-       function talkLink() {
-               if ( NS_SPECIAL == $this->mTitle->getNamespace() ) {
-                       # No discussion links for special pages
-                       return '';
-               }
-
-               $linkOptions = array();
-
-               if ( $this->mTitle->isTalkPage() ) {
-                       $link = $this->mTitle->getSubjectPage();
-                       switch( $link->getNamespace() ) {
-                               case NS_MAIN:
-                                       $text = wfMsg( 'articlepage' );
-                                       break;
-                               case NS_USER:
-                                       $text = wfMsg( 'userpage' );
-                                       break;
-                               case NS_PROJECT:
-                                       $text = wfMsg( 'projectpage' );
-                                       break;
-                               case NS_FILE:
-                                       $text = wfMsg( 'imagepage' );
-                                       # Make link known if image exists, even if the desc. page doesn't.
-                                       if ( wfFindFile( $link ) )
-                                               $linkOptions[] = 'known';
-                                       break;
-                               case NS_MEDIAWIKI:
-                                       $text = wfMsg( 'mediawikipage' );
-                                       break;
-                               case NS_TEMPLATE:
-                                       $text = wfMsg( 'templatepage' );
-                                       break;
-                               case NS_HELP:
-                                       $text = wfMsg( 'viewhelppage' );
-                                       break;
-                               case NS_CATEGORY:
-                                       $text = wfMsg( 'categorypage' );
-                                       break;
-                               default:
-                                       $text = wfMsg( 'articlepage' );
-                       }
-               } else {
-                       $link = $this->mTitle->getTalkPage();
-                       $text = wfMsg( 'talkpage' );
-               }
-
-               $s = $this->link( $link, $text, array(), array(), $linkOptions );
-
-               return $s;
-       }
-
-       function commentLink() {
-               global $wgOut;
-
-               if ( $this->mTitle->getNamespace() == NS_SPECIAL ) {
-                       return '';
-               }
-
-               # __NEWSECTIONLINK___ changes behaviour here
-               # If it is present, the link points to this page, otherwise
-               # it points to the talk page
-               if ( $this->mTitle->isTalkPage() ) {
-                       $title = $this->mTitle;
-               } elseif ( $wgOut->showNewSectionLink() ) {
-                       $title = $this->mTitle;
-               } else {
-                       $title = $this->mTitle->getTalkPage();
-               }
-
-               return $this->link(
-                       $title,
-                       wfMsg( 'postcomment' ),
-                       array(),
-                       array(
-                               'action' => 'edit',
-                               'section' => 'new'
-                       ),
-                       array( 'known', 'noclasses' )
-               );
-       }
-
-       function getUploadLink() {
-               global $wgUploadNavigationUrl;
-
-               if ( $wgUploadNavigationUrl ) {
-                       # Using an empty class attribute to avoid automatic setting of "external" class
-                       return $this->makeExternalLink( $wgUploadNavigationUrl, wfMsgHtml( 'upload' ), false, null, array( 'class' => '' ) );
-               } else {
-                       return $this->link(
-                               SpecialPage::getTitleFor( 'Upload' ),
-                               wfMsgHtml( 'upload' ),
-                               array(),
-                               array(),
-                               array( 'known', 'noclasses' )
-                       );
-               }
-       }
-
        /**
         * Return a fully resolved style path url to images or styles stored in the common folder.
         * This method returns a url resolved using the configured skin style path
diff --git a/includes/SkinLegacy.php b/includes/SkinLegacy.php
new file mode 100644 (file)
index 0000000..0137ad2
--- /dev/null
@@ -0,0 +1,937 @@
+<?php
+/**
+ * @defgroup Skins Skins
+ */
+
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die( 1 );
+}
+
+class SkinLegacy extends SkinTemplate {
+       var $useHeadElement = true;
+
+       /**
+        * Add skin specific stylesheets
+        * @param $out OutputPage
+        */
+       function setupSkinUserCss( OutputPage $out ) {
+               $out->addModuleStyles( 'mediawiki.legacy.shared' );
+               $out->addModuleStyles( 'mediawiki.legacy.oldshared' );
+       }
+
+       public function commonPrintStylesheet() {
+               return true;
+       }
+
+       /**
+        * This was for the old skins and for users with 640x480 screen.
+        * Please note old skins are still used and might prove useful for
+        * users having old computers or visually impaired.
+        */
+       var $mSuppressQuickbar = false;
+
+       /**
+        * Suppress the quickbar from the output, only for skin supporting
+        * the quickbar
+        */
+       public function suppressQuickbar() {
+               $this->mSuppressQuickbar = true;
+       }
+
+       /**
+        * Return whether the quickbar should be suppressed from the output
+        *
+        * @return Boolean
+        */
+       public function isQuickbarSuppressed() {
+               return $this->mSuppressQuickbar;
+       }
+
+       function qbSetting() {
+               global $wgOut, $wgUser;
+               if ( $this->isQuickbarSuppressed() ) {
+                       return 0;
+               }
+               $q = $wgUser->getOption( 'quickbar', 0 );
+               return $q;
+       }
+
+}
+
+class LegacyTemplate extends BaseTemplate {
+       
+       // How many search boxes have we made?  Avoid duplicate id's.
+       protected $searchboxes = '';
+       
+       function execute() {
+               $this->html( 'headelement' );
+               echo $this->beforeContent();
+               $this->html( 'bodytext' );
+               echo "\n";
+               echo $this->afterContent();
+               $this->html( 'dataAfterContent' );
+               $this->printTrail();
+               echo "\n</body></html>";
+       }
+       
+       /**
+        * This will be called immediately after the <body> tag.  Split into
+        * two functions to make it easier to subclass.
+        */
+       function beforeContent() {
+               return $this->doBeforeContent();
+       }
+
+       function doBeforeContent() {
+               global $wgContLang;
+               wfProfileIn( __METHOD__ );
+
+               $s = '';
+               $qb = $this->getSkin()->qbSetting();
+
+               $langlinks = $this->otherLanguages();
+               if ( $langlinks ) {
+                       $rows = 2;
+                       $borderhack = '';
+               } else {
+                       $rows = 1;
+                       $langlinks = false;
+                       $borderhack = 'class="top"';
+               }
+
+               $s .= "\n<div id='content'>\n<div id='topbar'>\n" .
+                 "<table border='0' cellspacing='0' width='98%'>\n<tr>\n";
+
+               $shove = ( $qb != 0 );
+               $left = ( $qb == 1 || $qb == 3 );
+
+               if ( !$shove ) {
+                       $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" .
+                               $this->logoText() . '</td>';
+               } elseif ( $left ) {
+                       $s .= $this->getQuickbarCompensator( $rows );
+               }
+
+               $l = $wgContLang->alignStart();
+               $s .= "<td {$borderhack} align='$l' valign='top'>\n";
+
+               $s .= $this->topLinks();
+               $s .= '<p class="subtitle">' . $this->pageTitleLinks() . "</p>\n";
+
+               $r = $wgContLang->alignEnd();
+               $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap='nowrap'>";
+               $s .= $this->nameAndLogin();
+               $s .= "\n<br />" . $this->searchForm() . '</td>';
+
+               if ( $langlinks ) {
+                       $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";
+
+               $notice = wfGetSiteNotice();
+
+               if ( $notice ) {
+                       $s .= "\n<div id='siteNotice'>$notice</div>\n";
+               }
+               $s .= $this->pageTitle();
+               $s .= $this->pageSubtitle();
+               $s .= $this->getSkin()->getCategories();
+
+               wfProfileOut( __METHOD__ );
+               return $s;
+       }
+
+       /**
+        * This gets called shortly before the </body> tag.
+        * @return String HTML to be put before </body>
+        */
+       function afterContent() {
+               return $this->doAfterContent();
+       }
+
+       /** overloaded by derived classes */
+       function doAfterContent() {
+               return '</div></div>';
+       }
+
+       function searchForm() {
+               global $wgRequest, $wgUseTwoButtonsSearchForm;
+
+               $search = $wgRequest->getText( 'search' );
+
+               $s = '<form id="searchform' . $this->searchboxes . '" name="search" class="inline" method="post" action="'
+                 . $this->getSkin()->escapeSearchLink() . "\">\n"
+                 . '<input type="text" id="searchInput' . $this->searchboxes . '" name="search" size="19" value="'
+                 . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" />\n"
+                 . '<input type="submit" name="go" value="' . wfMsg( 'searcharticle' ) . '" />';
+
+               if ( $wgUseTwoButtonsSearchForm ) {
+                       $s .= '&#160;<input type="submit" name="fulltext" value="' . wfMsg( 'searchbutton' ) . "\" />\n";
+               } else {
+                       $s .= ' <a href="' . $this->getSkin()->escapeSearchLink() . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a>\n";
+               }
+
+               $s .= '</form>';
+
+               // Ensure unique id's for search boxes made after the first
+               $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
+
+               return $s;
+       }
+
+       function pageStats() {
+               global $wgOut, $wgLang, $wgRequest, $wgUser;
+               global $wgDisableCounters, $wgMaxCredits, $wgShowCreditsIfMax, $wgPageShowWatchingUsers;
+
+               if ( !is_null( $wgRequest->getVal( 'oldid' ) ) || !is_null( $wgRequest->getVal( 'diff' ) ) ) {
+                       return '';
+               }
+
+               if ( !$wgOut->isArticle() || !$this->getSkin()->getTitle()->exists() ) {
+                       return '';
+               }
+
+               $article = new Article( $this->getSkin()->getTitle(), 0 );
+
+               $s = '';
+
+               if ( !$wgDisableCounters ) {
+                       $count = $wgLang->formatNum( $article->getCount() );
+
+                       if ( $count ) {
+                               $s = wfMsgExt( 'viewcount', array( 'parseinline' ), $count );
+                       }
+               }
+
+               if ( $wgMaxCredits != 0 ) {
+                       $s .= ' ' . Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
+               } else {
+                       $s .= $this->data['lastmod'];
+               }
+
+               if ( $wgPageShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ) ) {
+                       $dbr = wfGetDB( DB_SLAVE );
+                       $res = $dbr->select(
+                               'watchlist',
+                               array( 'COUNT(*) AS n' ),
+                               array(
+                                       'wl_title' => $dbr->strencode( $this->getSkin()->getTitle()->getDBkey() ),
+                                       'wl_namespace' => $this->getSkin()->getTitle()->getNamespace()
+                               ),
+                               __METHOD__
+                       );
+                       $x = $dbr->fetchObject( $res );
+
+                       $s .= ' ' . wfMsgExt( 'number_of_watching_users_pageview',
+                               array( 'parseinline' ), $wgLang->formatNum( $x->n )
+                       );
+               }
+
+               return $s . ' ' .  $this->getSkin()->getCopyright();
+       }
+
+       function topLinks() {
+               global $wgOut;
+
+               $s = array(
+                       $this->getSkin()->mainPageLink(),
+                       $this->getSkin()->specialLink( 'Recentchanges' )
+               );
+
+               if ( $wgOut->isArticleRelated() ) {
+                       $s[] = $this->editThisPage();
+                       $s[] = $this->historyLink();
+               }
+
+               # Many people don't like this dropdown box
+               # $s[] = $this->specialPagesList();
+
+               if ( $this->variantLinks() ) {
+                       $s[] = $this->variantLinks();
+               }
+
+               if ( $this->extensionTabLinks() ) {
+                       $s[] = $this->extensionTabLinks();
+               }
+
+               // @todo FIXME: Is using Language::pipeList impossible here? Do not quite understand the use of the newline
+               return implode( $s, wfMsgExt( 'pipe-separator', 'escapenoentities' ) . "\n" );
+       }
+
+       /**
+        * Language/charset variant links for classic-style skins
+        * @return string
+        */
+       function variantLinks() {
+               $s = '';
+
+               /* show links to different language variants */
+               global $wgDisableLangConversion, $wgLang, $wgContLang;
+
+               $variants = $wgContLang->getVariants();
+
+               if ( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
+                       foreach ( $variants as $code ) {
+                               $varname = $wgContLang->getVariantname( $code );
+
+                               if ( $varname == 'disable' ) {
+                                       continue;
+                               }
+                               $s = $wgLang->pipeList( array(
+                                       $s,
+                                       '<a href="' . $this->getSkin()->getTitle()->escapeLocalURL( 'variant=' . $code ) . '">' . htmlspecialchars( $varname ) . '</a>'
+                               ) );
+                       }
+               }
+
+               return $s;
+       }
+
+       /**
+        * Compatibility for extensions adding functionality through tabs.
+        * Eventually these old skins should be replaced with SkinTemplate-based
+        * versions, sigh...
+        * @return string
+        * @todo Exterminate! ...that, and replace it with normal SkinTemplate stuff
+        */
+       function extensionTabLinks() {
+               $tabs = array();
+               $out = '';
+               $s = array();
+               wfRunHooks( 'SkinTemplateTabs', array( $this->getSkin(), &$tabs ) );
+               foreach ( $tabs as $tab ) {
+                       $s[] = Xml::element( 'a',
+                               array( 'href' => $tab['href'] ),
+                               $tab['text'] );
+               }
+
+               if ( count( $s ) ) {
+                       global $wgLang;
+
+                       $out = wfMsgExt( 'pipe-separator' , 'escapenoentities' );
+                       $out .= $wgLang->pipeList( $s );
+               }
+
+               return $out;
+       }
+
+       function bottomLinks() {
+               global $wgOut, $wgUser, $wgUseTrackbacks;
+               $sep = wfMsgExt( 'pipe-separator', 'escapenoentities' ) . "\n";
+
+               $s = '';
+               if ( $wgOut->isArticleRelated() ) {
+                       $element[] = '<strong>' . $this->editThisPage() . '</strong>';
+
+                       if ( $wgUser->isLoggedIn() ) {
+                               $element[] = $this->watchThisPage();
+                       }
+
+                       $element[] = $this->talkLink();
+                       $element[] = $this->historyLink();
+                       $element[] = $this->whatLinksHere();
+                       $element[] = $this->watchPageLinksLink();
+
+                       if ( $wgUseTrackbacks ) {
+                               $element[] = $this->trackbackLink();
+                       }
+
+                       if (
+                               $this->getSkin()->getTitle()->getNamespace() == NS_USER ||
+                               $this->getSkin()->getTitle()->getNamespace() == NS_USER_TALK
+                       ) {
+                               $id = User::idFromName( $this->getSkin()->getTitle()->getText() );
+                               $ip = User::isIP( $this->getSkin()->getTitle()->getText() );
+
+                               # Both anons and non-anons have contributions list
+                               if ( $id || $ip ) {
+                                       $element[] = $this->userContribsLink();
+                               }
+
+                               if ( $this->getSkin()->showEmailUser( $id ) ) {
+                                       $element[] = $this->emailUserLink();
+                               }
+                       }
+
+                       $s = implode( $element, $sep );
+
+                       if ( $this->getSkin()->getTitle()->getArticleId() ) {
+                               $s .= "\n<br />";
+
+                               // Delete/protect/move links for privileged users
+                               if ( $wgUser->isAllowed( 'delete' ) ) {
+                                       $s .= $this->deleteThisPage();
+                               }
+
+                               if ( $wgUser->isAllowed( 'protect' ) ) {
+                                       $s .= $sep . $this->protectThisPage();
+                               }
+
+                               if ( $wgUser->isAllowed( 'move' ) ) {
+                                       $s .= $sep . $this->moveThisPage();
+                               }
+                       }
+
+                       $s .= "<br />\n" . $this->otherLanguages();
+               }
+
+               return $s;
+       }
+
+       function otherLanguages() {
+               global $wgOut, $wgContLang, $wgHideInterlanguageLinks;
+
+               if ( $wgHideInterlanguageLinks ) {
+                       return '';
+               }
+
+               $a = $wgOut->getLanguageLinks();
+
+               if ( 0 == count( $a ) ) {
+                       return '';
+               }
+
+               $s = wfMsg( 'otherlanguages' ) . wfMsg( 'colon-separator' );
+               $first = true;
+
+               if ( $wgContLang->isRTL() ) {
+                       $s .= '<span dir="LTR">';
+               }
+
+               foreach ( $a as $l ) {
+                       if ( !$first ) {
+                               $s .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
+                       }
+
+                       $first = false;
+
+                       $nt = Title::newFromText( $l );
+                       $url = $nt->escapeFullURL();
+                       $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
+                       $title = htmlspecialchars( $nt->getText() );
+
+                       if ( $text == '' ) {
+                               $text = $l;
+                       }
+
+                       $style = $this->getExternalLinkAttributes();
+                       $s .= "<a href=\"{$url}\" title=\"{$title}\"{$style}>{$text}</a>";
+               }
+
+               if ( $wgContLang->isRTL() ) {
+                       $s .= '</span>';
+               }
+
+               return $s;
+       }
+
+       /**
+        * Show a drop-down box of special pages
+        */
+       function specialPagesList() {
+               global $wgContLang, $wgServer, $wgRedirectScript;
+
+               $pages = array_merge( SpecialPage::getRegularPages(), SpecialPage::getRestrictedPages() );
+
+               foreach ( $pages as $name => $page ) {
+                       $pages[$name] = $page->getDescription();
+               }
+
+               $go = wfMsg( 'go' );
+               $sp = wfMsg( 'specialpages' );
+               $spp = $wgContLang->specialPage( 'Specialpages' );
+
+               $s = '<form id="specialpages" method="get" ' .
+                 'action="' . htmlspecialchars( "{$wgServer}{$wgRedirectScript}" ) . "\">\n";
+               $s .= "<select name=\"wpDropdown\">\n";
+               $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
+
+
+               foreach ( $pages as $name => $desc ) {
+                       $p = $wgContLang->specialPage( $name );
+                       $s .= "<option value=\"{$p}\">{$desc}</option>\n";
+               }
+
+               $s .= "</select>\n";
+               $s .= "<input type='submit' value=\"{$go}\" name='redirect' />\n";
+               $s .= "</form>\n";
+
+               return $s;
+       }
+
+       function pageTitleLinks() {
+               global $wgOut, $wgUser, $wgRequest, $wgLang;
+
+               $oldid = $wgRequest->getVal( 'oldid' );
+               $diff = $wgRequest->getVal( 'diff' );
+               $action = $wgRequest->getText( 'action' );
+
+               $s[] = $this->printableLink();
+               $disclaimer = $this->getSkin()->disclaimerLink(); # may be empty
+
+               if ( $disclaimer ) {
+                       $s[] = $disclaimer;
+               }
+
+               $privacy = $this->getSkin()->privacyLink(); # may be empty too
+
+               if ( $privacy ) {
+                       $s[] = $privacy;
+               }
+
+               if ( $wgOut->isArticleRelated() ) {
+                       if ( $this->getSkin()->getTitle()->getNamespace() == NS_FILE ) {
+                               $name = $this->getSkin()->getTitle()->getDBkey();
+                               $image = wfFindFile( $this->getSkin()->getTitle() );
+
+                               if ( $image ) {
+                                       $link = htmlspecialchars( $image->getURL() );
+                                       $style = $this->getInternalLinkAttributes( $link, $name );
+                                       $s[] = "<a href=\"{$link}\"{$style}>{$name}</a>";
+                               }
+                       }
+               }
+
+               if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) {
+                       $s[] .= $this->getSkin()->link(
+                                       $this->getSkin()->getTitle(),
+                                       wfMsg( 'currentrev' ),
+                                       array(),
+                                       array(),
+                                       array( 'known', 'noclasses' )
+                       );
+               }
+
+               if ( $wgUser->getNewtalk() ) {
+                       # do not show "You have new messages" text when we are viewing our
+                       # own talk page
+                       if ( !$this->getSkin()->getTitle()->equals( $wgUser->getTalkPage() ) ) {
+                               $tl = $this->getSkin()->link(
+                                       $wgUser->getTalkPage(),
+                                       wfMsgHtml( 'newmessageslink' ),
+                                       array(),
+                                       array( 'redirect' => 'no' ),
+                                       array( 'known', 'noclasses' )
+                               );
+
+                               $dl = $this->getSkin()->link(
+                                       $wgUser->getTalkPage(),
+                                       wfMsgHtml( 'newmessagesdifflink' ),
+                                       array(),
+                                       array( 'diff' => 'cur' ),
+                                       array( 'known', 'noclasses' )
+                               );
+                               $s[] = '<strong>' . wfMsg( 'youhavenewmessages', $tl, $dl ) . '</strong>';
+                               # disable caching
+                               $wgOut->setSquidMaxage( 0 );
+                               $wgOut->enableClientCache( false );
+                       }
+               }
+
+               $undelete = $this->getSkin()->getUndeleteLink();
+
+               if ( !empty( $undelete ) ) {
+                       $s[] = $undelete;
+               }
+
+               return $wgLang->pipeList( $s );
+       }
+
+       /**
+        * Gets the h1 element with the page title.
+        * @return string
+        */
+       function pageTitle() {
+               global $wgOut;
+               $s = '<h1 class="pagetitle">' . $wgOut->getPageTitle() . '</h1>';
+               return $s;
+       }
+
+       function pageSubtitle() {
+               global $wgOut;
+
+               $sub = $wgOut->getSubtitle();
+
+               if ( $sub == '' ) {
+                       global $wgExtraSubtitle;
+                       $sub = wfMsgExt( 'tagline', 'parsemag' ) . $wgExtraSubtitle;
+               }
+
+               $subpages = $this->getSkin()->subPageSubtitle();
+               $sub .= !empty( $subpages ) ? "</p><p class='subpages'>$subpages" : '';
+               $s = "<p class='subtitle'>{$sub}</p>\n";
+
+               return $s;
+       }
+
+       function printableLink() {
+               global $wgOut, $wgFeedClasses, $wgRequest, $wgLang;
+
+               $s = array();
+
+               if ( !$wgOut->isPrintable() ) {
+                       $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
+                       $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
+               }
+
+               if ( $wgOut->isSyndicated() ) {
+                       foreach ( $wgFeedClasses as $format => $class ) {
+                               $feedurl = $wgRequest->escapeAppendQuery( "feed=$format" );
+                               $s[] = "<a href=\"$feedurl\" rel=\"alternate\" type=\"application/{$format}+xml\""
+                                               . " class=\"feedlink\">" . wfMsgHtml( "feed-$format" ) . "</a>";
+                       }
+               }
+               return $wgLang->pipeList( $s );
+       }
+
+       function getQuickbarCompensator( $rows = 1 ) {
+               return "<td width='152' rowspan='{$rows}'>&#160;</td>";
+       }
+
+       function editThisPage() {
+               global $wgOut;
+
+               if ( !$wgOut->isArticleRelated() ) {
+                       $s = wfMsg( 'protectedpage' );
+               } else {
+                       if ( $this->getSkin()->getTitle()->quickUserCan( 'edit' ) && $this->getSkin()->getTitle()->exists() ) {
+                               $t = wfMsg( 'editthispage' );
+                       } elseif ( $this->getSkin()->getTitle()->quickUserCan( 'create' ) && !$this->getSkin()->getTitle()->exists() ) {
+                               $t = wfMsg( 'create-this-page' );
+                       } else {
+                               $t = wfMsg( 'viewsource' );
+                       }
+
+                       $s = $this->getSkin()->link(
+                               $this->getSkin()->getTitle(),
+                               $t,
+                               array(),
+                               $this->getSkin()->editUrlOptions(),
+                               array( 'known', 'noclasses' )
+                       );
+               }
+
+               return $s;
+       }
+
+       function deleteThisPage() {
+               global $wgUser, $wgRequest;
+
+               $diff = $wgRequest->getVal( 'diff' );
+
+               if ( $this->getSkin()->getTitle()->getArticleId() && ( !$diff ) && $wgUser->isAllowed( 'delete' ) ) {
+                       $t = wfMsg( 'deletethispage' );
+
+                       $s = $this->getSkin()->link(
+                               $this->getSkin()->getTitle(),
+                               $t,
+                               array(),
+                               array( 'action' => 'delete' ),
+                               array( 'known', 'noclasses' )
+                       );
+               } else {
+                       $s = '';
+               }
+
+               return $s;
+       }
+
+       function protectThisPage() {
+               global $wgUser, $wgRequest;
+
+               $diff = $wgRequest->getVal( 'diff' );
+
+               if ( $this->getSkin()->getTitle()->getArticleId() && ( ! $diff ) && $wgUser->isAllowed( 'protect' ) ) {
+                       if ( $this->getSkin()->getTitle()->isProtected() ) {
+                               $text = wfMsg( 'unprotectthispage' );
+                               $query = array( 'action' => 'unprotect' );
+                       } else {
+                               $text = wfMsg( 'protectthispage' );
+                               $query = array( 'action' => 'protect' );
+                       }
+
+                       $s = $this->getSkin()->link(
+                               $this->getSkin()->getTitle(),
+                               $text,
+                               array(),
+                               $query,
+                               array( 'known', 'noclasses' )
+                       );
+               } else {
+                       $s = '';
+               }
+
+               return $s;
+       }
+
+       function watchThisPage() {
+               global $wgOut;
+               ++$this->mWatchLinkNum;
+
+               if ( $wgOut->isArticleRelated() ) {
+                       if ( $this->getSkin()->getTitle()->userIsWatching() ) {
+                               $text = wfMsg( 'unwatchthispage' );
+                               $query = array( 'action' => 'unwatch' );
+                               $id = 'mw-unwatch-link' . $this->mWatchLinkNum;
+                       } else {
+                               $text = wfMsg( 'watchthispage' );
+                               $query = array( 'action' => 'watch' );
+                               $id = 'mw-watch-link' . $this->mWatchLinkNum;
+                       }
+
+                       $s = $this->getSkin()->link(
+                               $this->getSkin()->getTitle(),
+                               $text,
+                               array( 'id' => $id ),
+                               $query,
+                               array( 'known', 'noclasses' )
+                       );
+               } else {
+                       $s = wfMsg( 'notanarticle' );
+               }
+
+               return $s;
+       }
+
+       function moveThisPage() {
+               if ( $this->getSkin()->getTitle()->quickUserCan( 'move' ) ) {
+                       return $this->getSkin()->link(
+                               SpecialPage::getTitleFor( 'Movepage' ),
+                               wfMsg( 'movethispage' ),
+                               array(),
+                               array( 'target' => $this->getSkin()->getTitle()->getPrefixedDBkey() ),
+                               array( 'known', 'noclasses' )
+                       );
+               } else {
+                       // no message if page is protected - would be redundant
+                       return '';
+               }
+       }
+
+       function historyLink() {
+               return $this->getSkin()->link(
+                       $this->getSkin()->getTitle(),
+                       wfMsgHtml( 'history' ),
+                       array( 'rel' => 'archives' ),
+                       array( 'action' => 'history' )
+               );
+       }
+
+       function whatLinksHere() {
+               return $this->getSkin()->link(
+                       SpecialPage::getTitleFor( 'Whatlinkshere', $this->getSkin()->getTitle()->getPrefixedDBkey() ),
+                       wfMsgHtml( 'whatlinkshere' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
+       }
+
+       function userContribsLink() {
+               return $this->getSkin()->link(
+                       SpecialPage::getTitleFor( 'Contributions', $this->getSkin()->getTitle()->getDBkey() ),
+                       wfMsgHtml( 'contributions' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
+       }
+
+       function emailUserLink() {
+               return $this->getSkin()->link(
+                       SpecialPage::getTitleFor( 'Emailuser', $this->getSkin()->getTitle()->getDBkey() ),
+                       wfMsg( 'emailuser' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
+       }
+
+       function watchPageLinksLink() {
+               global $wgOut;
+
+               if ( !$wgOut->isArticleRelated() ) {
+                       return '(' . wfMsg( 'notanarticle' ) . ')';
+               } else {
+                       return $this->getSkin()->link(
+                               SpecialPage::getTitleFor( 'Recentchangeslinked', $this->getSkin()->getTitle()->getPrefixedDBkey() ),
+                               wfMsg( 'recentchangeslinked-toolbox' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
+               }
+       }
+
+       function trackbackLink() {
+               return '<a href="' . $this->getSkin()->getTitle()->trackbackURL() . '">'
+                       . wfMsg( 'trackbacklink' ) . '</a>';
+       }
+
+       function talkLink() {
+               if ( NS_SPECIAL == $this->getSkin()->getTitle()->getNamespace() ) {
+                       # No discussion links for special pages
+                       return '';
+               }
+
+               $linkOptions = array();
+
+               if ( $this->getSkin()->getTitle()->isTalkPage() ) {
+                       $link = $this->getSkin()->getTitle()->getSubjectPage();
+                       switch( $link->getNamespace() ) {
+                               case NS_MAIN:
+                                       $text = wfMsg( 'articlepage' );
+                                       break;
+                               case NS_USER:
+                                       $text = wfMsg( 'userpage' );
+                                       break;
+                               case NS_PROJECT:
+                                       $text = wfMsg( 'projectpage' );
+                                       break;
+                               case NS_FILE:
+                                       $text = wfMsg( 'imagepage' );
+                                       # Make link known if image exists, even if the desc. page doesn't.
+                                       if ( wfFindFile( $link ) )
+                                               $linkOptions[] = 'known';
+                                       break;
+                               case NS_MEDIAWIKI:
+                                       $text = wfMsg( 'mediawikipage' );
+                                       break;
+                               case NS_TEMPLATE:
+                                       $text = wfMsg( 'templatepage' );
+                                       break;
+                               case NS_HELP:
+                                       $text = wfMsg( 'viewhelppage' );
+                                       break;
+                               case NS_CATEGORY:
+                                       $text = wfMsg( 'categorypage' );
+                                       break;
+                               default:
+                                       $text = wfMsg( 'articlepage' );
+                       }
+               } else {
+                       $link = $this->getSkin()->getTitle()->getTalkPage();
+                       $text = wfMsg( 'talkpage' );
+               }
+
+               $s = $this->getSkin()->link( $link, $text, array(), array(), $linkOptions );
+
+               return $s;
+       }
+
+       function commentLink() {
+               global $wgOut;
+
+               if ( $this->getSkin()->getTitle()->getNamespace() == NS_SPECIAL ) {
+                       return '';
+               }
+
+               # __NEWSECTIONLINK___ changes behaviour here
+               # If it is present, the link points to this page, otherwise
+               # it points to the talk page
+               if ( $this->getSkin()->getTitle()->isTalkPage() ) {
+                       $title = $this->getSkin()->getTitle();
+               } elseif ( $wgOut->showNewSectionLink() ) {
+                       $title = $this->getSkin()->getTitle();
+               } else {
+                       $title = $this->getSkin()->getTitle()->getTalkPage();
+               }
+
+               return $this->getSkin()->link(
+                       $title,
+                       wfMsg( 'postcomment' ),
+                       array(),
+                       array(
+                               'action' => 'edit',
+                               'section' => 'new'
+                       ),
+                       array( 'known', 'noclasses' )
+               );
+       }
+
+       function getUploadLink() {
+               global $wgUploadNavigationUrl;
+
+               if ( $wgUploadNavigationUrl ) {
+                       # Using an empty class attribute to avoid automatic setting of "external" class
+                       return $this->makeExternalLink( $wgUploadNavigationUrl, wfMsgHtml( 'upload' ), false, null, array( 'class' => '' ) );
+               } else {
+                       return $this->getSkin()->link(
+                               SpecialPage::getTitleFor( 'Upload' ),
+                               wfMsgHtml( 'upload' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
+               }
+       }
+
+       function nameAndLogin() {
+               global $wgUser, $wgLang, $wgContLang;
+
+               $logoutPage = $wgContLang->specialPage( 'Userlogout' );
+
+               $ret = '';
+
+               if ( $wgUser->isAnon() ) {
+                       if ( $this->getSkin()->showIPinHeader() ) {
+                               $name = wfGetIP();
+
+                               $talkLink = $this->getSkin()->link( $wgUser->getTalkPage(),
+                                       $wgLang->getNsText( NS_TALK ) );
+
+                               $ret .= "$name ($talkLink)";
+                       } else {
+                               $ret .= wfMsg( 'notloggedin' );
+                       }
+
+                       $returnTo = $this->getSkin()->getTitle()->getPrefixedDBkey();
+                       $query = array();
+
+                       if ( $logoutPage != $returnTo ) {
+                               $query['returnto'] = $returnTo;
+                       }
+
+                       $loginlink = $wgUser->isAllowed( 'createaccount' )
+                               ? 'nav-login-createaccount'
+                               : 'login';
+                       $ret .= "\n<br />" . $this->getSkin()->link(
+                               SpecialPage::getTitleFor( 'Userlogin' ),
+                               wfMsg( $loginlink ), array(), $query
+                       );
+               } else {
+                       $returnTo = $this->getSkin()->getTitle()->getPrefixedDBkey();
+                       $talkLink = $this->getSkin()->link( $wgUser->getTalkPage(),
+                               $wgLang->getNsText( NS_TALK ) );
+
+                       $ret .= $this->getSkin()->link( $wgUser->getUserPage(),
+                               htmlspecialchars( $wgUser->getName() ) );
+                       $ret .= " ($talkLink)<br />";
+                       $ret .= $wgLang->pipeList( array(
+                               $this->getSkin()->link(
+                                       SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
+                                       array(), array( 'returnto' => $returnTo )
+                               ),
+                               $this->getSkin()->specialLink( 'Preferences' ),
+                       ) );
+               }
+
+               $ret = $wgLang->pipeList( array(
+                       $ret,
+                       $this->getSkin()->link(
+                               Title::newFromText( wfMsgForContent( 'helppage' ) ),
+                               wfMsg( 'help' )
+                       ),
+               ) );
+
+               return $ret;
+       }
+
+}
+
index 0faec2f..7da4983 100644 (file)
@@ -179,8 +179,6 @@ CONTROL;
                        return;
                }
 
-               $wgOut->suppressQuickbar();
-
                $oldTitle = $this->mOldPage->getPrefixedText();
                $newTitle = $this->mNewPage->getPrefixedText();
                if ( $oldTitle == $newTitle ) {
@@ -204,6 +202,9 @@ CONTROL;
                }
 
                $sk = $wgUser->getSkin();
+               if ( method_exists( $sk, 'suppressQuickbar' ) ) {
+                       $sk->suppressQuickbar();
+               }
 
                // Check if page is editable
                $editable = $this->mNewRev->getTitle()->userCan( 'edit' );
index 2fdfe87..0363072 100644 (file)
@@ -15,12 +15,46 @@ if( !defined( 'MEDIAWIKI' ) ) {
  * @todo document
  * @ingroup Skins
  */
-class SkinCologneBlue extends Skin {
+class SkinCologneBlue extends SkinLegacy {
+       var $skinname = 'cologneblue', $stylename = 'cologneblue',
+               $template = 'CologneBlueTemplate';
 
-       function getSkinName() {
-               return 'cologneblue';
+       function setupSkinUserCss( OutputPage $out ){
+               parent::setupSkinUserCss( $out );
+               $out->addModuleStyles( 'skins.cologneblue' );
+
+               global $wgContLang;
+               $qb = $this->qbSetting();
+               $rules = array();
+
+               if ( 2 == $qb ) { # Right
+                       $rules[] = "#quickbar { position: absolute; right: 4px; }";
+                       $rules[] = "#article { margin-left: 4px; margin-right: 148px; }";
+               } elseif ( 1 == $qb ) {
+                       $rules[] = "#quickbar { position: absolute; left: 4px; }";
+                       $rules[] = "#article { margin-left: 148px; margin-right: 4px; }";
+               } elseif ( 3 == $qb ) { # Floating left
+                       $rules[] = "#quickbar { position:absolute; left:4px }";
+                       $rules[] = "#topbar { margin-left: 148px }";
+                       $rules[] = "#article { margin-left:148px; margin-right: 4px; }";
+                       $rules[] = "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;}"; # Hides from IE
+               } elseif ( 4 == $qb ) { # Floating right
+                       $rules[] = "#quickbar { position: fixed; right: 4px; }";
+                       $rules[] = "#topbar { margin-right: 148px }";
+                       $rules[] = "#article { margin-right: 148px; margin-left: 4px; }";
+                       $rules[] = "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;}"; # Hides from IE
+               }
+               $style = implode( "\n", $rules );
+               if ( $wgContLang->getDir() === 'rtl' ) {
+                       $style = CSSJanus::transform( $style, true, false );
+               }
+               $out->addInlineStyle( $style );
        }
 
+}
+
+class CologneBlueTemplate extends LegacyTemplate {
+
        function doBeforeContent() {
                $mainPageObj = Title::newMainPage();
 
@@ -41,7 +75,7 @@ class SkinCologneBlue extends Skin {
 
                $s .= '<font size="-1"><span id="langlinks">';
                $s .= str_replace( '<br />', '', $this->otherLanguages() );
-               $cat = $this->getCategoryLinks();
+               $cat = $this->getSkin()->getCategoryLinks();
                if( $cat ) {
                        $s .= "<br />$cat\n";
                }
@@ -69,7 +103,7 @@ class SkinCologneBlue extends Skin {
                $s .= "\n<div id='footer'>";
                $s .= '<table width="98%" border="0" cellspacing="0"><tr>';
 
-               $qb = $this->qbSetting();
+               $qb = $this->getSkin()->qbSetting();
                if ( 1 == $qb || 3 == $qb ) { # Left
                        $s .= $this->getQuickbarCompensator();
                }
@@ -77,14 +111,14 @@ class SkinCologneBlue extends Skin {
 
                $s .= $this->bottomLinks();
                $s .= $wgLang->pipeList( array(
-                       "\n<br />" . $this->link(
+                       "\n<br />" . $this->getSkin()->link(
                                Title::newMainPage(),
                                null,
                                array(),
                                array(),
                                array( 'known', 'noclasses' )
                        ),
-                       $this->aboutLink(),
+                       $this->getSkin()->aboutLink(),
                        $this->searchForm( wfMsg( 'qbfind' ) )
                ) );
 
@@ -102,44 +136,12 @@ class SkinCologneBlue extends Skin {
                return $s;
        }
 
-       function setupSkinUserCss( OutputPage $out ){
-               parent::setupSkinUserCss( $out );
-               $out->addModuleStyles( 'skins.cologneblue' );
-
-               global $wgContLang;
-               $qb = $this->qbSetting();
-               $rules = array();
-
-               if ( 2 == $qb ) { # Right
-                       $rules[] = "#quickbar { position: absolute; right: 4px; }";
-                       $rules[] = "#article { margin-left: 4px; margin-right: 148px; }";
-               } elseif ( 1 == $qb ) {
-                       $rules[] = "#quickbar { position: absolute; left: 4px; }";
-                       $rules[] = "#article { margin-left: 148px; margin-right: 4px; }";
-               } elseif ( 3 == $qb ) { # Floating left
-                       $rules[] = "#quickbar { position:absolute; left:4px }";
-                       $rules[] = "#topbar { margin-left: 148px }";
-                       $rules[] = "#article { margin-left:148px; margin-right: 4px; }";
-                       $rules[] = "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;}"; # Hides from IE
-               } elseif ( 4 == $qb ) { # Floating right
-                       $rules[] = "#quickbar { position: fixed; right: 4px; }";
-                       $rules[] = "#topbar { margin-right: 148px }";
-                       $rules[] = "#article { margin-right: 148px; margin-left: 4px; }";
-                       $rules[] = "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;}"; # Hides from IE
-               }
-               $style = implode( "\n", $rules );
-               if ( $wgContLang->getDir() === 'rtl' ) {
-                       $style = CSSJanus::transform( $style, true, false );
-               }
-               $out->addInlineStyle( $style );
-       }
-
        function sysLinks() {
                global $wgUser, $wgLang;
                $li = SpecialPage::getTitleFor( 'Userlogin' );
                $lo = SpecialPage::getTitleFor( 'Userlogout' );
 
-               $rt = $this->mTitle->getPrefixedURL();
+               $rt = $this->getSkin()->getTitle()->getPrefixedURL();
                if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
                        $q = array();
                } else {
@@ -147,20 +149,20 @@ class SkinCologneBlue extends Skin {
                }
 
                $s = array(
-                       $this->mainPageLink(),
-                       $this->linkKnown(
+                       $this->getSkin()->mainPageLink(),
+                       $this->getSkin()->linkKnown(
                                Title::newFromText( wfMsgForContent( 'aboutpage' ) ),
                                wfMsg( 'about' )
                        ),
-                       $this->linkKnown(
+                       $this->getSkin()->linkKnown(
                                Title::newFromText( wfMsgForContent( 'helppage' ) ),
                                wfMsg( 'help' )
                        ),
-                       $this->linkKnown(
+                       $this->getSkin()->linkKnown(
                                Title::newFromText( wfMsgForContent( 'faqpage' ) ),
                                wfMsg( 'faq' )
                        ),
-                       $this->specialLink( 'Specialpages' )
+                       $this->getSkin()->specialLink( 'Specialpages' )
                );
 
                /* show links to different language variants */
@@ -171,14 +173,14 @@ class SkinCologneBlue extends Skin {
                        $s[] = $this->extensionTabLinks();
                }
                if ( $wgUser->isLoggedIn() ) {
-                       $s[] = $this->linkKnown(
+                       $s[] = $this->getSkin()->linkKnown(
                                $lo,
                                wfMsg( 'logout' ),
                                array(),
                                $q
                        );
                } else {
-                       $s[] = $this->linkKnown(
+                       $s[] = $this->getSkin()->linkKnown(
                                $li,
                                wfMsg( 'login' ),
                                array(),
@@ -196,7 +198,7 @@ class SkinCologneBlue extends Skin {
        function quickBar(){
                global $wgOut, $wgUser;
 
-               $tns = $this->mTitle->getNamespace();
+               $tns = $this->getSkin()->getTitle()->getNamespace();
 
                $s = "\n<div id='quickbar'>";
 
@@ -207,7 +209,7 @@ class SkinCologneBlue extends Skin {
                $s .= $this->menuHead( 'qbbrowse' );
 
                # Use the first heading from the Monobook sidebar as the "browse" section
-               $bar = $this->buildSidebar();
+               $bar = $this->getSkin()->buildSidebar();
                unset( $bar['SEARCH'] );
                unset( $bar['LANGUAGES'] );
                unset( $bar['TOOLBOX'] );
@@ -224,7 +226,7 @@ class SkinCologneBlue extends Skin {
                        $s .= $this->menuHead( 'qbedit' );
                        $s .= '<strong>' . $this->editThisPage() . '</strong>';
 
-                       $s .= $sep . $this->linkKnown(
+                       $s .= $sep . $this->getSkin()->linkKnown(
                                Title::newFromText( wfMsgForContent( 'edithelppage' ) ),
                                wfMsg( 'edithelp' )
                        );
@@ -262,10 +264,10 @@ class SkinCologneBlue extends Skin {
                                        . $sep . $this->watchPageLinksLink();
 
                        if( $tns == NS_USER || $tns == NS_USER_TALK ) {
-                               $id = User::idFromName( $this->mTitle->getText() );
+                               $id = User::idFromName( $this->getSkin()->getTitle()->getText() );
                                if( $id != 0 ) {
                                        $s .= $sep . $this->userContribsLink();
-                                       if( $this->showEmailUser( $id ) ) {
+                                       if( $this->getSkin()->showEmailUser( $id ) ) {
                                                $s .= $sep . $this->emailUserLink();
                                        }
                                }
@@ -275,7 +277,7 @@ class SkinCologneBlue extends Skin {
 
                $s .= $this->menuHead( 'qbmyoptions' );
                if ( $wgUser->isLoggedIn() ) {
-                       $tl = $this->link(
+                       $tl = $this->getSkin()->link(
                                $wgUser->getTalkPage(),
                                wfMsg( 'mytalk' ),
                                array(),
@@ -286,30 +288,30 @@ class SkinCologneBlue extends Skin {
                                $tl .= ' *';
                        }
 
-                       $s .= $this->link(
+                       $s .= $this->getSkin()->link(
                                        $wgUser->getUserPage(),
                                        wfMsg( 'mypage' ),
                                        array(),
                                        array(),
                                        array( 'known', 'noclasses' )
-                               ) . $sep . $tl . $sep . $this->specialLink( 'Watchlist' )
+                               ) . $sep . $tl . $sep . $this->getSkin()->specialLink( 'Watchlist' )
                                        . $sep .
-                               $this->link(
+                               $this->getSkin()->link(
                                        SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
                                        wfMsg( 'mycontris' ),
                                        array(),
                                        array(),
                                        array( 'known', 'noclasses' )
-                               ) . $sep . $this->specialLink( 'Preferences' )
-                               . $sep . $this->specialLink( 'Userlogout' );
+                               ) . $sep . $this->getSkin()->specialLink( 'Preferences' )
+                               . $sep . $this->getSkin()->specialLink( 'Userlogout' );
                } else {
-                       $s .= $this->specialLink( 'Userlogin' );
+                       $s .= $this->getSkin()->specialLink( 'Userlogin' );
                }
 
                $s .= $this->menuHead( 'qbspecialpages' )
-                       . $this->specialLink( 'Newpages' )
-                       . $sep . $this->specialLink( 'Listfiles' )
-                       . $sep . $this->specialLink( 'Statistics' );
+                       . $this->getSkin()->specialLink( 'Newpages' )
+                       . $sep . $this->getSkin()->specialLink( 'Listfiles' )
+                       . $sep . $this->getSkin()->specialLink( 'Statistics' );
                if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
                        $s .= $sep . $this->getUploadLink();
                }
@@ -321,7 +323,7 @@ class SkinCologneBlue extends Skin {
                                        . wfMsg( 'sitesupport' ) . '</a>';
                }
 
-               $s .= $sep . $this->link(
+               $s .= $sep . $this->getSkin()->link(
                        SpecialPage::getTitleFor( 'Specialpages' ),
                        wfMsg( 'moredotdotdot' ),
                        array(),
@@ -342,7 +344,7 @@ class SkinCologneBlue extends Skin {
                global $wgRequest, $wgUseTwoButtonsSearchForm;
 
                $search = $wgRequest->getText( 'search' );
-               $action = $this->escapeSearchLink();
+               $action = $this->data['searchaction'];
                $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
                if( $label != '' ) {
                        $s .= "{$label}: ";
index 5242fe3..6bb2aed 100644 (file)
@@ -14,20 +14,22 @@ if( !defined( 'MEDIAWIKI' ) ) {
  * @todo document
  * @ingroup Skins
  */
-class SkinNostalgia extends Skin {
-
-       function getSkinName() {
-               return 'nostalgia';
-       }
+class SkinNostalgia extends SkinLegacy {
+       var $skinname = 'nostalgia', $stylename = 'nostalgia',
+               $template = 'NostalgiaTemplate';
 
        function setupSkinUserCss( OutputPage $out ){
                parent::setupSkinUserCss( $out );
                $out->addModuleStyles( 'skins.nostalgia' );
        }
 
+}
+
+class NostalgiaTemplate extends LegacyTemplate {
+
        function doBeforeContent() {
                $s = "\n<div id='content'>\n<div id='top'>\n";
-               $s .= '<div id="logo">' . $this->logoText( 'right' ) . '</div>';
+               $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>';
 
                $s .= $this->pageTitle();
                $s .= $this->pageSubtitle() . "\n";
@@ -46,7 +48,7 @@ class SkinNostalgia extends Skin {
                        $s .= '<br />' . $ol;
                }
 
-               $cat = $this->getCategoryLinks();
+               $cat = $this->getSkin()->getCategoryLinks();
                if( $cat ) {
                        $s .= '<br />' . $cat;
                }
@@ -61,8 +63,8 @@ class SkinNostalgia extends Skin {
                global $wgOut, $wgUser;
                $sep = " |\n";
 
-               $s = $this->mainPageLink() . $sep
-                 . $this->specialLink( 'Recentchanges' );
+               $s = $this->getSkin()->mainPageLink() . $sep
+                 . $this->getSkin()->specialLink( 'Recentchanges' );
 
                if ( $wgOut->isArticle() ) {
                        $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->historyLink();
@@ -72,29 +74,29 @@ class SkinNostalgia extends Skin {
                $s .= $this->variantLinks();
                $s .= $this->extensionTabLinks();
                if ( $wgUser->isAnon() ) {
-                       $s .= $sep . $this->specialLink( 'Userlogin' );
+                       $s .= $sep . $this->getSkin()->specialLink( 'Userlogin' );
                } else {
                        /* show user page and user talk links */
-                       $s .= $sep . $this->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
-                       $s .= $sep . $this->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
+                       $s .= $sep . $this->getSkin()->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
+                       $s .= $sep . $this->getSkin()->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
                        if ( $wgUser->getNewtalk() ) {
                                $s .= ' *';
                        }
                        /* show watchlist link */
-                       $s .= $sep . $this->specialLink( 'Watchlist' );
+                       $s .= $sep . $this->getSkin()->specialLink( 'Watchlist' );
                        /* show my contributions link */
-                       $s .= $sep . $this->link(
+                       $s .= $sep . $this->getSkin()->link(
                                SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
                                wfMsgHtml( 'mycontris' ) );
                        /* show my preferences link */
-                       $s .= $sep . $this->specialLink( 'Preferences' );
+                       $s .= $sep . $this->getSkin()->specialLink( 'Preferences' );
                        /* show upload file link */
                        if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
                                $s .= $sep . $this->getUploadLink();
                        }
 
                        /* show log out link */
-                       $s .= $sep . $this->specialLink( 'Userlogout' );
+                       $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' );
                }
 
                $s .= $sep . $this->specialPagesList();
@@ -109,8 +111,8 @@ class SkinNostalgia extends Skin {
 
                $s .= $this->bottomLinks();
                $s .= "\n<br />" . $this->pageStats();
-               $s .= "\n<br />" . $this->mainPageLink()
-                               . ' | ' . $this->aboutLink()
+               $s .= "\n<br />" . $this->getSkin()->mainPageLink()
+                               . ' | ' . $this->getSkin()->aboutLink()
                                . ' | ' . $this->searchForm();
 
                $s .= "\n</div>\n</div>\n";
index e0c009b..fb54621 100644 (file)
@@ -14,7 +14,9 @@ if( !defined( 'MEDIAWIKI' ) ) {
  * @todo document
  * @ingroup Skins
  */
-class SkinStandard extends Skin {
+class SkinStandard extends SkinLegacy {
+       var $skinname = 'standard', $stylename = 'standard',
+               $template = 'StandardTemplate';
 
        /**
         *
@@ -48,6 +50,10 @@ class SkinStandard extends Skin {
                $out->addInlineStyle( $style );
        }
 
+}
+
+class StandardTemplate extends LegacyTemplate {
+
        function doAfterContent() {
                global $wgContLang, $wgLang;
                wfProfileIn( __METHOD__ );
@@ -60,7 +66,7 @@ class SkinStandard extends Skin {
                wfProfileOut( __METHOD__ . '-1' );
                wfProfileIn( __METHOD__ . '-2' );
 
-               $qb = $this->qbSetting();
+               $qb = $this->getSkin()->qbSetting();
                $shove = ( $qb != 0 );
                $left = ( $qb == 1 || $qb == 3 );
 
@@ -74,9 +80,9 @@ class SkinStandard extends Skin {
 
                $s .= $this->bottomLinks();
                $s .= "\n<br />" . $wgLang->pipeList( array(
-                       $this->mainPageLink(),
-                       $this->aboutLink(),
-                       $this->specialLink( 'Recentchanges' ),
+                       $this->getSkin()->mainPageLink(),
+                       $this->getSkin()->aboutLink(),
+                       $this->getSkin()->specialLink( 'Recentchanges' ),
                        $this->searchForm() ) )
                        . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
 
@@ -103,15 +109,15 @@ class SkinStandard extends Skin {
 
                $action = $wgRequest->getText( 'action' );
                $wpPreview = $wgRequest->getBool( 'wpPreview' );
-               $tns = $this->mTitle->getNamespace();
+               $tns = $this->getSkin()->getTitle()->getNamespace();
 
                $s = "\n<div id='quickbar'>";
-               $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
+               $s .= "\n" . $this->getSkin()->logoText() . "\n<hr class='sep' />";
 
                $sep = "\n<br />";
 
                # Use the first heading from the Monobook sidebar as the "browse" section
-               $bar = $this->buildSidebar();
+               $bar = $this->getSkin()->buildSidebar();
                unset( $bar['SEARCH'] );
                unset( $bar['LANGUAGES'] );
                unset( $bar['TOOLBOX'] );
@@ -125,8 +131,8 @@ class SkinStandard extends Skin {
                }
 
                if( $wgUser->isLoggedIn() ) {
-                       $s.= $this->specialLink( 'Watchlist' ) ;
-                       $s .= $sep . $this->linkKnown(
+                       $s.= $this->getSkin()->specialLink( 'Watchlist' ) ;
+                       $s .= $sep . $this->getSkin()->linkKnown(
                                SpecialPage::getTitleFor( 'Contributions' ),
                                wfMsg( 'mycontris' ),
                                array(),
@@ -135,7 +141,7 @@ class SkinStandard extends Skin {
                }
                // only show watchlist link if logged in
                $s .= "\n<hr class='sep' />";
-               $articleExists = $this->mTitle->getArticleId();
+               $articleExists = $this->getSkin()->getTitle()->getArticleId();
                if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) {
                        if( $wgOut->isArticle() ) {
                                $s .= '<strong>' . $this->editThisPage() . '</strong>';
@@ -180,17 +186,17 @@ class SkinStandard extends Skin {
                                                        $text = wfMsg( 'articlepage' );
                                        }
 
-                                       $link = $this->mTitle->getText();
+                                       $link = $this->getSkin()->getTitle()->getText();
                                        $nstext = $wgContLang->getNsText( $tns );
                                        if( $nstext ) { # add namespace if necessary
                                                $link = $nstext . ':' . $link;
                                        }
 
-                                       $s .= $this->link(
+                                       $s .= $this->getSkin()->link(
                                                Title::newFromText( $link ),
                                                $text
                                        );
-                               } elseif( $this->mTitle->getNamespace() != NS_SPECIAL ) {
+                               } elseif( $this->getSkin()->getTitle()->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 .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
@@ -198,9 +204,9 @@ class SkinStandard extends Skin {
                        }
 
                        # "Post a comment" link
-                       if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
-                               $s .= '<br />' . $this->link(
-                                       $this->mTitle,
+                       if( ( $this->getSkin()->getTitle()->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
+                               $s .= '<br />' . $this->getSkin()->link(
+                                       $this->getSkin()->getTitle(),
                                        wfMsg( 'postcomment' ),
                                        array(),
                                        array(
@@ -220,7 +226,7 @@ class SkinStandard extends Skin {
                                if( $action != 'edit' && $action != 'submit' ) {
                                        $s .= $sep . $this->watchThisPage();
                                }
-                               if ( $this->mTitle->userCan( 'edit' ) )
+                               if ( $this->getSkin()->getTitle()->userCan( 'edit' ) )
                                        $s .= $sep . $this->moveThisPage();
                        }
                        if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
@@ -238,12 +244,12 @@ class SkinStandard extends Skin {
                        }
 
                        if (
-                               NS_USER == $this->mTitle->getNamespace() ||
-                               $this->mTitle->getNamespace() == NS_USER_TALK
+                               NS_USER == $this->getSkin()->getTitle()->getNamespace() ||
+                               $this->getSkin()->getTitle()->getNamespace() == NS_USER_TALK
                        ) {
 
-                               $id = User::idFromName( $this->mTitle->getText() );
-                               $ip = User::isIP( $this->mTitle->getText() );
+                               $id = User::idFromName( $this->getSkin()->getTitle()->getText() );
+                               $ip = User::isIP( $this->getSkin()->getTitle()->getText() );
 
                                if( $id || $ip ){
                                        $s .= $sep . $this->userContribsLink();
@@ -259,7 +265,7 @@ class SkinStandard extends Skin {
                        $s .= $this->getUploadLink() . $sep;
                }
 
-               $s .= $this->specialLink( 'Specialpages' );
+               $s .= $this->getSkin()->specialLink( 'Specialpages' );
 
                global $wgSiteSupportPage;
                if( $wgSiteSupportPage ) {