Factor out some methods in the header generation
As preparation for some more minor refactoring there. Change-Id: I31f585e5c4fcf724d9aaf670a21f4f0af42e98ce
This commit is contained in:
parent
b6c3fc93e9
commit
c67bae4691
1 changed files with 28 additions and 17 deletions
|
|
@ -2885,24 +2885,9 @@ ERROR;
|
|||
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 @@ HTML
|
|||
// reverse the transform that we made for reversibility reasons.
|
||||
return strtr( $result, [ "�" => "&#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' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue