r30071 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30070‎ | r30071 | r30072 >
Date:16:59, 23 January 2008
Author:catrope
Status:old
Tags:
Comment:
API: Adding parameter description to action=paraminfo output
Modified paths:
  • /trunk/phase3/includes/api/ApiParamInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParamInfo.php
@@ -78,6 +78,7 @@
7979 if(!is_array($allowedParams))
8080 return $retval;
8181 $retval['parameters'] = array();
 82+ $paramDesc = $obj->getParamDescription();
8283 foreach($obj->getAllowedParams() as $n => $p)
8384 {
8485 $a = array('name' => $n);
@@ -111,6 +112,8 @@
112113 $a['highmax'] = $p[ApiBase::PARAM_MAX2];
113114 if(isset($p[ApiBase::PARAM_MIN]))
114115 $a['min'] = $p[ApiBase::PARAM_MIN];
 116+ if(isset($paramDesc[$n]))
 117+ $a['description'] = (is_array($paramDesc[$n]) ? implode("\n", $paramDesc[$n]) : $paramDesc[$n]);
115118 $retval['parameters'][] = $a;
116119 }
117120 $result->setIndexedTagName($retval['parameters'], 'param');

Status & tagging log