WMDE-Fisch has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/318100

Change subject: Factor out some methods in the header generation
......................................................................

Factor out some methods in the header generation

As preparation for some more minor refactoring there.

Change-Id: I31f585e5c4fcf724d9aaf670a21f4f0af42e98ce
---
M includes/EditPage.php
1 file changed, 28 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/318100/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index e8ea20f..4aa87d6 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2885,24 +2885,9 @@
                global $wgOut, $wgUser, $wgMaxArticleSize, $wgLang;
                global $wgAllowUserCss, $wgAllowUserJs;
 
-               if ( $this->mTitle->isTalkPage() ) {
-                       $wgOut->addWikiMsg( 'talkpagetext' );
-               }
+               $this->addTalkPageText();
 
-               // Add edit notices
-               $editNotices = $this->mTitle->getEditNotices( $this->oldid );
-               if ( count( $editNotices ) ) {
-                       $wgOut->addHTML( implode( "\n", $editNotices ) );
-               } else {
-                       $msg = $this->context->msg( 'editnotice-notext' );
-                       if ( !$msg->isDisabled() ) {
-                               $wgOut->addHTML(
-                                       '<div class="mw-editnotice-notext">'
-                                       . $msg->parseAsBlock()
-                                       . '</div>'
-                               );
-                       }
-               }
+               $this->addEditNotices();
 
                if ( $this->isConflict ) {
                        $wgOut->wrapWikiMsg( "<div 
class='mw-explainconflict'>\n$1\n</div>", 'explainconflict' );
@@ -4435,4 +4420,30 @@
                // reverse the transform that we made for reversibility reasons.
                return strtr( $result, [ "&#x0" => "&#x" ] );
        }
+
+       protected function addEditNotices() {
+               global $wgOut;
+
+               $editNotices = $this->mTitle->getEditNotices( $this->oldid );
+               if ( count( $editNotices ) ) {
+                       $wgOut->addHTML( implode( "\n", $editNotices ) );
+               } else {
+                       $msg = $this->context->msg( 'editnotice-notext' );
+                       if ( !$msg->isDisabled() ) {
+                               $wgOut->addHTML(
+                                       '<div class="mw-editnotice-notext">'
+                                       . $msg->parseAsBlock()
+                                       . '</div>'
+                               );
+                       }
+               }
+       }
+
+       protected function addTalkPageText() {
+               global $wgOut;
+
+               if ( $this->mTitle->isTalkPage() ) {
+                       $wgOut->addWikiMsg( 'talkpagetext' );
+               }
+       }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/318100
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31f585e5c4fcf724d9aaf670a21f4f0af42e98ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <christoph.jau...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to