Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -78,12 +78,12 @@ |
79 | 79 | if($params['sort'] == 'timestamp') |
80 | 80 | { |
81 | 81 | $this->addOption('USE INDEX', 'cl_timestamp'); |
82 | | - $this->addOption('ORDER BY', 'cl_to, cl_timestamp'); |
| 82 | + $this->addOption('ORDER BY', 'cl_to, cl_timestamp' . ($params['dir'] == 'desc' ? ' DESC' : '')); |
83 | 83 | } |
84 | 84 | else |
85 | 85 | { |
86 | 86 | $this->addOption('USE INDEX', 'cl_sortkey'); |
87 | | - $this->addOption('ORDER BY', 'cl_to, cl_sortkey, cl_from'); |
| 87 | + $this->addOption('ORDER BY', 'cl_to, cl_sortkey' . ($params['dir'] == 'desc' ? ' DESC' : '') . ', cl_from'); |
88 | 88 | } |
89 | 89 | |
90 | 90 | $this->addWhere('cl_from=page_id'); |
— | — | @@ -203,6 +203,13 @@ |
204 | 204 | 'sortkey', |
205 | 205 | 'timestamp' |
206 | 206 | ) |
| 207 | + ), |
| 208 | + 'dir' => array( |
| 209 | + ApiBase :: PARAM_DFLT => 'asc', |
| 210 | + ApiBase :: PARAM_TYPE => array( |
| 211 | + 'asc', |
| 212 | + 'desc' |
| 213 | + ) |
207 | 214 | ) |
208 | 215 | ); |
209 | 216 | } |
— | — | @@ -213,6 +220,7 @@ |
214 | 221 | 'prop' => 'What pieces of information to include', |
215 | 222 | 'namespace' => 'Only include pages in these namespaces', |
216 | 223 | 'sort' => 'Property to sort by', |
| 224 | + 'dir' => 'In which direction to sort', |
217 | 225 | 'continue' => 'For large categories, give the value retured from previous query', |
218 | 226 | 'limit' => 'The maximum number of pages to return.', |
219 | 227 | ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -48,6 +48,8 @@ |
49 | 49 | |
50 | 50 | Full API documentation is available at http://www.mediawiki.org/wiki/API |
51 | 51 | |
| 52 | +* (bug 11275) Enable descending sort in categorymembers |
| 53 | + |
52 | 54 | === Languages updated in 1.12 === |
53 | 55 | |
54 | 56 | * Arabic (ar) |