From 6ddef7e30ab77f3f32086dcaac9bddda6b4a2bb4 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 20 Dec 2008 23:54:04 +0000 Subject: [PATCH] API: (bug 16730) Added apprfiltercascade parameter to list=allpages to filter cascade-protected pages --- RELEASE-NOTES | 2 ++ includes/api/ApiQueryAllpages.php | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e55bca0779..1732d3db25 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index b920944603..8b221693e8 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -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.' ); -- 2.20.1