X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPageSet.php;h=d67b18420e23b9d26799d8b5e34b703f04b982fe;hb=df80f1ead5daa993facf934fb32b0d5e10e3d5b9;hp=5efe7885e7cd4671a458d31c2c8dc0e494d6f6e1;hpb=d1150378f15b4dd699220bee41d0ce3af8868a18;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 5efe7885e7..d67b18420e 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -1304,8 +1304,8 @@ class ApiPageSet extends ApiBase { ), 'generator' => array( ApiBase::PARAM_TYPE => null, - ApiBase::PARAM_VALUE_LINKS => array(), ApiBase::PARAM_HELP_MSG => 'api-pageset-param-generator', + ApiBase::PARAM_SUBMODULE_PARAM_PREFIX => 'g', ), 'redirects' => array( ApiBase::PARAM_DFLT => false, @@ -1331,10 +1331,8 @@ class ApiPageSet extends ApiBase { if ( !$this->mAllowGenerator ) { unset( $result['generator'] ); } elseif ( $flags & ApiBase::GET_VALUES_FOR_HELP ) { - foreach ( $this->getGenerators() as $g ) { - $result['generator'][ApiBase::PARAM_TYPE][] = $g; - $result['generator'][ApiBase::PARAM_VALUE_LINKS][$g] = "Special:ApiHelp/query+$g"; - } + $result['generator'][ApiBase::PARAM_TYPE] = 'submodule'; + $result['generator'][ApiBase::PARAM_SUBMODULE_MAP] = $this->getGenerators(); } return $result; @@ -1355,13 +1353,14 @@ class ApiPageSet extends ApiBase { $query = $this->getMain()->getModuleManager()->getModule( 'query' ); } $gens = array(); + $prefix = $query->getModulePath() . '+'; $mgr = $query->getModuleManager(); foreach ( $mgr->getNamesWithClasses() as $name => $class ) { if ( is_subclass_of( $class, 'ApiQueryGeneratorBase' ) ) { - $gens[] = $name; + $gens[$name] = $prefix . $name; } } - sort( $gens ); + ksort( $gens ); self::$generators = $gens; }