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

Change subject: Adding alphabetical sorting option on Special:WantedCategories
......................................................................

Adding alphabetical sorting option on Special:WantedCategories

Bug: T149299
Change-Id: I7eda311c58ef4488b52fad32c2996d8b7b45657a
---
M includes/specials/SpecialWantedcategories.php
1 file changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/369597/1

diff --git a/includes/specials/SpecialWantedcategories.php 
b/includes/specials/SpecialWantedcategories.php
index fc0c312..f592005 100644
--- a/includes/specials/SpecialWantedcategories.php
+++ b/includes/specials/SpecialWantedcategories.php
@@ -125,6 +125,26 @@
                return $this->getLanguage()->specialList( $plink, $nlinks );
        }
 
+       function getPageHeader() {
+               $query = [ 'limit' => $this->limit, 'offset' => $this->offset, 
'sort' => $this->getOrderFields()[ 1 ] ];
+               if ( $this->getOrderFields()[0] == 'title' ) {
+                       return Html::element( 'a', [ 'href' => 
$this->getTitle()->getLocalURL( $query ) ], $this->msg( 
'pageswithprop-sortbyvalue' )->text() ) . ' | <b>' . $this->msg( 
'changecontentmodel-title-label' )->text() . '</b>';
+               }
+               else {
+                       return '<b>' . $this->msg( 'pageswithprop-sortbyvalue' 
)->text() . '</b> | ' . 
+                               Html::element( 'a', [ 'href' => 
$this->getTitle()->getLocalURL( $query ) ], $this->msg( 
'changecontentmodel-title-label' )->text() );
+               }
+       }
+
+       function getOrderFields() {
+               if ( $this->getRequest()->getText( 'sort' ) == 'title' ) return 
[ 'title', 'value DESC' ];
+               else return [ 'value DESC', 'title' ];
+       }
+
+       function linkParameters() {
+               return [ 'sort' => $this->getOrderFields()[ 0 ] ];
+       }
+
        protected function getGroupName() {
                return 'maintenance';
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7eda311c58ef4488b52fad32c2996d8b7b45657a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Louperivois <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to