Index: trunk/extensions/ApiSandbox/ApiSandbox.php |
— | — | @@ -3,8 +3,6 @@ |
4 | 4 | * API sandbox extension. Initial author Max Semenik, based on idea by Salil P. A. |
5 | 5 | * License: WTFPL 2.0 |
6 | 6 | */ |
7 | | - |
8 | | - |
9 | 7 | $wgExtensionCredits['other'][] = array( |
10 | 8 | 'path' => __FILE__, |
11 | 9 | 'name' => 'ApiSandbox', |
— | — | @@ -38,3 +36,26 @@ |
39 | 37 | 'parentheses', |
40 | 38 | ), |
41 | 39 | ); |
| 40 | + |
| 41 | +$wgHooks['APIGetDescription'][] = 'efASAPIGetDescription'; |
| 42 | + |
| 43 | +/** |
| 44 | + * @param $module ApiBase |
| 45 | + * @param $desc array |
| 46 | + * @return bool |
| 47 | + */ |
| 48 | +function efASAPIGetDescription( &$module, &$desc ) { |
| 49 | + if ( !$module instanceof ApiMain ) { |
| 50 | + return true; |
| 51 | + } |
| 52 | + |
| 53 | + $desc[] = 'The ApiSandbox extension is installed on this wiki, it adds a graphical interface to using the MediaWiki Api.'; |
| 54 | + $desc[] = 'It is helpful for new users, allowing request debugging without any extra tools.'; |
| 55 | + $desc[] = 'See index.php?title=Special:ApiSandbox'; |
| 56 | + |
| 57 | + // Append some more whitespace for ApiMain |
| 58 | + for ( $i = 0; $i < 3; $i++ ) { |
| 59 | + $desc[] = ''; |
| 60 | + } |
| 61 | + return true; |
| 62 | +} |