Added clprop=timestamp to prop=categories

This commit is contained in:
Bryan Tong Minh 2008-06-27 20:35:43 +00:00
parent 21a83c3597
commit 832131ce73
2 changed files with 9 additions and 1 deletions

View file

@ -476,6 +476,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
* (bug 14402) Added maxage and smaxage parameters to api.php
* Added bkip parameter to list=blocks
* (bug 14651) apprefix and similar parameters are now canonicalized
* Added clprop=timestamp to prop=categories
=== Languages updated in 1.13 ===

View file

@ -60,7 +60,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
'cl_to'
));
$fld_sortkey = false;
$fld_sortkey = $fld_timestamp = false;
if (!is_null($prop)) {
foreach($prop as $p) {
switch ($p) {
@ -68,6 +68,10 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
$this->addFields('cl_sortkey');
$fld_sortkey = true;
break;
case 'timestamp':
$this->addFields('cl_timestamp');
$fld_timestamp = true;
break;
default :
ApiBase :: dieDebug(__METHOD__, "Unknown prop=$p");
}
@ -100,6 +104,8 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
ApiQueryBase :: addTitleInfo($vals, $title);
if ($fld_sortkey)
$vals['sortkey'] = $row->cl_sortkey;
if ($fld_timestamp)
$vals['timestamp'] = $row->cl_timestamp;
$data[] = $vals;
}
@ -126,6 +132,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_TYPE => array (
'sortkey',
'timestamp',
)
)
);