Index: branches/wmf/1.18wmf1/docs/hooks.txt |
— | — | @@ -308,12 +308,16 @@ |
309 | 309 | &$resultArr : data in this array will be added to the API result |
310 | 310 | |
311 | 311 | 'APIGetAllowedParams': use this hook to modify a module's parameters. |
312 | | -&$module: Module object |
| 312 | +&$module: ApiBase Module object |
313 | 313 | &$params: Array of parameters |
314 | 314 | |
| 315 | +'APIGetDescription': use this hook to modify a module's description |
| 316 | +&$module: ApiBase Module object |
| 317 | +&$desc: Array of descriptions |
| 318 | + |
315 | 319 | 'APIGetParamDescription': use this hook to modify a module's parameter |
316 | 320 | descriptions. |
317 | | -&$module: Module object |
| 321 | +&$module: ApiBase Module object |
318 | 322 | &$desc: Array of parameter descriptions |
319 | 323 | |
320 | 324 | 'APIQueryAfterExecute': after calling the execute() method of an |
Property changes on: branches/wmf/1.18wmf1/docs/hooks.txt |
___________________________________________________________________ |
Modified: svn:mergeinfo |
321 | 325 | Merged /trunk/phase3/docs/hooks.txt:r104441 |
Index: branches/wmf/1.18wmf1/includes/api/ApiBase.php |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | public function makeHelpMsg() { |
238 | 238 | static $lnPrfx = "\n "; |
239 | 239 | |
240 | | - $msg = $this->getDescription(); |
| 240 | + $msg = $this->getFinalDescription(); |
241 | 241 | |
242 | 242 | if ( $msg !== false ) { |
243 | 243 | |
— | — | @@ -510,6 +510,7 @@ |
511 | 511 | /** |
512 | 512 | * Get final list of parameters, after hooks have had a chance to |
513 | 513 | * tweak it as needed. |
| 514 | + * |
514 | 515 | * @return array or false |
515 | 516 | */ |
516 | 517 | public function getFinalParams() { |
— | — | @@ -519,8 +520,9 @@ |
520 | 521 | } |
521 | 522 | |
522 | 523 | /** |
523 | | - * Get final description, after hooks have had a chance to tweak it as |
| 524 | + * Get final parameter descriptions, after hooks have had a chance to tweak it as |
524 | 525 | * needed. |
| 526 | + * |
525 | 527 | * @return array |
526 | 528 | */ |
527 | 529 | public function getFinalParamDescription() { |
— | — | @@ -530,6 +532,18 @@ |
531 | 533 | } |
532 | 534 | |
533 | 535 | /** |
| 536 | + * Get final module description, after hooks have had a chance to tweak it as |
| 537 | + * needed. |
| 538 | + * |
| 539 | + * @return array |
| 540 | + */ |
| 541 | + public function getFinalDescription() { |
| 542 | + $desc = $this->getDescription(); |
| 543 | + wfRunHooks( 'APIGetDescription', array( &$this, &$desc ) ); |
| 544 | + return $desc; |
| 545 | + } |
| 546 | + |
| 547 | + /** |
534 | 548 | * This method mangles parameter name based on the prefix supplied to the constructor. |
535 | 549 | * Override this method to change parameter name during runtime |
536 | 550 | * @param $paramName string Parameter name |
Index: branches/wmf/1.18wmf1/includes/api/ApiParamInfo.php |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | function getClassInfo( $obj ) { |
94 | 94 | $result = $this->getResult(); |
95 | 95 | $retval['classname'] = get_class( $obj ); |
96 | | - $retval['description'] = implode( "\n", (array)$obj->getDescription() ); |
| 96 | + $retval['description'] = implode( "\n", (array)$obj->getFinalDescription() ); |
97 | 97 | $examples = (array)$obj->getExamples(); |
98 | 98 | $retval['examples'] = implode( "\n", $examples ); |
99 | 99 | $retval['version'] = implode( "\n", (array)$obj->getVersion() ); |
Property changes on: branches/wmf/1.18wmf1/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
100 | 100 | Merged /trunk/phase3/includes/api:r104441,104470 |
Property changes on: branches/wmf/1.18wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
101 | 101 | Merged /trunk/phase3/includes:r104441,104470 |
Property changes on: branches/wmf/1.18wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
102 | 102 | Merged /trunk/phase3:r104441,104470 |