Do not allow a user to delete a page they can't edit
[lhc/web/wiklou.git] / includes / api / ApiQueryCategoryMembers.php
index 14c2f81..17badb1 100644 (file)
@@ -31,7 +31,7 @@
  */
 class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
 
-       public function __construct( $query, $moduleName ) {
+       public function __construct( ApiQuery $query, $moduleName ) {
                parent::__construct( $query, $moduleName, 'cm' );
        }
 
@@ -86,9 +86,8 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
 
                // Scanning large datasets for rare categories sucks, and I already told
                // how to have efficient subcategory access :-) ~~~~ (oh well, domas)
-               global $wgMiserMode;
                $miser_ns = array();
-               if ( $wgMiserMode ) {
+               if ( $this->getConfig()->get( 'MiserMode' ) ) {
                        $miser_ns = $params['namespace'];
                } else {
                        $this->addWhereFld( 'page_namespace', $params['namespace'] );
@@ -339,7 +338,6 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
        }
 
        public function getParamDescription() {
-               global $wgMiserMode;
                $p = $this->getModulePrefix();
                $desc = array(
                        'title' => "Which category to enumerate (required). Must include " .
@@ -374,7 +372,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                        'limit' => 'The maximum number of pages to return.',
                );
 
-               if ( $wgMiserMode ) {
+               if ( $this->getConfig()->get( 'MiserMode' ) ) {
                        $desc['namespace'] = array(
                                $desc['namespace'],
                                "NOTE: Due to \$wgMiserMode, using this may result in fewer than \"{$p}limit\" results",
@@ -386,49 +384,10 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                return $desc;
        }
 
-       public function getResultProperties() {
-               return array(
-                       'ids' => array(
-                               'pageid' => 'integer'
-                       ),
-                       'title' => array(
-                               'ns' => 'namespace',
-                               'title' => 'string'
-                       ),
-                       'sortkey' => array(
-                               'sortkey' => 'string'
-                       ),
-                       'sortkeyprefix' => array(
-                               'sortkeyprefix' => 'string'
-                       ),
-                       'type' => array(
-                               'type' => array(
-                                       ApiBase::PROP_TYPE => array(
-                                               'page',
-                                               'subcat',
-                                               'file'
-                                       )
-                               )
-                       ),
-                       'timestamp' => array(
-                               'timestamp' => 'timestamp'
-                       )
-               );
-       }
-
        public function getDescription() {
                return 'List all pages in a given category.';
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(),
-                       $this->getTitleOrPageIdErrorMessage(),
-                       array(
-                               array( 'code' => 'invalidcategory', 'info' => 'The category name you entered is not valid' ),
-                       )
-               );
-       }
-
        public function getExamples() {
                return array(
                        'api.php?action=query&list=categorymembers&cmtitle=Category:Physics'