* @return QuickTemplate The template to be executed by outputPage
*/
protected function prepareQuickTemplate() {
- global $wgContLang, $wgScript, $wgStylePath, $wgMimeType, $wgJsMimeType,
+ global $wgScript, $wgStylePath, $wgMimeType, $wgJsMimeType,
$wgSitename, $wgLogo, $wgMaxCredits,
$wgShowCreditsIfMax, $wgArticlePath,
$wgScriptPath, $wgServer;
// heading for the page title. Defaults to empty string.
$tpl->set( 'prebodyhtml', '' );
- if ( $userLangCode !== $wgContLang->getHtmlCode() || $userLangDir !== $wgContLang->getDir() ) {
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
+ if (
+ $userLangCode !== $contLang->getHtmlCode() ||
+ $userLangDir !== $contLang->getDir()
+ ) {
$escUserlang = htmlspecialchars( $userLangCode );
$escUserdir = htmlspecialchars( $userLangDir );
// Attributes must be in double quotes because htmlspecialchars() doesn't
# so it doesn't contain the original alias-with-subpage.
$origTitle = Title::newFromText( $request->getText( 'title' ) );
if ( $origTitle instanceof Title && $origTitle->isSpecialPage() ) {
- list( $spName, $spPar ) = SpecialPageFactory::resolveAlias( $origTitle->getText() );
+ list( $spName, $spPar ) =
+ MediaWikiServices::getInstance()->getSpecialPageFactory()->
+ resolveAlias( $origTitle->getText() );
$active = $spName == 'Contributions'
&& ( ( $spPar && $spPar == $this->username )
|| $request->getText( 'target' ) == $this->username );
if ( $msg->exists() ) {
$text = $msg->text();
} else {
- global $wgContLang;
- $text = $wgContLang->getConverter()->convertNamespace(
- MWNamespace::getSubject( $title->getNamespace() ) );
+ $text = MediaWikiServices::getInstance()->getContentLanguage()->getConverter()->
+ convertNamespace( MWNamespace::getSubject( $title->getNamespace() ) );
}
// Avoid PHP 7.1 warning of passing $this by reference
}
} else {
// article doesn't exist or is deleted
- if ( $user->isAllowed( 'deletedhistory' ) ) {
+ if ( $title->quickUserCan( 'deletedhistory', $user ) ) {
$n = $title->isDeleted();
if ( $n ) {
$undelTitle = SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedDBkey() );
// If the user can't undelete but can view deleted
// history show them a "View .. deleted" tab instead.
- $msgKey = $user->isAllowed( 'undelete' ) ? 'undelete' : 'viewdeleted';
+ $msgKey = $title->quickUserCan( 'undelete', $user ) ? 'undelete' : 'viewdeleted';
$content_navigation['actions']['undelete'] = [
'class' => $this->getTitle()->isSpecial( 'Undelete' ) ? 'selected' : false,
'text' => wfMessageFallback( "$skname-action-$msgKey", "{$msgKey}_short" )