Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | ); |
67 | 67 | |
68 | 68 | class ExtMobileFrontend { |
69 | | - const VERSION = '0.5.48'; |
| 69 | + const VERSION = '0.5.49'; |
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @var DOMDocument |
— | — | @@ -522,18 +522,39 @@ |
523 | 523 | $backToTop = self::$messages['mobile-frontend-back-to-top-of-section']; |
524 | 524 | ++$headings; |
525 | 525 | // Back to top link |
526 | | - $base = "<div class='section_anchors' id='anchor_" . intval( $headings - 1 ) . |
527 | | - "'><a href='#section_" . intval( $headings - 1 ) . |
528 | | - "' class='back_to_top'>↑ {$backToTop}</a></div>"; |
| 526 | + $base = Html::openElement( 'div', |
| 527 | + array( 'id' => 'anchor_' . intval( $headings - 1 ), |
| 528 | + 'class' => 'section_anchors', ) |
| 529 | + ) . |
| 530 | + Html::rawElement( 'a', |
| 531 | + array( 'href' => '#section_' . intval( $headings - 1 ), |
| 532 | + 'class' => 'back_to_top' ), |
| 533 | + '↑' . $backToTop ) . |
| 534 | + Html::closeElement( 'div' ); |
529 | 535 | // generate the HTML we are going to inject |
530 | | - $buttons = "<button class='section_heading show' section_id='{$headings}'>{$show}</button>" . |
531 | | - "<button class='section_heading hide' section_id='{$headings}'>{$hide}</button>"; |
532 | | - $base .= "<h2 class='section_heading' id='section_{$headings}'{$matches[1]}{$buttons} <span id='{$headlineId}'>" . |
533 | | - "{$matches[2]}</span></h2><div class='content_block' id='content_{$headings}'>"; |
| 536 | + $buttons = Html::element( 'button', |
| 537 | + array('class' => 'section_heading show', |
| 538 | + 'section_id' => $headings ), |
| 539 | + $show ) . |
| 540 | + Html::element( 'button', |
| 541 | + array('class' => 'section_heading hide', |
| 542 | + 'section_id' => $headings ), |
| 543 | + $hide ); |
| 544 | + $base .= Html::openElement( 'h2', |
| 545 | + array('class' => 'section_heading', |
| 546 | + 'id' => 'section_' . $headings) ) . |
| 547 | + $buttons . |
| 548 | + Html::element( 'span', |
| 549 | + array( 'id' => $headlineId), |
| 550 | + $matches[2] ) . |
| 551 | + Html::closeElement( 'h2' ) . |
| 552 | + Html::openElement( 'div', |
| 553 | + array('class' => 'content_block', |
| 554 | + 'id' => 'content_' . $headings) ); |
534 | 555 | |
535 | 556 | if ( $headings > 1 ) { |
536 | 557 | // Close it up here |
537 | | - $base = '</div>' . $base; |
| 558 | + $base = Html::closeElement( 'div' ) . $base; |
538 | 559 | } |
539 | 560 | |
540 | 561 | self::$headings = $headings; |