r100566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100565‎ | r100566 | r100567 >
Date:21:24, 23 October 2011
Author:platonides
Status:deferred
Tags:
Comment:
Give a bit of love to Sternograph
Modified paths:
  • /trunk/extensions/Sternograph/Sternograph.body.php (modified) (history)
  • /trunk/extensions/Sternograph/Sternograph.i18n.php (modified) (history)
  • /trunk/extensions/Sternograph/Sternograph.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Sternograph/Sternograph.body.php
@@ -36,9 +36,8 @@
3737 /**
3838 Core constructor. Sets the hooks to be used.
3939 */
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'));
4342 }
4443 //====METHODS
4544 /**
@@ -204,8 +203,8 @@
205204 /**
206205 Returns the i18n'd error message.
207206 */
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>';
210209 }
211210
212211 /**
Index: trunk/extensions/Sternograph/Sternograph.i18n.php
@@ -5,8 +5,8 @@
66 $messages = array();
77
88 /**
9 -Translation documentation.
10 -*/
 9+ * Translation documentation.
 10+ */
1111 $messages['qqq'] = array(
1212 'descriptionmsg'=>'Description of the Sternograph extension; displayed on the Special:Extensions page only.',
1313 'empty' => 'Error message when an empty &lt;sterno> tag is detected on the wiki-formatted page.',
@@ -24,13 +24,13 @@
2525 );
2626
2727 /**
28 -English
29 -*/
 28+ * English
 29+ */
3030 $messages['en'] = array(
3131 'descriptionmsg'=>'&lt;sterno> tags for transcripts of spokens words (plays, interviews, etc).',
32 - 'empty' => '&lt;sterno> tag cannot be empty.',
33 - 'nested'=>'&lt;sterno> tag cannot be nested.',
34 - 'speakerIs' => '&lt;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.',
3535
3636 'speakerPre'=>'',
3737 'speakerPost'=>':&nbsp;',
Index: trunk/extensions/Sternograph/Sternograph.php
@@ -12,8 +12,8 @@
1313 'descriptionmsg' => 'descriptionmsg'
1414 );
1515
16 -function efSternograph(){
17 - new Sternograph;
 16+function efSternograph(&$parser){
 17+ new Sternograph($parser);
1818 return true;
1919 }
2020

Status & tagging log