From: Kunal Mehta Date: Tue, 12 Sep 2017 18:17:20 +0000 (-0700) Subject: EditPage: Rename and make getSubmitButtonLabel() protected X-Git-Tag: 1.31.0-rc.0~2139 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=763de4b3205f4e1fb81041859e76c6228ff0229f;p=lhc%2Fweb%2Fwiklou.git EditPage: Rename and make getSubmitButtonLabel() protected Calling this method "SaveButton" is misleading since this function controls whether the button is called "save" or "publish". The corresponding config option (EditSubmitButtonLabelPublish) already uses the terminology "SubmitButton" so re-use it here. And make it protected so subclasses (e.g. TwoColConflict) can use it instead of having to re-implement it. Change-Id: Iae811f0487f661bb501a9893037c352efa4e1e73 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 06a5cc3b62..615bf77e8b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2915,7 +2915,7 @@ class EditPage { } } - $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text(); + $buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text(); if ( $this->missingComment ) { $out->wrapWikiMsg( "
\n$1\n
", 'missingcommenttext' ); @@ -4333,9 +4333,9 @@ class EditPage { * * @return string */ - private function getSaveButtonLabel() { + protected function getSubmitButtonLabel() { $labelAsPublish = - $this->mArticle->getContext()->getConfig()->get( 'EditSubmitButtonLabelPublish' ); + $this->context->getConfig()->get( 'EditSubmitButtonLabelPublish' ); // Can't use $this->isNew as that's also true if we're adding a new section to an extant page $newPage = !$this->mTitle->exists(); @@ -4360,7 +4360,7 @@ class EditPage { public function getEditButtons( &$tabindex ) { $buttons = []; - $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text(); + $buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text(); $attribs = [ 'name' => 'wpSave', @@ -4717,7 +4717,7 @@ class EditPage { protected function addExplainConflictHeader( OutputPage $out ) { $out->wrapWikiMsg( "
\n$1\n
", - [ 'explainconflict', $this->context->msg( $this->getSaveButtonLabel() )->text() ] + [ 'explainconflict', $this->context->msg( $this->getSubmitButtonLabel() )->text() ] ); }