From: Sam Reed Date: Mon, 18 Jul 2011 13:19:46 +0000 (+0000) Subject: * (bug 29935) Improve formatting of examples in ApiParamInfo X-Git-Tag: 1.31.0-rc.0~28776 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=54946d842fe0c8aa7365fb2cae93086861f3f1f6;p=lhc%2Fweb%2Fwiklou.git * (bug 29935) Improve formatting of examples in ApiParamInfo Old example string with newlines left for the moment, pending discussion on bug... --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 049b777099..acf83bad50 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 === diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index eac784e35e..6ba115e431 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -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 ) {