Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1133,8 +1133,6 @@ |
1134 | 1134 | 'notargettext', |
1135 | 1135 | 'pager-newer-n', |
1136 | 1136 | 'pager-older-n', |
1137 | | - 'pager-sort-asc', |
1138 | | - 'pager-sort-desc', |
1139 | 1137 | ), |
1140 | 1138 | 'booksources' => array( |
1141 | 1139 | 'booksources', |
Index: trunk/phase3/includes/SpecialCategories.php |
— | — | @@ -17,6 +17,9 @@ |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
| 21 | + * TODO: Allow sorting by count. We need to have a unique index to do this |
| 22 | + * properly. |
| 23 | + * |
21 | 24 | * @addtogroup SpecialPage |
22 | 25 | * @addtogroup Pager |
23 | 26 | */ |
— | — | @@ -31,16 +34,18 @@ |
32 | 35 | } |
33 | 36 | |
34 | 37 | function getIndexField() { |
35 | | - return array( 'abc' => 'cat_title', 'count' => 'cat_pages' ); |
| 38 | +# return array( 'abc' => 'cat_title', 'count' => 'cat_pages' ); |
| 39 | + return 'cat_title'; |
36 | 40 | } |
37 | 41 | |
38 | | - protected function getOrderTypeMessages() { |
39 | | - return array( 'abc' => 'special-categories-sort-abc', |
40 | | - 'count' => 'special-categories-sort-count' ); |
41 | | - } |
| 42 | +# protected function getOrderTypeMessages() { |
| 43 | +# return array( 'abc' => 'special-categories-sort-abc', |
| 44 | +# 'count' => 'special-categories-sort-count' ); |
| 45 | +# } |
42 | 46 | |
43 | | - protected function getDefaultDirection() { |
44 | | - return array( 'abc' => false, 'count' => true ); |
| 47 | + protected function getDefaultDirections() { |
| 48 | +# return array( 'abc' => false, 'count' => true ); |
| 49 | + return false; |
45 | 50 | } |
46 | 51 | |
47 | 52 | /* Override getBody to apply LinksBatch on resultset before actually outputting anything. */ |
Index: trunk/phase3/includes/Pager.php |
— | — | @@ -75,9 +75,8 @@ |
76 | 76 | * going backwards, we'll display the last page of results, but the last |
77 | 77 | * result will be at the bottom, not the top. |
78 | 78 | * |
79 | | - * "Default" is really a misnomer here, since now it's possible for the |
80 | | - * user to directly modify this with query parameters. TODO: rename that |
81 | | - * to $mDescending, maybe set this to that by reference for compatibility. |
| 79 | + * Like $mIndexField, $mDefaultDirection will be a single value even if the |
| 80 | + * class supports multiple default directions for different order types. |
82 | 81 | */ |
83 | 82 | public $mDefaultDirection; |
84 | 83 | public $mIsBackwards; |
— | — | @@ -119,20 +118,11 @@ |
120 | 119 | } |
121 | 120 | |
122 | 121 | if( !isset( $this->mDefaultDirection ) ) { |
123 | | - $dir = $this->getDefaultDirection(); |
| 122 | + $dir = $this->getDefaultDirections(); |
124 | 123 | $this->mDefaultDirection = is_array( $dir ) |
125 | 124 | ? $dir[$this->mOrderType] |
126 | 125 | : $dir; |
127 | 126 | } |
128 | | - |
129 | | - # FIXME: Can we figure out a less confusing convention than using a |
130 | | - # "direction" parameter when we already have "dir" and "order"? |
131 | | - if( $this->mRequest->getVal( 'direction' ) == 'asc' ) { |
132 | | - $this->mDefaultDirection = false; |
133 | | - } |
134 | | - if( $this->mRequest->getVal( 'direction' ) == 'desc' ) { |
135 | | - $this->mDefaultDirection = true; |
136 | | - } |
137 | 127 | } |
138 | 128 | |
139 | 129 | /** |
— | — | @@ -345,7 +335,6 @@ |
346 | 336 | unset( $this->mDefaultQuery['dir'] ); |
347 | 337 | unset( $this->mDefaultQuery['offset'] ); |
348 | 338 | unset( $this->mDefaultQuery['limit'] ); |
349 | | - unset( $this->mDefaultQuery['direction'] ); |
350 | 339 | unset( $this->mDefaultQuery['order'] ); |
351 | 340 | } |
352 | 341 | return $this->mDefaultQuery; |
— | — | @@ -362,7 +351,7 @@ |
363 | 352 | } |
364 | 353 | |
365 | 354 | /** |
366 | | - * Get a query array for the prev, next, first and last links. |
| 355 | + * Get a URL query array for the prev, next, first and last links. |
367 | 356 | */ |
368 | 357 | function getPagingQueries() { |
369 | 358 | if ( !$this->mQueryDone ) { |
— | — | @@ -449,6 +438,9 @@ |
450 | 439 | * 'querykey' => 'indexfield' pairs, so that a request with &count=querykey |
451 | 440 | * will use indexfield to sort. In this case, the first returned key is |
452 | 441 | * the default. |
| 442 | + * |
| 443 | + * Needless to say, it's really not a good idea to use a non-unique index |
| 444 | + * for this! That won't page right. |
453 | 445 | */ |
454 | 446 | abstract function getIndexField(); |
455 | 447 | |
— | — | @@ -464,12 +456,12 @@ |
465 | 457 | * called, for instance if it's statically initialized. In that case the |
466 | 458 | * value of that variable (which must be a boolean) will be used. |
467 | 459 | * |
468 | | - * Note that despite its name, this does not return the value of the now- |
469 | | - * misnamed $this->mDefaultDirection member variable. That is not a |
470 | | - * default, it's the actual direction used. This is just the default and |
471 | | - * can be overridden by user input. |
| 460 | + * Note that despite its name, this does not return the value of the |
| 461 | + * $this->mDefaultDirection member variable. That's the default for this |
| 462 | + * particular instantiation, which is a single value. This is the set of |
| 463 | + * all defaults for the class. |
472 | 464 | */ |
473 | | - protected function getDefaultDirection() { return false; } |
| 465 | + protected function getDefaultDirections() { return false; } |
474 | 466 | } |
475 | 467 | |
476 | 468 | |
— | — | @@ -483,7 +475,7 @@ |
484 | 476 | } |
485 | 477 | |
486 | 478 | /** |
487 | | - * Shamelessly stolen bits from ReverseChronologicalPager, d |
| 479 | + * Shamelessly stolen bits from ReverseChronologicalPager, |
488 | 480 | * didn't want to do class magic as may be still revamped |
489 | 481 | */ |
490 | 482 | function getNavigationBar() { |
— | — | @@ -509,27 +501,6 @@ |
510 | 502 | wfMsgHtml( 'viewprevnext', $pagingLinks['prev'], |
511 | 503 | $pagingLinks['next'], $limits ); |
512 | 504 | |
513 | | - /* |
514 | | - $dirlinks = array(); |
515 | | - # Note for grep: uses pager-sort-asc, pager-sort-desc (each in two |
516 | | - # places) |
517 | | - foreach( array( 'asc', 'desc' ) as $dir ) { |
518 | | - if( ($this->mDefaultDirection ? 'desc' : 'asc' ) == $dir ) { |
519 | | - # Don't print a link, just some text |
520 | | - $dirlinks[$dir] = wfMsgHTML( "pager-sort-$dir" ); |
521 | | - } else { |
522 | | - $query = array( 'direction' => $dir ); |
523 | | - if( $this->mOrderType !== null ) { |
524 | | - $query['order'] = $this->mOrderType; |
525 | | - } |
526 | | - $dirlinks[$dir] = $this->makeLink( |
527 | | - wfMsgHTML( "pager-sort-$dir" ), |
528 | | - $query |
529 | | - ); |
530 | | - } |
531 | | - } |
532 | | - $this->mNavigationBar .= ' (' . implode( ' | ', $dirlinks ) . ')'; |
533 | | - |
534 | 505 | if( !is_array( $this->getIndexField() ) ) { |
535 | 506 | # Early return to avoid undue nesting |
536 | 507 | return $this->mNavigationBar; |
— | — | @@ -558,7 +529,6 @@ |
559 | 530 | if( $extra !== '' ) { |
560 | 531 | $this->mNavigationBar .= " ($extra)"; |
561 | 532 | } |
562 | | - */ |
563 | 533 | |
564 | 534 | return $this->mNavigationBar; |
565 | 535 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1729,8 +1729,6 @@ |
1730 | 1730 | 'notargettext' => 'You have not specified a target page or user to perform this function on.', |
1731 | 1731 | 'pager-newer-n' => '{{PLURAL:$1|newer 1|newer $1}}', |
1732 | 1732 | 'pager-older-n' => '{{PLURAL:$1|older 1|older $1}}', |
1733 | | -'pager-sort-asc' => 'ascending', |
1734 | | -'pager-sort-desc' => 'descending', |
1735 | 1733 | |
1736 | 1734 | # Book sources |
1737 | 1735 | 'booksources' => 'Book sources', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -49,11 +49,7 @@ |
50 | 50 | * Add category table to allow better tracking of category membership counts |
51 | 51 | ** (bug 1212) Give correct membership counts on the pages of large categories |
52 | 52 | ** Use category table for more efficient display of Special:Categories |
53 | | -** Allow sorting by number of members on Special:Categories |
54 | 53 | * (bug 1459) Search for duplicate files by hash: Special:FileDuplicateSearch |
55 | | -* Allow the user to choose whether to use a descending or ascending sort in |
56 | | - AlphabeticPager-based special pages (Categories, Listusers, Protectedpages/ |
57 | | - titles). |
58 | 54 | |
59 | 55 | === Bug fixes in 1.13 === |
60 | 56 | |