* @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