http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95964

Revision: 95964
Author:   catrope
Date:     2011-09-01 11:49:09 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
RL2: Add timestamp property to list=gadgets

Modified Paths:
--------------
    branches/RL2/extensions/Gadgets/api/ApiQueryGadgets.php

Modified: branches/RL2/extensions/Gadgets/api/ApiQueryGadgets.php
===================================================================
--- branches/RL2/extensions/Gadgets/api/ApiQueryGadgets.php     2011-09-01 
10:55:45 UTC (rev 95963)
+++ branches/RL2/extensions/Gadgets/api/ApiQueryGadgets.php     2011-09-01 
11:49:09 UTC (rev 95964)
@@ -83,6 +83,9 @@
                        if ( isset( $this->props['json'] ) ) {
                                $row['json'] = $g->getJSON();
                        }
+                       if ( isset( $this->props['timestamp'] ) ) {
+                               $row['timestamp'] = wfTimestamp( TS_ISO_8601, 
$g->getTimestamp() );
+                       }
                        if ( isset( $this->props['desc'] ) ) {
                                $row['desc'] = wfMessage( 
$g->getDescriptionMsg() )->parse();
                        }
@@ -137,11 +140,12 @@
        public function getAllowedParams() {
                return array(
                        'prop' => array(
-                               ApiBase::PARAM_DFLT => 'name|json',
+                               ApiBase::PARAM_DFLT => 'name|json|timestamp',
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => array(
                                        'name',
                                        'json',
+                                       'timestamp',
                                        'desc',
                                        'desc-raw',
                                        'category',
@@ -177,6 +181,7 @@
                                'What gadget information to get:',
                                ' name           - Internal gadget name',
                                ' json           - JSON representation of the 
gadget metadata. All other prop attributes below are deprecated but provided 
for backwards compatibility',
+                               ' timestamp      - Last changed timestamp of 
the gadget metadata',
                                ' desc           - Gadget description 
transformed into HTML (can be slow, use only if really needed)',
                                ' desc-raw       - Gadget description in raw 
wikitext',
                                ' category       - Internal name of a category 
gadget belongs to (empty if top-level gadget)',


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to