API: (bug 16730) Added apprfiltercascade parameter to list=allpages to filter cascade...
authorRoan Kattouw <catrope@users.mediawiki.org>
Sat, 20 Dec 2008 23:54:04 +0000 (23:54 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sat, 20 Dec 2008 23:54:04 +0000 (23:54 +0000)
RELEASE-NOTES
includes/api/ApiQueryAllpages.php

index e55bca0..1732d3d 100644 (file)
@@ -544,6 +544,8 @@ The following extensions are migrated into MediaWiki 1.14:
 * (bug 16672) Include canonical namespace name in
   meta=siteinfo&siprop=namespaces.
 * (bug 16726) siprop=namespacealiases should also list localized aliases
+* (bug 16730) Added apprfiltercascade parameter to list=allpages to filter
+  cascade-protected pages
 
 === Languages updated in 1.14 ===
 
index b920944..8b22169 100644 (file)
@@ -99,6 +99,10 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                        $prlevel = array_diff($params['prlevel'], array('', '*'));
                        if (!empty($prlevel))
                                $this->addWhereFld('pr_level', $prlevel);
+                       if ($params['prfiltercascade'] == 'cascading')
+                               $this->addWhereFld('pr_cascade', 1);
+                       if ($params['prfiltercascade'] == 'noncascading')
+                               $this->addWhereFld('pr_cascade', 0);
 
                        $this->addOption('DISTINCT');
 
@@ -192,6 +196,14 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                                ApiBase :: PARAM_TYPE => $wgRestrictionLevels,
                                ApiBase :: PARAM_ISMULTI => true
                        ),
+                       'prfiltercascade' => array (
+                               ApiBase :: PARAM_DFLT => 'all',
+                               ApiBase :: PARAM_TYPE => array (
+                                       'cascading',
+                                       'noncascading',
+                                       'all'
+                               ),
+                       ),
                        'limit' => array (
                                ApiBase :: PARAM_DFLT => 10,
                                ApiBase :: PARAM_TYPE => 'limit',
@@ -228,6 +240,7 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                        'maxsize' => 'Limit to pages with at most this many bytes',
                        'prtype' => 'Limit to protected pages only',
                        'prlevel' => 'The protection level (must be used with apprtype= parameter)',
+                       'prfiltercascade' => 'Filter protections based on cascadingness (ignored when apprtype isn\'t set)',
                        'filterlanglinks' => 'Filter based on whether a page has langlinks',
                        'limit' => 'How many total pages to return.'
                );