Added clprop=timestamp to prop=categories
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 27 Jun 2008 20:35:43 +0000 (20:35 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 27 Jun 2008 20:35:43 +0000 (20:35 +0000)
RELEASE-NOTES
includes/api/ApiQueryCategories.php

index 87cb4b5..0b0d8d2 100644 (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 ===
 
index 2fd4eb4..e45e0f6 100644 (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',
                                )
                        )
                );