Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php |
— | — | @@ -15,10 +15,6 @@ |
16 | 16 | */ |
17 | 17 | public function __construct() { |
18 | 18 | parent::__construct( 'BrowseData' ); |
19 | | - // Backwards compatibility for MediaWiki < 1.16 |
20 | | - if ( version_compare( $GLOBALS['wgVersion'], '1.16', '<' ) ) { |
21 | | - wfLoadExtensionMessages( 'SemanticDrilldown' ); |
22 | | - } |
23 | 19 | } |
24 | 20 | |
25 | 21 | function execute( $query ) { |
— | — | @@ -601,8 +597,7 @@ |
602 | 598 | |
603 | 599 | /** |
604 | 600 | * Adds Javascript and CSS to the page for comboboxes, the long way. |
605 | | - * This method exists for backward compatibiity for MediaWiki 1.16 |
606 | | - * and earlier. |
| 601 | + * This method exists for backward compatibiity for MediaWiki 1.16. |
607 | 602 | */ |
608 | 603 | function addJavascriptAndCSS() { |
609 | 604 | global $smwgJQueryIncluded, $smwgJQueryUIIncluded, $sdgScriptPath, $wgOut; |
— | — | @@ -669,7 +664,7 @@ |
670 | 665 | foreach ( $filter_values as $value => $num_instances ) { |
671 | 666 | if ( $value != '_other' && $value != '_none' ) { |
672 | 667 | $display_value = str_replace( '_', ' ', $value ); |
673 | | - $text .= ' <option value="'.$display_value.'">'.$display_value.'</option>'; |
| 668 | + $text .= "\t\t" . Html::element( 'option', array( 'value' => $display_value ), $display_value ) . "\n"; |
674 | 669 | } |
675 | 670 | } |
676 | 671 | |
— | — | @@ -680,18 +675,12 @@ |
681 | 676 | END; |
682 | 677 | |
683 | 678 | foreach ( $wgRequest->getValues() as $key => $val ) { |
684 | | - if ( $key != $input_id ) |
685 | | - $text .= <<<END |
686 | | - <input type="hidden" name="$key" value="$val" /> |
687 | | - |
688 | | -END; |
| 679 | + if ( $key != $input_id ) { |
| 680 | + $text .= Html::hidden( $key, $val ) . "\n"; |
| 681 | + } |
689 | 682 | } |
690 | | - $search_label = wfMsg( 'searchresultshead' ); |
691 | | - $text .= <<<END |
692 | | - <input type="submit" value="$search_label" /> |
693 | | -</form> |
694 | | - |
695 | | -END; |
| 683 | + $text .= Html::input( null, wfMsg( 'searchresultshead' ), 'submit' ) . "\n"; |
| 684 | + $text .= "</form>\n"; |
696 | 685 | return $text; |
697 | 686 | } |
698 | 687 | |
— | — | @@ -744,17 +733,11 @@ |
745 | 734 | |
746 | 735 | END; |
747 | 736 | foreach ( $wgRequest->getValues() as $key => $val ) { |
748 | | - $text .= <<<END |
749 | | -<input type="hidden" name="$key" value="$val" /> |
750 | | - |
751 | | -END; |
| 737 | + $text .= Html::hidden( $key, $val ) . "\n"; |
752 | 738 | } |
753 | | - $search_label = wfMsg( 'searchresultshead' ); |
754 | | - $text .= <<<END |
755 | | -<p><input type="submit" value="$search_label" /></p> |
756 | | -</form> |
757 | | - |
758 | | -END; |
| 739 | + $submitButton = Html::input( null, wfMsg( 'searchresultshead' ), 'submit' ); |
| 740 | + $text .= Html::rawElement( 'p', null, $submitButton ) . "\n"; |
| 741 | + $text .= "</form>\n"; |
759 | 742 | return $text; |
760 | 743 | } |
761 | 744 | |
— | — | @@ -1114,12 +1097,7 @@ |
1115 | 1098 | global $wgParser; |
1116 | 1099 | SMWOutputs::commitToParser( $wgParser ); |
1117 | 1100 | if ( ! is_null( $wgParser->mOutput ) ) { |
1118 | | - // getHeadItems() was added in MW 1.16 |
1119 | | - if ( method_exists( $wgParser->getOutput(), 'getHeadItems' ) ) { |
1120 | | - $headItems = $wgParser->getOutput()->getHeadItems(); |
1121 | | - } else { |
1122 | | - $headItems = $wgParser->getOutput()->mHeadItems; |
1123 | | - } |
| 1101 | + $headItems = $wgParser->getOutput()->getHeadItems(); |
1124 | 1102 | foreach ( $headItems as $key => $item ) { |
1125 | 1103 | $out->addHeadItem( $key, $item ); |
1126 | 1104 | } |