Index: trunk/phase3/includes/api/ApiQueryCategories.php |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | |
56 | 56 | $params = $this->extractRequestParams(); |
57 | 57 | $prop = $params['prop']; |
| 58 | + $show = array_flip((array)$params['show']); |
58 | 59 | |
59 | 60 | $this->addFields(array ( |
60 | 61 | 'cl_from', |
— | — | @@ -91,6 +92,15 @@ |
92 | 93 | "(cl_from = $clfrom AND ". |
93 | 94 | "cl_to >= '$clto')"); |
94 | 95 | } |
| 96 | + if(isset($show['hidden']) && isset($show['!hidden'])) |
| 97 | + $this->dieUsage("Incorrect parameter - mutually exclusive values may not be supplied", 'show'); |
| 98 | + if(isset($show['hidden']) || isset($show['!hidden'])) |
| 99 | + { |
| 100 | + $this->addTables('category'); |
| 101 | + $this->addWhere(array( 'cl_to = cat_title', |
| 102 | + 'cat_hidden' => isset($show['hidden']))); |
| 103 | + } |
| 104 | + |
95 | 105 | # Don't order by cl_from if it's constant in the WHERE clause |
96 | 106 | if(count($this->getPageSet()->getGoodTitles()) == 1) |
97 | 107 | $this->addOption('ORDER BY', 'cl_to'); |
— | — | @@ -166,6 +176,13 @@ |
167 | 177 | 'timestamp', |
168 | 178 | ) |
169 | 179 | ), |
| 180 | + 'show' => array( |
| 181 | + ApiBase :: PARAM_ISMULTI => true, |
| 182 | + ApiBase :: PARAM_TYPE => array( |
| 183 | + 'hidden', |
| 184 | + '!hidden', |
| 185 | + ) |
| 186 | + ), |
170 | 187 | 'limit' => array( |
171 | 188 | ApiBase :: PARAM_DFLT => 10, |
172 | 189 | ApiBase :: PARAM_TYPE => 'limit', |
— | — | @@ -181,6 +198,7 @@ |
182 | 199 | return array ( |
183 | 200 | 'prop' => 'Which additional properties to get for each category.', |
184 | 201 | 'limit' => 'How many categories to return', |
| 202 | + 'show' => 'Which kind of categories to show', |
185 | 203 | 'continue' => 'When more results are available, use this to continue', |
186 | 204 | ); |
187 | 205 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -151,6 +151,8 @@ |
152 | 152 | output. |
153 | 153 | * When the limit on multivalue parameters is exceeded, a warning is issued |
154 | 154 | * list=search doesn't list missing pages any more |
| 155 | +* (bug 15178) Added clshow to prop=categories to allow filtering for hidden/ |
| 156 | + non-hidden categories |
155 | 157 | |
156 | 158 | === Languages updated in 1.14 === |
157 | 159 | |