Index: trunk/extensions/Sternograph/Sternograph.body.php |
— | — | @@ -36,9 +36,8 @@ |
37 | 37 | /** |
38 | 38 | Core constructor. Sets the hooks to be used. |
39 | 39 | */ |
40 | | - function __construct(){ |
41 | | - global $wgParser; |
42 | | - $wgParser->setHook(Sternograph::TAG, array($this, 'parse')); |
| 40 | + function __construct($parser){ |
| 41 | + $parser->setHook(Sternograph::TAG, array($this, 'parse')); |
43 | 42 | } |
44 | 43 | //====METHODS |
45 | 44 | /** |
— | — | @@ -204,8 +203,8 @@ |
205 | 204 | /** |
206 | 205 | Returns the i18n'd error message. |
207 | 206 | */ |
208 | | - static private function error($key){ |
209 | | - return '<strong class="error">'.wfMsgNoTrans($key).'</strong>'; |
| 207 | + static private function error($key, $param = ''){ |
| 208 | + return '<strong class="error">' . htmlspecialchars( wfMsgForContent( $key, $param ) ) .'</strong>'; |
210 | 209 | } |
211 | 210 | |
212 | 211 | /** |
Index: trunk/extensions/Sternograph/Sternograph.i18n.php |
— | — | @@ -5,8 +5,8 @@ |
6 | 6 | $messages = array(); |
7 | 7 | |
8 | 8 | /** |
9 | | -Translation documentation. |
10 | | -*/ |
| 9 | + * Translation documentation. |
| 10 | + */ |
11 | 11 | $messages['qqq'] = array( |
12 | 12 | 'descriptionmsg'=>'Description of the Sternograph extension; displayed on the Special:Extensions page only.', |
13 | 13 | 'empty' => 'Error message when an empty <sterno> tag is detected on the wiki-formatted page.', |
— | — | @@ -24,13 +24,13 @@ |
25 | 25 | ); |
26 | 26 | |
27 | 27 | /** |
28 | | -English |
29 | | -*/ |
| 28 | + * English |
| 29 | + */ |
30 | 30 | $messages['en'] = array( |
31 | 31 | 'descriptionmsg'=>'<sterno> tags for transcripts of spokens words (plays, interviews, etc).', |
32 | | - 'empty' => '<sterno> tag cannot be empty.', |
33 | | - 'nested'=>'<sterno> tag cannot be nested.', |
34 | | - 'speakerIs' => '<sterno> speaker block lines must have '.Sternograph::SPEAKER_IS.' character.', |
| 32 | + 'empty' => '<sterno> tag cannot be empty.', |
| 33 | + 'nested'=>'<sterno> tag cannot be nested.', |
| 34 | + 'speakerIs' => '<sterno> speaker block lines must have $1 character.', |
35 | 35 | |
36 | 36 | 'speakerPre'=>'', |
37 | 37 | 'speakerPost'=>': ', |
Index: trunk/extensions/Sternograph/Sternograph.php |
— | — | @@ -12,8 +12,8 @@ |
13 | 13 | 'descriptionmsg' => 'descriptionmsg' |
14 | 14 | ); |
15 | 15 | |
16 | | -function efSternograph(){ |
17 | | - new Sternograph; |
| 16 | +function efSternograph(&$parser){ |
| 17 | + new Sternograph($parser); |
18 | 18 | return true; |
19 | 19 | } |
20 | 20 | |