summaryrefslogtreecommitdiff
path: root/includes/api/ApiQueryCategories.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiQueryCategories.php')
-rw-r--r--includes/api/ApiQueryCategories.php42
1 files changed, 10 insertions, 32 deletions
diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php
index 1926dd09..35fa56ef 100644
--- a/includes/api/ApiQueryCategories.php
+++ b/includes/api/ApiQueryCategories.php
@@ -117,8 +117,6 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
}
}
- $this->addOption( 'USE INDEX', array( 'categorylinks' => 'cl_from' ) );
-
$sort = ( $params['dir'] == 'descending' ? ' DESC' : '' );
// Don't order by cl_from if it's constant in the WHERE clause
if ( count( $this->getPageSet()->getGoodTitles() ) == 1 ) {
@@ -152,8 +150,8 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
if ( isset( $prop['timestamp'] ) ) {
$vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->cl_timestamp );
}
- if ( isset( $prop['hidden'] ) && !is_null( $row->pp_propname ) ) {
- $vals['hidden'] = '';
+ if ( isset( $prop['hidden'] ) ) {
+ $vals['hidden'] = !is_null( $row->pp_propname );
}
$fit = $this->addPageSubItem( $row->cl_from, $vals );
@@ -202,7 +200,9 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1,
ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
),
- 'continue' => null,
+ 'continue' => array(
+ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
+ ),
'categories' => array(
ApiBase::PARAM_ISMULTI => true,
),
@@ -216,34 +216,12 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
);
}
- public function getParamDescription() {
- return array(
- 'prop' => array(
- 'Which additional properties to get for each category',
- ' sortkey - Adds the sortkey (hexadecimal string) and sortkey prefix',
- ' (human-readable part) for the category',
- ' timestamp - Adds timestamp of when the category was added',
- ' hidden - Tags categories that are hidden with __HIDDENCAT__',
- ),
- 'limit' => 'How many categories to return',
- 'show' => 'Which kind of categories to show',
- 'continue' => 'When more results are available, use this to continue',
- 'categories' => 'Only list these categories. Useful for checking ' .
- 'whether a certain page is in a certain category',
- 'dir' => 'The direction in which to list',
- );
- }
-
- public function getDescription() {
- return 'List all categories the page(s) belong to.';
- }
-
- public function getExamples() {
+ protected function getExamplesMessages() {
return array(
- 'api.php?action=query&prop=categories&titles=Albert%20Einstein'
- => 'Get a list of categories [[Albert Einstein]] belongs to',
- 'api.php?action=query&generator=categories&titles=Albert%20Einstein&prop=info'
- => 'Get information about all categories used in the [[Albert Einstein]]',
+ 'action=query&prop=categories&titles=Albert%20Einstein'
+ => 'apihelp-query+categories-example-simple',
+ 'action=query&generator=categories&titles=Albert%20Einstein&prop=info'
+ => 'apihelp-query+categories-example-generator',
);
}