Merge "API: HTMLize and internationalize the help, add Special:ApiHelp"
[lhc/web/wiklou.git] / includes / skins / Skin.php
index 7d04b95..c8c4ba4 100644 (file)
@@ -239,25 +239,33 @@ abstract class Skin extends ContextSource {
         * Preload the existence of three commonly-requested pages in a single query
         */
        function preloadExistence() {
+               $titles = array();
+
                $user = $this->getUser();
+               $title = $this->getRelevantTitle();
 
                // User/talk link
-               $titles = array( $user->getUserPage(), $user->getTalkPage() );
+               if ( $user->isLoggedIn() || $this->showIPinHeader() ) {
+                       $titles[] = $user->getUserPage();
+                       $titles[] = $user->getTalkPage();
+               }
 
                // Other tab link
-               if ( $this->getTitle()->isSpecialPage() ) {
+               if ( $title->isSpecialPage() ) {
                        // nothing
-               } elseif ( $this->getTitle()->isTalkPage() ) {
-                       $titles[] = $this->getTitle()->getSubjectPage();
+               } elseif ( $title->isTalkPage() ) {
+                       $titles[] = $title->getSubjectPage();
                } else {
-                       $titles[] = $this->getTitle()->getTalkPage();
+                       $titles[] = $title->getTalkPage();
                }
 
                wfRunHooks( 'SkinPreloadExistence', array( &$titles, $this ) );
 
-               $lb = new LinkBatch( $titles );
-               $lb->setCaller( __METHOD__ );
-               $lb->execute();
+               if ( count( $titles ) ) {
+                       $lb = new LinkBatch( $titles );
+                       $lb->setCaller( __METHOD__ );
+                       $lb->execute();
+               }
        }
 
        /**
@@ -827,9 +835,9 @@ abstract class Skin extends ContextSource {
         * @return string
         */
        function getPoweredBy() {
-               global $wgStylePath;
+               global $wgResourceBasePath;
 
-               $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
+               $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>';
                wfRunHooks( 'SkinGetPoweredBy', array( &$text, $this ) );
@@ -932,6 +940,7 @@ 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.
@@ -1008,15 +1017,18 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * 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
-        * and includes the style version inside of the url.
+        * This function previously returned a fully resolved style path URL to images or styles stored in
+        * the legacy skins/common/ directory.
+        *
+        * That directory has been removed in 1.24 and the function always returns an empty string.
+        *
+        * @deprecated since 1.24
         * @param string $name The name or path of a skin resource file
-        * @return string The fully resolved style path url including styleversion
+        * @return string Empty string
         */
        function getCommonStylePath( $name ) {
-               global $wgStylePath, $wgStyleVersion;
-               return "$wgStylePath/common/$name?$wgStyleVersion";
+               wfDeprecated( __METHOD__, '1.24' );
+               return '';
        }
 
        /**