From 74fa6071c2e5be4a182c4bf6863bee095ab0c03e Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Thu, 30 Jun 2016 12:58:12 +0100 Subject: [PATCH] EditPage: Allow the 'save' button's label to be 'publish' for public wikis Default remains 'save xyz', at least for now. Bug: T131132 Change-Id: I56634ed223778a0650cf36ac7256151b13c494f1 --- includes/DefaultSettings.php | 9 +++++++++ includes/EditPage.php | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index b8e1486376..54c7218c75 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3195,6 +3195,15 @@ $wgHTMLFormAllowTableFormat = true; */ $wgUseMediaWikiUIEverywhere = false; +/** + * Whether to label the store-to-database-and-show-to-others button in the editor + * as "Save page"/"Save changes" if false (the default) or, if true, instead as + * "Publish page"/"Publish changes". + * + * @since 1.28 + */ +$wgEditButtonPublishNotSave = false; + /** * Permit other namespaces in addition to the w3.org default. * diff --git a/includes/EditPage.php b/includes/EditPage.php index 7f9414024e..78455fb0aa 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -4032,7 +4032,12 @@ HTML public function getEditButtons( &$tabindex ) { $buttons = []; - $buttonLabelKey = $this->isNew ? 'savearticle' : 'savechanges'; + $labelAsPublish = $this->mArticle->getContext()->getConfig()->get( 'EditButtonPublishNotSave' ); + if ( $labelAsPublish ) { + $buttonLabelKey = $this->isNew ? 'publishpage' : 'publishchanges'; + } else { + $buttonLabelKey = $this->isNew ? 'savearticle' : 'savechanges'; + } $buttonLabel = wfMessage( $buttonLabelKey )->text(); $attribs = [ 'id' => 'wpSave', -- 2.20.1