From 54946d842fe0c8aa7365fb2cae93086861f3f1f6 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 18 Jul 2011 13:19:46 +0000 Subject: [PATCH] * (bug 29935) Improve formatting of examples in ApiParamInfo Old example string with newlines left for the moment, pending discussion on bug... --- RELEASE-NOTES-1.19 | 1 + includes/api/ApiParamInfo.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 ) { -- 2.20.1