Merge "EditPage: Allow the 'save' button's label to be 'publish' for public wikis"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 24 Aug 2016 00:17:38 +0000 (00:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 24 Aug 2016 00:17:38 +0000 (00:17 +0000)
includes/DefaultSettings.php
includes/EditPage.php

index cad1f63..e15c988 100644 (file)
@@ -3193,6 +3193,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.
  *
index da35fb5..c7b014a 100644 (file)
@@ -4050,7 +4050,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',