* (bug 29935) Improve formatting of examples in ApiParamInfo
authorSam Reed <reedy@users.mediawiki.org>
Mon, 18 Jul 2011 13:19:46 +0000 (13:19 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 18 Jul 2011 13:19:46 +0000 (13:19 +0000)
Old example string with newlines left for the moment, pending discussion on bug...

RELEASE-NOTES-1.19
includes/api/ApiParamInfo.php

index 049b777..acf83ba 100644 (file)
@@ -197,6 +197,7 @@ production.
   srprop=sectiontitle
 * Correct the documentation of srprop properties
 * (bug 28817) Add reference help page link to API Modules
+* (bug 29935) Improve formatting of examples in ApiParamInfo
 
 === Languages updated in 1.19 ===
 
index eac784e..6ba115e 100644 (file)
@@ -93,7 +93,8 @@ class ApiParamInfo extends ApiBase {
                $result = $this->getResult();
                $retval['classname'] = get_class( $obj );
                $retval['description'] = implode( "\n", (array)$obj->getDescription() );
-               $retval['examples'] = implode( "\n", (array)$obj->getExamples() );
+               $examples = (array)$obj->getExamples();
+               $retval['examples'] = implode( "\n", $examples );
                $retval['version'] = implode( "\n", (array)$obj->getVersion() );
                $retval['prefix'] = $obj->getModulePrefix();
 
@@ -118,6 +119,9 @@ class ApiParamInfo extends ApiBase {
                $retval['helpurls'] = (array)$obj->getHelpUrls();
                $result->setIndexedTagName( $retval['helpurls'], 'helpurl' );
 
+               $retval['allexamples'] = $examples;
+               $result->setIndexedTagName( $retval['allexamples'], 'example' );
+
                $retval['parameters'] = array();
                $paramDesc = $obj->getFinalParamDescription();
                foreach ( $allowedParams as $n => $p ) {