http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95979
Revision: 95979
Author: catrope
Date: 2011-09-01 13:18:40 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
RL2: Factor the building of the metadata array in Gadget::getJSON() out to
Gadget::getMetadata()
Modified Paths:
--------------
branches/RL2/extensions/Gadgets/backend/Gadget.php
Modified: branches/RL2/extensions/Gadgets/backend/Gadget.php
===================================================================
--- branches/RL2/extensions/Gadgets/backend/Gadget.php 2011-09-01 13:08:20 UTC
(rev 95978)
+++ branches/RL2/extensions/Gadgets/backend/Gadget.php 2011-09-01 13:18:40 UTC
(rev 95979)
@@ -78,11 +78,19 @@
}
/**
+ * Retrieve the metadata of this gadget, in the same format as
$properties in __construct()
+ * @return array
+ */
+ public function getMetadata() {
+ return array( 'settings' => $this->settings, 'module' =>
$this->moduleData );
+ }
+
+ /**
* Retrieve the JSON representation of this gadget, in the same format
as $properties in __construct().
* @return string JSON
*/
public function getJSON() {
- return FormatJson::encode( array( 'settings' =>
$this->settings, 'module' => $this->moduleData ) );
+ return FormatJson::encode( $this->getMetadata() );
}
/**
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs