Merge "DatabaseMssql: Don't duplicate body of makeList()"
[lhc/web/wiklou.git] / includes / skins / Skin.php
index 04c02d6..244a278 100644 (file)
@@ -168,11 +168,9 @@ abstract class Skin extends ContextSource {
         * @param OutputPage $out
         */
        function initPage( OutputPage $out ) {
-               wfProfileIn( __METHOD__ );
 
                $this->preloadExistence();
 
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -648,17 +646,17 @@ abstract class Skin extends ContextSource {
 
                return $this->msg( 'retrievedfrom' )
                        ->rawParams( '<a dir="ltr" href="' . $url. '">' . $url . '</a>' )
-                       ->escaped();
+                       ->parse();
        }
 
        /**
-        * @return string
+        * @return string HTML
         */
        function getUndeleteLink() {
                $action = $this->getRequest()->getVal( 'action', 'view' );
 
                if ( $this->getTitle()->userCan( 'deletedhistory', $this->getUser() ) &&
-                       ( $this->getTitle()->getArticleID() == 0 || $action == 'history' ) ) {
+                       ( !$this->getTitle()->exists() || $action == 'history' ) ) {
                        $n = $this->getTitle()->isDeleted();
 
                        if ( $n ) {
@@ -672,7 +670,7 @@ abstract class Skin extends ContextSource {
                                        Linker::linkKnown(
                                                SpecialPage::getTitleFor( 'Undelete', $this->getTitle()->getPrefixedDBkey() ),
                                                $this->msg( 'restorelink' )->numParams( $n )->escaped() )
-                                       )->text();
+                                       )->escaped();
                        }
                }
 
@@ -839,9 +837,12 @@ abstract class Skin extends ContextSource {
        function getPoweredBy() {
                global $wgResourceBasePath;
 
-               $url = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" );
-               $text = '<a href="//www.mediawiki.org/"><img src="' . $url
-                       . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
+               $url1 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" );
+               $url1_5 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png" );
+               $url2 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png" );
+               $text = '<a href="//www.mediawiki.org/"><img src="' . $url1
+                       . '" srcset="' . $url1_5 . ' 1.5x, ' . $url2 . ' 2x" '
+                       . 'height="31" width="88" alt="Powered by MediaWiki" /></a>';
                Hooks::run( 'SkinGetPoweredBy', array( &$text, $this ) );
                return $text;
        }
@@ -862,13 +863,13 @@ abstract class Skin extends ContextSource {
                if ( $timestamp ) {
                        $d = $this->getLanguage()->userDate( $timestamp, $this->getUser() );
                        $t = $this->getLanguage()->userTime( $timestamp, $this->getUser() );
-                       $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->text();
+                       $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->parse();
                } else {
                        $s = '';
                }
 
                if ( wfGetLB()->getLaggedSlaveMode() ) {
-                       $s .= ' <strong>' . $this->msg( 'laggedslavemode' )->text() . '</strong>';
+                       $s .= ' <strong>' . $this->msg( 'laggedslavemode' )->parse() . '</strong>';
                }
 
                return $s;
@@ -942,7 +943,6 @@ abstract class Skin extends ContextSource {
         * @return string HTML anchor
         */
        public function footerLink( $desc, $page ) {
-               $section = new ProfileSection( __METHOD__ );
                // if the link description has been set to "-" in the default language,
                if ( $this->msg( $desc )->inContentLanguage()->isDisabled() ) {
                        // then it is disabled, for all languages.
@@ -1046,6 +1046,7 @@ abstract class Skin extends ContextSource {
         *
         * @param string $name The name or path of a skin resource file
         * @return string The fully resolved style path url including styleversion
+        * @throws MWException
         */
        function getSkinStylePath( $name ) {
                global $wgStylePath, $wgStyleVersion;
@@ -1165,7 +1166,7 @@ abstract class Skin extends ContextSource {
 
                return array(
                        'href' => $title->getLocalURL( $urlaction ),
-                       'exists' => $title->getArticleID() != 0,
+                       'exists' => $title->isKnown(),
                );
        }
 
@@ -1223,7 +1224,6 @@ abstract class Skin extends ContextSource {
         */
        function buildSidebar() {
                global $wgMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
-               wfProfileIn( __METHOD__ );
 
                $key = wfMemcKey( 'sidebar', $this->getLanguage()->getCode() );
 
@@ -1232,7 +1232,6 @@ abstract class Skin extends ContextSource {
                        if ( $cachedsidebar ) {
                                Hooks::run( 'SidebarBeforeOutput', array( $this, &$cachedsidebar ) );
 
-                               wfProfileOut( __METHOD__ );
                                return $cachedsidebar;
                        }
                }
@@ -1247,7 +1246,6 @@ abstract class Skin extends ContextSource {
 
                Hooks::run( 'SidebarBeforeOutput', array( $this, &$bar ) );
 
-               wfProfileOut( __METHOD__ );
                return $bar;
        }
 
@@ -1473,8 +1471,6 @@ abstract class Skin extends ContextSource {
        private function getCachedNotice( $name ) {
                global $wgRenderHashAppend, $parserMemc, $wgContLang;
 
-               wfProfileIn( __METHOD__ );
-
                $needParse = false;
 
                if ( $name === 'default' ) {
@@ -1482,13 +1478,11 @@ abstract class Skin extends ContextSource {
                        global $wgSiteNotice;
                        $notice = $wgSiteNotice;
                        if ( empty( $notice ) ) {
-                               wfProfileOut( __METHOD__ );
                                return false;
                        }
                } else {
                        $msg = $this->msg( $name )->inContentLanguage();
                        if ( $msg->isDisabled() ) {
-                               wfProfileOut( __METHOD__ );
                                return false;
                        }
                        $notice = $msg->plain();
@@ -1515,7 +1509,6 @@ abstract class Skin extends ContextSource {
 
                $notice = Html::rawElement( 'div', array( 'id' => 'localNotice',
                        'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $notice );
-               wfProfileOut( __METHOD__ );
                return $notice;
        }
 
@@ -1525,7 +1518,6 @@ abstract class Skin extends ContextSource {
         * @return string HTML fragment
         */
        function getNamespaceNotice() {
-               wfProfileIn( __METHOD__ );
 
                $key = 'namespacenotice-' . $this->getTitle()->getNsText();
                $namespaceNotice = $this->getCachedNotice( $key );
@@ -1535,7 +1527,6 @@ abstract class Skin extends ContextSource {
                        $namespaceNotice = '';
                }
 
-               wfProfileOut( __METHOD__ );
                return $namespaceNotice;
        }
 
@@ -1545,7 +1536,6 @@ abstract class Skin extends ContextSource {
         * @return string HTML fragment
         */
        function getSiteNotice() {
-               wfProfileIn( __METHOD__ );
                $siteNotice = '';
 
                if ( Hooks::run( 'SiteNoticeBefore', array( &$siteNotice, $this ) ) ) {
@@ -1565,7 +1555,6 @@ abstract class Skin extends ContextSource {
                }
 
                Hooks::run( 'SiteNoticeAfter', array( &$siteNotice, $this ) );
-               wfProfileOut( __METHOD__ );
                return $siteNotice;
        }