Index: trunk/extensions/LabeledSectionTransclusion/lsth.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | if ( ! defined( 'MEDIAWIKI' ) ) |
4 | 4 | die(); |
5 | 5 | |
6 | | -/**#@+ |
| 6 | +/**#@+ |
7 | 7 | * |
8 | 8 | * A parser extension that further extends labeled section transclusion, |
9 | 9 | * adding a function, #lsth for transcluding marked sections of text, |
— | — | @@ -23,15 +23,15 @@ |
24 | 24 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
25 | 25 | */ |
26 | 26 | |
27 | | -## |
| 27 | +# # |
28 | 28 | # Standard initialisation code |
29 | | -## |
| 29 | +# # |
30 | 30 | |
31 | | -$wgExtensionFunctions[]="wfLabeledSectionTransclusionHeading"; |
| 31 | +$wgExtensionFunctions[] = "wfLabeledSectionTransclusionHeading"; |
32 | 32 | $wgHooks['LanguageGetMagic'][] = 'wfLabeledSectionTransclusionHeadingMagic'; |
33 | 33 | $wgParserTestFiles[] = dirname( __FILE__ ) . "/lsthParserTests.txt"; |
34 | 34 | |
35 | | -function wfLabeledSectionTransclusionHeading() |
| 35 | +function wfLabeledSectionTransclusionHeading() |
36 | 36 | { |
37 | 37 | global $wgParser; |
38 | 38 | $wgParser->setFunctionHook( 'lsth', 'wfLstIncludeHeading' ); |
— | — | @@ -43,66 +43,66 @@ |
44 | 44 | return true; |
45 | 45 | } |
46 | 46 | |
47 | | -///section inclusion - include all matching sections |
48 | | -function wfLstIncludeHeading($parser, $page='', $sec='', $to='') |
| 47 | +/// section inclusion - include all matching sections |
| 48 | +function wfLstIncludeHeading( $parser, $page = '', $sec = '', $to = '' ) |
49 | 49 | { |
50 | | - if (LabeledSectionTransclusion::getTemplateText_($parser, $page, $title, $text) == false) |
| 50 | + if ( LabeledSectionTransclusion::getTemplateText_( $parser, $page, $title, $text ) == false ) |
51 | 51 | return $text; |
52 | 52 | |
53 | | - //Generate a regex to match the === classical heading section(s) === we're |
54 | | - //interested in. |
55 | | - if ($sec == '') { |
| 53 | + // Generate a regex to match the === classical heading section(s) === we're |
| 54 | + // interested in. |
| 55 | + if ( $sec == '' ) { |
56 | 56 | $begin_off = 0; |
57 | 57 | $head_len = 6; |
58 | 58 | } else { |
59 | | - $pat = '^(={1,6})\s*' . preg_quote($sec, '/') . '\s*\1\s*($)' ; |
60 | | - if ( preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE) ) { |
| 59 | + $pat = '^(={1,6})\s*' . preg_quote( $sec, '/' ) . '\s*\1\s*($)' ; |
| 60 | + if ( preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE ) ) { |
61 | 61 | $begin_off = $m[2][1]; |
62 | | - $head_len = strlen($m[1][0]); |
63 | | - //wfDebug( "LSTH: offset is $begin_off" ); |
| 62 | + $head_len = strlen( $m[1][0] ); |
| 63 | + // wfDebug( "LSTH: offset is $begin_off" ); |
64 | 64 | } else { |
65 | | - //wfDebug( "LSTH: match failed: '$pat'" ); |
| 65 | + // wfDebug( "LSTH: match failed: '$pat'" ); |
66 | 66 | return ''; |
67 | 67 | } |
68 | | - |
| 68 | + |
69 | 69 | } |
70 | 70 | |
71 | | - if ($to != '') { |
72 | | - //if $to is supplied, try and match it. If we don't match, just |
73 | | - //ignore it. |
74 | | - $pat = '^(={1,6})\s*' . preg_quote($to, '/') . '\s*\1\s*$'; |
75 | | - if (preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE, $begin_off)) |
76 | | - $end_off = $m[0][1]-1; |
| 71 | + if ( $to != '' ) { |
| 72 | + // if $to is supplied, try and match it. If we don't match, just |
| 73 | + // ignore it. |
| 74 | + $pat = '^(={1,6})\s*' . preg_quote( $to, '/' ) . '\s*\1\s*$'; |
| 75 | + if ( preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE, $begin_off ) ) |
| 76 | + $end_off = $m[0][1] -1; |
77 | 77 | } |
78 | 78 | |
79 | 79 | |
80 | | - if (! isset($end_off)) { |
81 | | - $pat = '^(={1,'.$head_len.'})(?!=).*?\1\s*$'; |
82 | | - if (preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE, $begin_off)) |
83 | | - $end_off = $m[0][1]-1; |
84 | | - else |
85 | | - wfDebug("LSTH: fail end match: '$pat'"); |
| 80 | + if ( ! isset( $end_off ) ) { |
| 81 | + $pat = '^(={1,' . $head_len . '})(?!=).*?\1\s*$'; |
| 82 | + if ( preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE, $begin_off ) ) |
| 83 | + $end_off = $m[0][1] -1; |
| 84 | + else |
| 85 | + wfDebug( "LSTH: fail end match: '$pat'" ); |
86 | 86 | |
87 | | - //wfDebug("LSTH:head len is $head_len, pat is $pat, head is '.$m[1][0]'"; |
88 | | - } |
| 87 | + // wfDebug("LSTH:head len is $head_len, pat is $pat, head is '.$m[1][0]'"; |
| 88 | + } |
89 | 89 | |
90 | | - $nhead = LabeledSectionTransclusion::countHeadings_($text, $begin_off); |
| 90 | + $nhead = LabeledSectionTransclusion::countHeadings_( $text, $begin_off ); |
91 | 91 | wfDebug( "LSTH: head offset = $nhead" ); |
92 | 92 | |
93 | | - if (isset($end_off)) |
94 | | - $result = substr($text, $begin_off, $end_off - $begin_off); |
| 93 | + if ( isset( $end_off ) ) |
| 94 | + $result = substr( $text, $begin_off, $end_off - $begin_off ); |
95 | 95 | else |
96 | | - $result = substr($text, $begin_off); |
97 | | - |
| 96 | + $result = substr( $text, $begin_off ); |
98 | 97 | |
99 | | - if (method_exists($parser,'getPreprocessor')) |
| 98 | + |
| 99 | + if ( method_exists( $parser, 'getPreprocessor' ) ) |
100 | 100 | { |
101 | 101 | $frame = $parser->getPreprocessor()->newFrame(); |
102 | 102 | $dom = $parser->preprocessToDom( $result ); |
103 | 103 | $result = $frame->expand( $dom ); |
104 | 104 | } |
105 | | - |
106 | 105 | |
107 | | - return LabeledSectionTransclusion::parse_($parser,$title,$result, "#lsth:${page}|${sec}", $nhead); |
| 106 | + |
| 107 | + return LabeledSectionTransclusion::parse_( $parser, $title, $result, "#lsth:${page}|${sec}", $nhead ); |
108 | 108 | } |
109 | 109 | |
Index: trunk/extensions/LabeledSectionTransclusion/lst.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | if ( ! defined( 'MEDIAWIKI' ) ) |
4 | 4 | die(); |
5 | 5 | /**#@+ |
6 | | - * A parser extension that adds two functions, #lst and #lstx, and the |
| 6 | + * A parser extension that adds two functions, #lst and #lstx, and the |
7 | 7 | * <section> tag, for transcluding marked sections of text. |
8 | 8 | * |
9 | 9 | * @file |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | 'descriptionmsg' => 'lst-desc', |
34 | 34 | ); |
35 | 35 | $wgParserTestFiles[] = dirname( __FILE__ ) . "/lstParserTests.txt"; |
36 | | -$wgExtensionMessagesFiles['LabeledSectionTransclusion'] = dirname(__FILE__) . '/lst.i18n.php'; |
| 36 | +$wgExtensionMessagesFiles['LabeledSectionTransclusion'] = dirname( __FILE__ ) . '/lst.i18n.php'; |
37 | 37 | |
38 | 38 | // Local settings variable |
39 | 39 | // Must be set now to avoid injection via register_globals |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | | - /// Add the magic words - possibly with more readable aliases |
| 56 | + // / Add the magic words - possibly with more readable aliases |
57 | 57 | static function setupMagic( &$magicWords, $langCode ) { |
58 | 58 | global $wgParser, $wgLstLocal; |
59 | 59 | |
— | — | @@ -60,21 +60,21 @@ |
61 | 61 | case 'de': |
62 | 62 | $include = 'Abschnitt'; |
63 | 63 | $exclude = 'Abschnitt-x'; |
64 | | - $wgLstLocal = array( 'section' => 'Abschnitt', 'begin' => 'Anfang', 'end' => 'Ende') ; |
| 64 | + $wgLstLocal = array( 'section' => 'Abschnitt', 'begin' => 'Anfang', 'end' => 'Ende' ) ; |
65 | 65 | break; |
66 | 66 | case 'he': |
67 | 67 | $include = 'קטע'; |
68 | 68 | $exclude = 'בלי קטע'; |
69 | | - $wgLstLocal = array( 'section' => 'קטע', 'begin' => 'התחלה', 'end' => 'סוף') ; |
| 69 | + $wgLstLocal = array( 'section' => 'קטע', 'begin' => 'התחלה', 'end' => 'סוף' ) ; |
70 | 70 | break; |
71 | 71 | case 'pt': |
72 | 72 | $include = 'trecho'; |
73 | 73 | $exclude = 'trecho-x'; |
74 | | - $wgLstLocal = array( 'section' => 'trecho', 'begin' => 'começo', 'end' => 'fim'); |
| 74 | + $wgLstLocal = array( 'section' => 'trecho', 'begin' => 'começo', 'end' => 'fim' ); |
75 | 75 | break; |
76 | 76 | } |
77 | | - |
78 | | - if( isset( $include ) ) { |
| 77 | + |
| 78 | + if ( isset( $include ) ) { |
79 | 79 | $magicWords['lst'] = array( 0, 'lst', 'section', $include ); |
80 | 80 | $magicWords['lstx'] = array( 0, 'lstx', 'section-x', $exclude ); |
81 | 81 | $wgParser->setHook( $include, array( __CLASS__, 'noop' ) ); |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | $magicWords['lst'] = array( 0, 'lst', 'section' ); |
84 | 84 | $magicWords['lstx'] = array( 0, 'lstx', 'section-x' ); |
85 | 85 | } |
86 | | - |
| 86 | + |
87 | 87 | return true; |
88 | 88 | } |
89 | 89 | |
— | — | @@ -91,28 +91,28 @@ |
92 | 92 | # at a low level. This is the general transclusion functionality |
93 | 93 | ############################################################## |
94 | 94 | |
95 | | - ///Register what we're working on in the parser, so we don't fall into a trap. |
96 | | - static function open_($parser, $part1) |
| 95 | + /// Register what we're working on in the parser, so we don't fall into a trap. |
| 96 | + static function open_( $parser, $part1 ) |
97 | 97 | { |
98 | 98 | // Infinite loop test |
99 | 99 | if ( isset( $parser->mTemplatePath[$part1] ) ) { |
100 | | - wfDebug( __METHOD__.": template loop broken at '$part1'\n" ); |
| 100 | + wfDebug( __METHOD__ . ": template loop broken at '$part1'\n" ); |
101 | 101 | return false; |
102 | 102 | } else { |
103 | 103 | $parser->mTemplatePath[$part1] = 1; |
104 | 104 | return true; |
105 | 105 | } |
106 | | - |
| 106 | + |
107 | 107 | } |
108 | 108 | |
109 | | - ///Finish processing the function. |
110 | | - static function close_($parser, $part1) |
| 109 | + /// Finish processing the function. |
| 110 | + static function close_( $parser, $part1 ) |
111 | 111 | { |
112 | 112 | // Infinite loop test |
113 | 113 | if ( isset( $parser->mTemplatePath[$part1] ) ) { |
114 | 114 | unset( $parser->mTemplatePath[$part1] ); |
115 | 115 | } else { |
116 | | - wfDebug( __METHOD__.": close unopened template loop at '$part1'\n" ); |
| 116 | + wfDebug( __METHOD__ . ": close unopened template loop at '$part1'\n" ); |
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
— | — | @@ -128,21 +128,21 @@ |
129 | 129 | * @todo handle mixed-case </section> |
130 | 130 | * @private |
131 | 131 | */ |
132 | | - static function parse_($parser, $title, $text, $part1, $skiphead=0) |
| 132 | + static function parse_( $parser, $title, $text, $part1, $skiphead = 0 ) |
133 | 133 | { |
134 | 134 | // if someone tries something like<section begin=blah>lst only</section> |
135 | 135 | // text, may as well do the right thing. |
136 | | - $text = str_replace('</section>', '', $text); |
| 136 | + $text = str_replace( '</section>', '', $text ); |
137 | 137 | |
138 | | - if (self::open_($parser, $part1)) { |
139 | | - //Try to get edit sections correct by munging around the parser's guts. |
140 | | - return array($text, 'title'=>$title, 'replaceHeadings'=>true, |
141 | | - 'headingOffset'=>$skiphead, 'noparse'=>false, 'noargs'=>false); |
| 138 | + if ( self::open_( $parser, $part1 ) ) { |
| 139 | + // Try to get edit sections correct by munging around the parser's guts. |
| 140 | + return array( $text, 'title' => $title, 'replaceHeadings' => true, |
| 141 | + 'headingOffset' => $skiphead, 'noparse' => false, 'noargs' => false ); |
142 | 142 | } else { |
143 | | - return "[[" . $title->getPrefixedText() . "]]". |
| 143 | + return "[[" . $title->getPrefixedText() . "]]" . |
144 | 144 | "<!-- WARNING: LST loop detected -->"; |
145 | 145 | } |
146 | | - |
| 146 | + |
147 | 147 | } |
148 | 148 | |
149 | 149 | ############################################################## |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | * @param Parser $parser |
160 | 160 | * @return string HTML output |
161 | 161 | */ |
162 | | - static function noop( $in, $assocArgs=array(), $parser=null ) { |
| 162 | + static function noop( $in, $assocArgs = array(), $parser = null ) { |
163 | 163 | return ''; |
164 | 164 | } |
165 | 165 | |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | * @return string regex |
173 | 173 | * @private |
174 | 174 | */ |
175 | | - static function getPattern_($sec, $to) |
| 175 | + static function getPattern_( $sec, $to ) |
176 | 176 | { |
177 | 177 | global $wgLstLocal; |
178 | 178 | |
— | — | @@ -182,15 +182,15 @@ |
183 | 183 | $endAttr = self::getAttrPattern_( $to, 'end' ); |
184 | 184 | } |
185 | 185 | |
186 | | - $to_sec = ($to == '')?$sec : $to; |
187 | | - $sec = preg_quote($sec, '/'); |
188 | | - $to_sec = preg_quote($to_sec, '/'); |
189 | | - if (isset($wgLstLocal)){ |
| 186 | + $to_sec = ( $to == '' ) ? $sec : $to; |
| 187 | + $sec = preg_quote( $sec, '/' ); |
| 188 | + $to_sec = preg_quote( $to_sec, '/' ); |
| 189 | + if ( isset( $wgLstLocal ) ) { |
190 | 190 | $section_re = "(?i:section|$wgLstLocal[section])"; |
191 | 191 | } else { |
192 | 192 | $section_re = "(?i:section)"; |
193 | 193 | } |
194 | | - |
| 194 | + |
195 | 195 | return "/<$section_re$beginAttr\/?>(.*?)\n?<$section_re$endAttr\/?>/s"; |
196 | 196 | } |
197 | 197 | |
— | — | @@ -201,9 +201,9 @@ |
202 | 202 | */ |
203 | 203 | static function getAttrPattern_( $sec, $type ) { |
204 | 204 | global $wgLstLocal; |
205 | | - $sec = preg_quote($sec, '/'); |
206 | | - $ws = "(?:\s+[^>]*)?"; //was like $ws="\s*" |
207 | | - if (isset($wgLstLocal)){ |
| 205 | + $sec = preg_quote( $sec, '/' ); |
| 206 | + $ws = "(?:\s+[^>]*)?"; // was like $ws="\s*" |
| 207 | + if ( isset( $wgLstLocal ) ) { |
208 | 208 | if ( $type == 'begin' ) { |
209 | 209 | $attrName = "(?i:begin|{$wgLstLocal['begin']})"; |
210 | 210 | } else { |
— | — | @@ -230,16 +230,16 @@ |
231 | 231 | * @return int Number of matches |
232 | 232 | * @private |
233 | 233 | */ |
234 | | - static function countHeadings_($text,$limit) |
| 234 | + static function countHeadings_( $text, $limit ) |
235 | 235 | { |
236 | 236 | $pat = '^(={1,6}).+\1\s*$()'; |
237 | | - |
238 | | - //return preg_match_all( "/$pat/im", substr($text,0,$limit), $m); |
239 | 237 | |
| 238 | + // return preg_match_all( "/$pat/im", substr($text,0,$limit), $m); |
| 239 | + |
240 | 240 | $count = 0; |
241 | 241 | $offset = 0; |
242 | | - while (preg_match("/$pat/im", $text, $m, PREG_OFFSET_CAPTURE, $offset)) { |
243 | | - if ($m[2][1] > $limit) |
| 242 | + while ( preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE, $offset ) ) { |
| 243 | + if ( $m[2][1] > $limit ) |
244 | 244 | break; |
245 | 245 | |
246 | 246 | $count++; |
— | — | @@ -260,23 +260,23 @@ |
261 | 261 | * @return string bool true if returning text, false if target not found |
262 | 262 | * @private |
263 | 263 | */ |
264 | | - static function getTemplateText_($parser, $page, &$title, &$text) |
| 264 | + static function getTemplateText_( $parser, $page, &$title, &$text ) |
265 | 265 | { |
266 | | - $title = Title::newFromText($page); |
267 | | - |
268 | | - if (is_null($title) ) { |
| 266 | + $title = Title::newFromText( $page ); |
| 267 | + |
| 268 | + if ( is_null( $title ) ) { |
269 | 269 | $text = ''; |
270 | 270 | return true; |
271 | 271 | } else { |
272 | | - if (method_exists($parser, 'fetchTemplateAndTitle')) { |
273 | | - list($text,$title) = $parser->fetchTemplateAndTitle($title); |
| 272 | + if ( method_exists( $parser, 'fetchTemplateAndTitle' ) ) { |
| 273 | + list( $text, $title ) = $parser->fetchTemplateAndTitle( $title ); |
274 | 274 | } else { |
275 | | - $text = $parser->fetchTemplate($title); |
| 275 | + $text = $parser->fetchTemplate( $title ); |
276 | 276 | } |
277 | 277 | } |
278 | | - |
279 | | - //if article doesn't exist, return a red link. |
280 | | - if ($text == false) { |
| 278 | + |
| 279 | + // if article doesn't exist, return a red link. |
| 280 | + if ( $text == false ) { |
281 | 281 | $text = "[[" . $title->getPrefixedText() . "]]"; |
282 | 282 | return false; |
283 | 283 | } else { |
— | — | @@ -294,25 +294,25 @@ |
295 | 295 | * @param string $to Optional named section to end at |
296 | 296 | * @return mixed wikitext output |
297 | 297 | */ |
298 | | - function pfuncInclude($parser, $page='', $sec='', $to='') |
| 298 | + function pfuncInclude( $parser, $page = '', $sec = '', $to = '' ) |
299 | 299 | { |
300 | | - if (self::getTemplateText_($parser, $page, $title, $text) == false) |
| 300 | + if ( self::getTemplateText_( $parser, $page, $title, $text ) == false ) |
301 | 301 | return $text; |
302 | | - $pat = self::getPattern_($sec,$to); |
| 302 | + $pat = self::getPattern_( $sec, $to ); |
303 | 303 | |
304 | | - if(preg_match_all( $pat, $text, $m, PREG_OFFSET_CAPTURE)) { |
305 | | - $headings = self::countHeadings_($text, $m[0][0][1]); |
| 304 | + if ( preg_match_all( $pat, $text, $m, PREG_OFFSET_CAPTURE ) ) { |
| 305 | + $headings = self::countHeadings_( $text, $m[0][0][1] ); |
306 | 306 | } else { |
307 | 307 | $headings = 0; |
308 | 308 | } |
309 | | - |
| 309 | + |
310 | 310 | $text = ''; |
311 | | - foreach ($m[1] as $piece) { |
| 311 | + foreach ( $m[1] as $piece ) { |
312 | 312 | $text .= $piece[0]; |
313 | 313 | } |
314 | 314 | |
315 | | - //wfDebug(__METHOD__.": skip $headings headings"); |
316 | | - return self::parse_($parser,$title,$text, "#lst:${page}|${sec}", $headings); |
| 315 | + // wfDebug(__METHOD__.": skip $headings headings"); |
| 316 | + return self::parse_( $parser, $title, $text, "#lst:${page}|${sec}", $headings ); |
317 | 317 | } |
318 | 318 | |
319 | 319 | /** |
— | — | @@ -328,14 +328,14 @@ |
329 | 329 | return ''; |
330 | 330 | } |
331 | 331 | if ( !$frame->loopCheck( $title ) ) { |
332 | | - return "[[" . $title->getPrefixedText() . "]]". |
| 332 | + return "[[" . $title->getPrefixedText() . "]]" . |
333 | 333 | "<!-- WARNING: LST loop detected -->"; |
334 | 334 | } |
335 | 335 | |
336 | 336 | list( $root, $finalTitle ) = $parser->getTemplateDom( $title ); |
337 | 337 | |
338 | 338 | // if article doesn't exist, return a red link. |
339 | | - if ($root === false) { |
| 339 | + if ( $root === false ) { |
340 | 340 | return "[[" . $title->getPrefixedText() . "]]"; |
341 | 341 | } |
342 | 342 | |
— | — | @@ -368,13 +368,13 @@ |
369 | 369 | return compact( 'dom', 'root', 'newFrame', 'repl', 'beginRegex', 'endRegex' ); |
370 | 370 | } |
371 | 371 | |
372 | | - /** |
| 372 | + /** |
373 | 373 | * Returns true if the given extension name is "section" |
374 | 374 | */ |
375 | 375 | static function isSection( $name ) { |
376 | 376 | global $wgLstLocal; |
377 | 377 | $name = strtolower( $name ); |
378 | | - return $name == 'section' |
| 378 | + return $name == 'section' |
379 | 379 | || ( isset( $wgLstLocal['section'] ) && strtolower( $wgLstLocal['section'] ) == $name ); |
380 | 380 | } |
381 | 381 | |
— | — | @@ -459,13 +459,13 @@ |
460 | 460 | * @param string $to Optional named section to end at |
461 | 461 | * @return mixed wikitext output |
462 | 462 | */ |
463 | | - static function pfuncExclude($parser, $page='', $sec='', $repl='',$to='') |
| 463 | + static function pfuncExclude( $parser, $page = '', $sec = '', $repl = '', $to = '' ) |
464 | 464 | { |
465 | | - if (self::getTemplateText_($parser, $page, $title, $text) == false) |
| 465 | + if ( self::getTemplateText_( $parser, $page, $title, $text ) == false ) |
466 | 466 | return $text; |
467 | | - $pat = self::getPattern_($sec,$to); |
468 | | - $text = preg_replace( $pat, $repl, $text); |
469 | | - return self::parse_($parser,$title,$text, "#lstx:$page|$sec"); |
| 467 | + $pat = self::getPattern_( $sec, $to ); |
| 468 | + $text = preg_replace( $pat, $repl, $text ); |
| 469 | + return self::parse_( $parser, $title, $text, "#lstx:$page|$sec" ); |
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
Index: trunk/extensions/LabeledSectionTransclusion/compat.php |
— | — | @@ -9,20 +9,20 @@ |
10 | 10 | |
11 | 11 | **/ |
12 | 12 | |
13 | | -///Fetch the page to be transcluded from the database. |
14 | | -function wfLst_fetch_($parser, $page, $ns = NS_MAIN) |
| 13 | +/// Fetch the page to be transcluded from the database. |
| 14 | +function wfLst_fetch_( $parser, $page, $ns = NS_MAIN ) |
15 | 15 | { |
16 | | - $title = Title::newFromText($page,$ns); |
| 16 | + $title = Title::newFromText( $page, $ns ); |
17 | 17 | if ( !is_null( $title ) ) { |
18 | | - $text = $parser->fetchTemplate($title); |
| 18 | + $text = $parser->fetchTemplate( $title ); |
19 | 19 | } |
20 | 20 | return $text; |
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | | -function wfLstIncludeHeading2($parser, $page='', $sec='', $to='') |
| 24 | +function wfLstIncludeHeading2( $parser, $page = '', $sec = '', $to = '' ) |
25 | 25 | { |
26 | | - return wfLstIncludeHeading($parser, $page, $sec, $to); |
| 26 | + return wfLstIncludeHeading( $parser, $page, $sec, $to ); |
27 | 27 | } |
28 | 28 | |
29 | 29 | |