Index: trunk/extensions/MobileFrontend/MobileFormatter.php |
— | — | @@ -276,13 +276,11 @@ |
277 | 277 | */ |
278 | 278 | private function headingTransformCallbackWML( $matches ) { |
279 | 279 | wfProfileIn( __METHOD__ ); |
280 | | - static $headings = 0; |
281 | | - ++$headings; |
| 280 | + $this->headings++; |
282 | 281 | |
283 | 282 | $base = self::WML_SECTION_SEPARATOR . |
284 | | - "<h2 class='section_heading' id='section_{$headings}'>{$matches[2]}</h2>"; |
| 283 | + "<h2 class='section_heading' id='section_{$this->headings}'>{$this->matches[2]}</h2>"; |
285 | 284 | |
286 | | - $this->headings = $headings; |
287 | 285 | wfProfileOut( __METHOD__ ); |
288 | 286 | return $base; |
289 | 287 | } |
— | — | @@ -299,40 +297,39 @@ |
300 | 298 | |
301 | 299 | $headlineId = ( isset( $headlineMatches[1] ) ) ? $headlineMatches[1] : ''; |
302 | 300 | |
303 | | - static $headings = 0; |
304 | 301 | $show = $this->msg( 'mobile-frontend-show-button' ); |
305 | 302 | $hide = $this->msg( 'mobile-frontend-hide-button' ); |
306 | 303 | $backToTop = $this->msg( 'mobile-frontend-back-to-top-of-section' ); |
307 | | - ++$headings; |
| 304 | + $this->headings++; |
308 | 305 | // Back to top link |
309 | 306 | $base = Html::openElement( 'div', |
310 | | - array( 'id' => 'anchor_' . intval( $headings - 1 ), |
| 307 | + array( 'id' => 'anchor_' . intval( $this->headings - 1 ), |
311 | 308 | 'class' => 'section_anchors', ) |
312 | 309 | ) . |
313 | 310 | Html::rawElement( 'a', |
314 | | - array( 'href' => '#section_' . intval( $headings - 1 ), |
| 311 | + array( 'href' => '#section_' . intval( $this->headings - 1 ), |
315 | 312 | 'class' => 'back_to_top' ), |
316 | 313 | '↑' . $backToTop ) . |
317 | 314 | Html::closeElement( 'div' ); |
318 | 315 | // generate the HTML we are going to inject |
319 | 316 | $buttons = Html::element( 'button', |
320 | 317 | array( 'class' => 'section_heading show', |
321 | | - 'section_id' => $headings ), |
| 318 | + 'section_id' => $this->headings ), |
322 | 319 | $show ) . |
323 | 320 | Html::element( 'button', |
324 | 321 | array( 'class' => 'section_heading hide', |
325 | | - 'section_id' => $headings ), |
| 322 | + 'section_id' => $this->headings ), |
326 | 323 | $hide ); |
327 | 324 | if ( $this->expandableSections ) { |
328 | | - $h2OnClick = 'javascript:wm_toggle_section(' . $headings . ');'; |
| 325 | + $h2OnClick = 'javascript:wm_toggle_section(' . $this->headings . ');'; |
329 | 326 | $base .= Html::openElement( 'h2', |
330 | 327 | array( 'class' => 'section_heading', |
331 | | - 'id' => 'section_' . $headings, |
| 328 | + 'id' => 'section_' . $this->headings, |
332 | 329 | 'onclick' => $h2OnClick ) ); |
333 | 330 | } else { |
334 | 331 | $base .= Html::openElement( 'h2', |
335 | 332 | array( 'class' => 'section_heading', |
336 | | - 'id' => 'section_' . $headings ) ); |
| 333 | + 'id' => 'section_' . $this->headings ) ); |
337 | 334 | } |
338 | 335 | $base .= $buttons . |
339 | 336 | Html::rawElement( 'span', |
— | — | @@ -341,14 +338,13 @@ |
342 | 339 | Html::closeElement( 'h2' ) . |
343 | 340 | Html::openElement( 'div', |
344 | 341 | array( 'class' => 'content_block', |
345 | | - 'id' => 'content_' . $headings ) ); |
| 342 | + 'id' => 'content_' . $this->headings ) ); |
346 | 343 | |
347 | | - if ( $headings > 1 ) { |
| 344 | + if ( $this->headings > 1 ) { |
348 | 345 | // Close it up here |
349 | 346 | $base = Html::closeElement( 'div' ) . $base; |
350 | 347 | } |
351 | 348 | |
352 | | - $this->headings = $headings; |
353 | 349 | wfProfileOut( __METHOD__ ); |
354 | 350 | return $base; |
355 | 351 | } |