Tpt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376667 )

Change subject: Restore page status buttons
......................................................................

Restore page status buttons

EditPage::getCheckboxes() is deprecated and not really called anymore.
So override EditPage::getCheckboxesWidget() instead, and just fit the
generated HTML into a generic OOUI widget.

Bug: T175304
Change-Id: I6b0abfbdd2ce1fe7d200365af0a9b26df26edebc
---
M includes/page/EditPagePage.php
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/67/376667/1

diff --git a/includes/page/EditPagePage.php b/includes/page/EditPagePage.php
index b6c4dc4..cb9eaeb 100644
--- a/includes/page/EditPagePage.php
+++ b/includes/page/EditPagePage.php
@@ -7,6 +7,7 @@
 use EditPage;
 use Html;
 use MWException;
+use OOUI;
 use ProofreadPage\Context;
 use ProofreadPagePage;
 use Status;
@@ -145,9 +146,9 @@
        /**
         * Sets the checkboxes for the proofreading status of the page.
         *
-        * @see EditPage::getCheckBoxes
+        * @see EditPage::getCheckboxesWidget
         */
-       public function getCheckBoxes( &$tabindex, $checked ) {
+       public function getCheckboxesWidget( &$tabindex, $checked ) {
                $oldLevel = $this->getCurrentContent()->getLevel();
 
                $content = $this->toEditContent( $this->textbox1 );
@@ -155,7 +156,7 @@
 
                $qualityLevels = [ 0, 2, 1, 3, 4 ];
                $html = '';
-               $checkboxes = parent::getCheckBoxes( $tabindex, $checked );
+               $checkboxes = parent::getCheckboxesWidget( $tabindex, $checked 
);
                $user = $this->context->getUser();
 
                foreach ( $qualityLevels as $level ) {
@@ -180,9 +181,9 @@
                                Html::closeElement( 'span' );
                }
 
-               $checkboxes['wpr-pageStatus'] = '';
+               $checkboxes['wpr-pageStatus'] = new OOUI\Widget( [ 'content' => 
new OOUI\HtmlSnippet( '' ) ] );
                if ( $user->isAllowed( 'pagequality' ) ) {
-                       $checkboxes['wpr-pageStatus'] =
+                       $content =
                                Html::openElement( 'span', [ 'id' => 
'wpQuality-container' ] ) .
                                $html .
                                Html::closeElement( 'span' ) .
@@ -190,6 +191,9 @@
                                $this->context->msg( 
'proofreadpage_page_status' )
                                        ->title( $this->getTitle() )->parse() .
                                Html::closeElement( 'label' );
+                       $checkboxes['wpr-pageStatus'] = new OOUI\Widget(
+                               [ 'content' => new OOUI\HtmlSnippet( $content ) 
]
+                       );
                }
 
                return $checkboxes;

-- 
To view, visit https://gerrit.wikimedia.org/r/376667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b0abfbdd2ce1fe7d200365af0a9b26df26edebc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: wmf/1.30.0-wmf.17
Gerrit-Owner: Tpt <thoma...@hotmail.fr>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to