X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=99dd4a7c0e629c77591b82723db2cbf6c7b7a2cf;hb=899f475d0dad8ea0a24f706fc8ac07e3097d6191;hp=01b450b457d93f55b809d2359b67b8f85cdc1e97;hpb=595a108b36b0ee96e0a9b6719024670362b7a839;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 01b450b457..99dd4a7c0e 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -287,11 +287,6 @@ class OutputPage extends ContextSource { */ private $mEnableTOC = false; - /** - * @var bool Whether parser output should contain section edit links - */ - private $mEnableSectionEditLinks = true; - /** * @var string|null The URL to send in a element with rel=license */ @@ -1547,7 +1542,6 @@ class OutputPage extends ContextSource { // Someone is trying to set a bogus pre-$wgUser PO. Check if it has // been changed somehow, and keep it if so. $anonPO = ParserOptions::newFromAnon(); - $anonPO->setEditSection( false ); $anonPO->setAllowUnsafeRawHtml( false ); if ( !$options->matches( $anonPO ) ) { wfLogWarning( __METHOD__ . ': Setting a changed bogus ParserOptions: ' . wfGetAllCallers( 5 ) ); @@ -1561,7 +1555,6 @@ class OutputPage extends ContextSource { // ParserOptions for it. And don't cache this ParserOptions // either. $po = ParserOptions::newFromAnon(); - $po->setEditSection( false ); $po->setAllowUnsafeRawHtml( false ); $po->isBogus = true; if ( $options !== null ) { @@ -1571,7 +1564,6 @@ class OutputPage extends ContextSource { } $this->mParserOptions = ParserOptions::newFromContext( $this->getContext() ); - $this->mParserOptions->setEditSection( false ); $this->mParserOptions->setAllowUnsafeRawHtml( false ); } @@ -1821,7 +1813,7 @@ class OutputPage extends ContextSource { // so that extensions may modify ParserOutput to toggle TOC. // This cannot be moved to addParserOutputText because that is not // called by EditPage for Preview. - if ( $parserOutput->getTOCEnabled() && $parserOutput->getTOCHTML() ) { + if ( $parserOutput->getTOCHTML() ) { $this->mEnableTOC = true; } } @@ -1867,17 +1859,6 @@ class OutputPage extends ContextSource { */ function addParserOutput( $parserOutput, $poOptions = [] ) { $this->addParserOutputMetadata( $parserOutput ); - - // Touch section edit links only if not previously disabled - if ( $parserOutput->getEditSectionTokens() ) { - $parserOutput->setEditSectionTokens( $this->mEnableSectionEditLinks ); - } - if ( !$this->mEnableSectionEditLinks - && !array_key_exists( 'enableSectionEditLinks', $poOptions ) - ) { - $poOptions['enableSectionEditLinks'] = false; - } - $this->addParserOutputText( $parserOutput, $poOptions ); } @@ -2807,7 +2788,9 @@ class OutputPage extends ContextSource { $this->rlUserModuleState = $exemptStates['user'] = $userState; } - $rlClient = new ResourceLoaderClientHtml( $context, $this->getTarget() ); + $rlClient = new ResourceLoaderClientHtml( $context, [ + 'target' => $this->getTarget(), + ] ); $rlClient->setConfig( $this->getJSVars() ); $rlClient->setModules( $this->getModules( /*filter*/ true ) ); $rlClient->setModuleStyles( $moduleStyles ); @@ -2964,14 +2947,14 @@ class OutputPage extends ContextSource { private function isUserJsPreview() { return $this->getConfig()->get( 'AllowUserJs' ) && $this->getTitle() - && $this->getTitle()->isJsSubpage() + && $this->getTitle()->isUserJsConfigPage() && $this->userCanPreview(); } protected function isUserCssPreview() { return $this->getConfig()->get( 'AllowUserCss' ) && $this->getTitle() - && $this->getTitle()->isCssSubpage() + && $this->getTitle()->isUserCssConfigPage() && $this->userCanPreview(); } @@ -3223,7 +3206,10 @@ class OutputPage extends ContextSource { } $title = $this->getTitle(); - if ( !$title->isJsSubpage() && !$title->isCssSubpage() ) { + if ( + !$title->isUserJsConfigPage() + && !$title->isUserCssConfigPage() + ) { return false; } if ( !$title->isSubpageOf( $user->getUserPage() ) ) { @@ -3895,7 +3881,7 @@ class OutputPage extends ContextSource { * @deprecated since 1.31, use $poOptions to addParserOutput() instead. */ public function enableSectionEditLinks( $flag = true ) { - $this->mEnableSectionEditLinks = $flag; + wfDeprecated( __METHOD__, '1.31' ); } /** @@ -3904,7 +3890,8 @@ class OutputPage extends ContextSource { * @deprecated since 1.31, use $poOptions to addParserOutput() instead. */ public function sectionEditLinksEnabled() { - return $this->mEnableSectionEditLinks; + wfDeprecated( __METHOD__, '1.31' ); + return true; } /**