EditPage: Allow the 'save' button's label to be 'publish' for public wikis
authorJames D. Forrester <jforrester@wikimedia.org>
Thu, 30 Jun 2016 11:58:12 +0000 (12:58 +0100)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 30 Jun 2016 13:58:56 +0000 (14:58 +0100)
Default remains 'save xyz', at least for now.

Bug: T131132
Change-Id: I56634ed223778a0650cf36ac7256151b13c494f1

includes/DefaultSettings.php
includes/EditPage.php

index b8e1486..54c7218 100644 (file)
@@ -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.
  *
index 7f94140..78455fb 100644 (file)
@@ -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',