From 763de4b3205f4e1fb81041859e76c6228ff0229f Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 12 Sep 2017 11:17:20 -0700 Subject: [PATCH] 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 --- includes/EditPage.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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() ] ); } -- 2.20.1