Update IPSet use statements
[lhc/web/wiklou.git] / includes / EditPage.php
index a41e6d9..72c3c14 100644 (file)
@@ -4392,34 +4392,32 @@ class EditPage {
        public function getEditButtons( &$tabindex ) {
                $buttons = [];
 
-               $buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text();
+               $labelAsPublish =
+                       $this->context->getConfig()->get( 'EditSubmitButtonLabelPublish' );
 
-               $attribs = [
-                       'name' => 'wpSave',
-                       'tabindex' => ++$tabindex,
-               ];
+               $buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text();
+               $buttonTooltip = $labelAsPublish ? 'publish' : 'save';
 
-               $saveConfig = OOUI\Element::configFromHtmlAttributes( $attribs );
                $buttons['save'] = new OOUI\ButtonInputWidget( [
+                       'name' => 'wpSave',
+                       'tabIndex' => ++$tabindex,
                        'id' => 'wpSaveWidget',
                        'inputId' => 'wpSave',
                        // Support: IE 6 – Use <input>, otherwise it can't distinguish which button was clicked
                        'useInputTag' => true,
-                       'flags' => [ 'constructive', 'primary' ],
+                       'flags' => [ 'progressive', 'primary' ],
                        'label' => $buttonLabel,
                        'infusable' => true,
                        'type' => 'submit',
-                       'title' => Linker::titleAttrib( 'save' ),
-                       'accessKey' => Linker::accesskey( 'save' ),
-               ] + $saveConfig );
-
-               $attribs = [
-                       'name' => 'wpPreview',
-                       'tabindex' => ++$tabindex,
-               ];
+                       // Messages used: tooltip-save, tooltip-publish
+                       'title' => Linker::titleAttrib( $buttonTooltip ),
+                       // Messages used: accesskey-save, accesskey-publish
+                       'accessKey' => Linker::accesskey( $buttonTooltip ),
+               ] );
 
-               $previewConfig = OOUI\Element::configFromHtmlAttributes( $attribs );
                $buttons['preview'] = new OOUI\ButtonInputWidget( [
+                       'name' => 'wpPreview',
+                       'tabIndex' => ++$tabindex,
                        'id' => 'wpPreviewWidget',
                        'inputId' => 'wpPreview',
                        // Support: IE 6 – Use <input>, otherwise it can't distinguish which button was clicked
@@ -4427,17 +4425,15 @@ class EditPage {
                        'label' => $this->context->msg( 'showpreview' )->text(),
                        'infusable' => true,
                        'type' => 'submit',
+                       // Message used: tooltip-preview
                        'title' => Linker::titleAttrib( 'preview' ),
+                       // Message used: accesskey-preview
                        'accessKey' => Linker::accesskey( 'preview' ),
-               ] + $previewConfig );
-
-               $attribs = [
-                       'name' => 'wpDiff',
-                       'tabindex' => ++$tabindex,
-               ];
+               ] );
 
-               $diffConfig = OOUI\Element::configFromHtmlAttributes( $attribs );
                $buttons['diff'] = new OOUI\ButtonInputWidget( [
+                       'name' => 'wpDiff',
+                       'tabIndex' => ++$tabindex,
                        'id' => 'wpDiffWidget',
                        'inputId' => 'wpDiff',
                        // Support: IE 6 – Use <input>, otherwise it can't distinguish which button was clicked
@@ -4445,9 +4441,11 @@ class EditPage {
                        'label' => $this->context->msg( 'showdiff' )->text(),
                        'infusable' => true,
                        'type' => 'submit',
+                       // Message used: tooltip-diff
                        'title' => Linker::titleAttrib( 'diff' ),
+                       // Message used: accesskey-diff
                        'accessKey' => Linker::accesskey( 'diff' ),
-               ] + $diffConfig );
+               ] );
 
                // Avoid PHP 7.1 warning of passing $this by reference
                $editPage = $this;