}
/**
- * initialize various variables and generate the template
- *
- * @param OutputPage|null $out
+ * Initialize various variables and generate the template
*/
- function outputPage( OutputPage $out = null ) {
+ function outputPage() {
Profiler::instance()->setTemplated( true );
-
- $oldContext = null;
- if ( $out !== null ) {
- // Deprecated since 1.20, note added in 1.25
- wfDeprecated( __METHOD__, '1.25' );
- $oldContext = $this->getContext();
- $this->setContext( $out->getContext() );
- }
-
$out = $this->getOutput();
$this->initPage( $out );
// result may be an error
$this->printOrError( $res );
-
- if ( $oldContext ) {
- $this->setContext( $oldContext );
- }
}
/**
$tpl->set( 'handheld', $request->getBool( 'handheld' ) );
$tpl->set( 'loggedin', $this->loggedin );
$tpl->set( 'notspecialpage', !$title->isSpecialPage() );
- $tpl->set( 'searchaction', $this->escapeSearchLink() );
+ $tpl->set( 'searchaction', $this->getSearchLink() );
$tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBkey() );
$tpl->set( 'search', trim( $request->getVal( 'search' ) ) );
$tpl->set( 'stylepath', $wgStylePath );
$returnto['returnto'] = $page;
$query = $request->getVal( 'returntoquery', $this->thisquery );
$paramsArray = wfCgiToArray( $query );
- unset( $paramsArray['logoutToken'] );
$query = wfArrayToCgi( $paramsArray );
if ( $query != '' ) {
$returnto['returntoquery'] = $query;
'href' => self::makeSpecialUrl( 'Userlogout',
// Note: userlogout link must always contain an & character, otherwise we might not be able
// to detect a buggy precaching proxy (T19790)
- ( $title->isSpecial( 'Preferences' ) ? [] : $returnto )
- + [ 'logoutToken' => $this->getUser()->getEditToken( 'logoutToken', $this->getRequest() ) ] ),
+ ( $title->isSpecial( 'Preferences' ) ? [] : $returnto ) ),
'active' => false
];
}
}
}
- $linkClass = MediaWikiServices::getInstance()->getLinkRenderer()->getLinkClasses( $title );
+ $services = MediaWikiServices::getInstance();
+ $linkClass = $services->getLinkRenderer()->getLinkClasses( $title );
// wfMessageFallback will nicely accept $message as an array of fallbacks
// or just a single key
if ( $msg->exists() ) {
$text = $msg->text();
} else {
- $text = MediaWikiServices::getInstance()->getContentLanguage()->getConverter()->
- convertNamespace( MWNamespace::getSubject( $title->getNamespace() ) );
+ $text = $services->getContentLanguage()->getConverter()->
+ convertNamespace( $services->getNamespaceInfo()->
+ getSubject( $title->getNamespace() ) );
}
// Avoid PHP 7.1 warning of passing $this by reference
}
if ( $title->quickUserCan( 'protect', $user ) && $title->getRestrictionTypes() &&
- MWNamespace::getRestrictionLevels( $title->getNamespace(), $user ) !== [ '' ]
+ MediaWikiServices::getInstance()->getNamespaceInfo()->
+ getRestrictionLevels( $title->getNamespace(), $user ) !== [ '' ]
) {
$mode = $title->isProtected() ? 'unprotect' : 'protect';
$content_navigation['actions'][$mode] = [