* 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();
+ }
}
/**
* @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 ) );
* @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.
}
/**
- * 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 '';
}
/**