Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php |
— | — | @@ -48,9 +48,11 @@ |
49 | 49 | return true; |
50 | 50 | } |
51 | 51 | |
52 | | - /* |
| 52 | + /** |
53 | 53 | * Hook function called with &match=lang |
54 | 54 | * Transform $text into a bilingual version |
| 55 | + * @param $parserOutput ParserOutput |
| 56 | + * @param $text |
55 | 57 | */ |
56 | 58 | function addMatchedText ( &$parserOutput , &$text ) { |
57 | 59 | |
— | — | @@ -105,7 +107,6 @@ |
106 | 108 | $text = $this->matchColumns ( $text, $myLanguage, $myURL, $wgContLanguageCode, |
107 | 109 | $translation, $languageName, $url, $match_request ); |
108 | 110 | } |
109 | | - return true; |
110 | 111 | } |
111 | 112 | } |
112 | 113 | return true; |
— | — | @@ -123,7 +124,7 @@ |
124 | 125 | $left_chunk = ''; |
125 | 126 | $right_chunk = ''; |
126 | 127 | |
127 | | - for ( $i=0 ; $i < count($left_slices) ; $i++ ) { |
| 128 | + for ( $i=0 ; $i < count( $left_slices ); $i++ ) { |
128 | 129 | |
129 | 130 | // some slices might be empty |
130 | 131 | if( $left_slices[$i] == '' ) { |
— | — | @@ -205,7 +206,7 @@ |
206 | 207 | preg_match_all( $this->tags, $text, $m, PREG_SET_ORDER); |
207 | 208 | $counter = 0; |
208 | 209 | $out = ''; |
209 | | - for($i=0; $i < count($m); $i++){ |
| 210 | + for( $i = 0; $i < count( $m ); $i++ ){ |
210 | 211 | $t = $m[$i][0]; |
211 | 212 | if( substr( $t, 0, 2) != "</" ) { |
212 | 213 | $counter++; |
— | — | @@ -213,12 +214,12 @@ |
214 | 215 | $counter--; |
215 | 216 | } |
216 | 217 | $out .= $bits[$i] . $t; |
217 | | - if( ($t == "</p>" || $t == "</dl>" ) && $counter==0 ) { |
| 218 | + if( ( $t == "</p>" || $t == "</dl>" ) && $counter == 0 ) { |
218 | 219 | $result[] = $out; |
219 | 220 | $out = ''; |
220 | 221 | } |
221 | 222 | } |
222 | | - if($out) { |
| 223 | + if( $out ) { |
223 | 224 | $result[] = $out; |
224 | 225 | } |
225 | 226 | return $result; |
— | — | @@ -239,7 +240,7 @@ |
240 | 241 | * Make slices that are full paragraphs |
241 | 242 | * If two slices correspond to the same paragraph, the second one will be empty |
242 | 243 | */ |
243 | | - for ( $i=0 ; $i < $n - 1 ; $i++ ) { |
| 244 | + for ( $i=0; $i < $n - 1; $i++ ) { |
244 | 245 | $str = $left_slices[$i]; |
245 | 246 | $m = array(); |
246 | 247 | if ( preg_match("/(.*)<(p|dl)>/is", $str, $m ) ) { |
— | — | @@ -256,7 +257,7 @@ |
257 | 258 | $stack = array(); |
258 | 259 | $opening = ''; |
259 | 260 | |
260 | | - for( $i=0 ; $i < $n ; $i++) { |
| 261 | + for( $i = 0; $i < $n; $i++ ) { |
261 | 262 | $m = array(); |
262 | 263 | preg_match_all( $this->tags, $left_slices[$i], $m, PREG_SET_ORDER); |
263 | 264 | $counter = 0; |
— | — | @@ -270,7 +271,7 @@ |
271 | 272 | $counter--; |
272 | 273 | } |
273 | 274 | } |
274 | | - if( $i==0 ) { |
| 275 | + if( $i == 0 ) { |
275 | 276 | $closure = ''; |
276 | 277 | for( $k=0; $k < $counter ; $k++ ) { |
277 | 278 | $opening .= "<".$stack[$k][1].">"; |