X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FEditPage.php;h=eb1b6ad862050f94cbec6d3a9e2809de7d189f4a;hp=4451867ea542a43b30c2df0fd5c7e634cc071cad;hb=aaea7898582842d24adaf1838c6e3c2dfd59c245;hpb=956f10ddf06bcb0261d18361efff7a9cc386e6be diff --git a/includes/EditPage.php b/includes/EditPage.php index 4451867ea5..eb1b6ad862 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -526,7 +526,7 @@ class EditPage { * the newly-edited page. */ public function edit() { - global $wgOut, $wgRequest, $wgUser; + global $wgRequest, $wgUser; // Allow extensions to modify/prevent this form or submission if ( !Hooks::run( 'AlternateEdit', [ $this ] ) ) { return; @@ -536,7 +536,7 @@ class EditPage { // If they used redlink=1 and the page exists, redirect to the main article if ( $wgRequest->getBool( 'redlink' ) && $this->mTitle->exists() ) { - $wgOut->redirect( $this->mTitle->getFullURL() ); + $this->context->getOutput()->redirect( $this->mTitle->getFullURL() ); return; } @@ -701,13 +701,14 @@ class EditPage { * @throws PermissionsError */ protected function displayPermissionsError( array $permErrors ) { - global $wgRequest, $wgOut; + global $wgRequest; + $out = $this->context->getOutput(); if ( $wgRequest->getBool( 'redlink' ) ) { // The edit page was reached via a red link. // Redirect to the article page and let them click the edit tab if // they really want a permission error. - $wgOut->redirect( $this->mTitle->getFullURL() ); + $out->redirect( $this->mTitle->getFullURL() ); return; } @@ -722,7 +723,7 @@ class EditPage { $this->displayViewSourcePage( $content, - $wgOut->formatPermissionsErrorMessage( $permErrors, 'edit' ) + $out->formatPermissionsErrorMessage( $permErrors, 'edit' ) ); } @@ -732,29 +733,28 @@ class EditPage { * @param string $errorMessage additional wikitext error message to display */ protected function displayViewSourcePage( Content $content, $errorMessage = '' ) { - global $wgOut; - - Hooks::run( 'EditPage::showReadOnlyForm:initial', [ $this, &$wgOut ] ); + $out = $this->context->getOutput(); + Hooks::run( 'EditPage::showReadOnlyForm:initial', [ $this, &$out ] ); - $wgOut->setRobotPolicy( 'noindex,nofollow' ); - $wgOut->setPageTitle( $this->context->msg( + $out->setRobotPolicy( 'noindex,nofollow' ); + $out->setPageTitle( $this->context->msg( 'viewsource-title', $this->getContextTitle()->getPrefixedText() ) ); - $wgOut->addBacklinkSubtitle( $this->getContextTitle() ); - $wgOut->addHTML( $this->editFormPageTop ); - $wgOut->addHTML( $this->editFormTextTop ); + $out->addBacklinkSubtitle( $this->getContextTitle() ); + $out->addHTML( $this->editFormPageTop ); + $out->addHTML( $this->editFormTextTop ); if ( $errorMessage !== '' ) { - $wgOut->addWikiText( $errorMessage ); - $wgOut->addHTML( "