X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fskins%2FSkin.php;h=384aeda7bb3c93d699259dfbf51aa4d6a3d23131;hb=885a8bdc47e6f5b9add4d5ddcb9c63a2d95e3a70;hp=d68823db3bea06f0bee17b5f2eff8fbd308859cd;hpb=160c028526b4fd77b0423870b2837a799d558140;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index d68823db3b..384aeda7bb 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -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(); + } } /** @@ -647,12 +655,12 @@ abstract class Skin extends ContextSource { function getUndeleteLink() { $action = $this->getRequest()->getVal( 'action', 'view' ); - if ( $this->getUser()->isAllowed( 'deletedhistory' ) && + if ( $this->getTitle()->userCan( 'deletedhistory', $this->getUser() ) && ( $this->getTitle()->getArticleID() == 0 || $action == 'history' ) ) { $n = $this->getTitle()->isDeleted(); if ( $n ) { - if ( $this->getUser()->isAllowed( 'undelete' ) ) { + if ( $this->getTitle()->userCan( 'undelete', $this->getUser() ) ) { $msg = 'thisisdeleted'; } else { $msg = 'viewdeleted'; @@ -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 = 'Powered by MediaWiki'; 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.