Index: trunk/extensions/SemanticDrilldown/specials/SD_Filters.php |
— | — | @@ -14,13 +14,17 @@ |
15 | 15 | */ |
16 | 16 | function __construct() { |
17 | 17 | parent::__construct( 'Filters' ); |
18 | | - wfLoadExtensionMessages( 'SemanticDrilldown' ); |
| 18 | + // Backwards compatibility for MediaWiki < 1.16 |
| 19 | + if ( function_exists( 'wfLoadExtensionMessages' ) ) { |
| 20 | + wfLoadExtensionMessages( 'SemanticDrilldown' ); |
| 21 | + } |
19 | 22 | } |
20 | 23 | |
21 | 24 | function execute( $par ) { |
22 | 25 | $this->setHeaders(); |
23 | 26 | list( $limit, $offset ) = wfCheckLimits(); |
24 | 27 | $rep = new FiltersPage(); |
| 28 | + // Handling changed in MW version 1.18. |
25 | 29 | if ( method_exists( $rep, 'execute' ) ) { |
26 | 30 | return $rep->execute( $par ); |
27 | 31 | } else { |
— | — | @@ -31,6 +35,7 @@ |
32 | 36 | |
33 | 37 | class FiltersPage extends QueryPage { |
34 | 38 | function __construct( $name = 'Filters' ) { |
| 39 | + // Backwards compatibility for pre-version 1.18. |
35 | 40 | if ( $this instanceof SpecialPage ) { |
36 | 41 | parent::__construct( $name ); |
37 | 42 | } |
Index: trunk/extensions/SemanticDrilldown/specials/SD_CreateFilter.php |
— | — | @@ -15,7 +15,10 @@ |
16 | 16 | */ |
17 | 17 | public function SDCreateFilter() { |
18 | 18 | parent::__construct( 'CreateFilter' ); |
19 | | - wfLoadExtensionMessages( 'SemanticDrilldown' ); |
| 19 | + // Backwards compatibility for MediaWiki < 1.16 |
| 20 | + if ( function_exists( 'wfLoadExtensionMessages' ) ) { |
| 21 | + wfLoadExtensionMessages( 'SemanticDrilldown' ); |
| 22 | + } |
20 | 23 | } |
21 | 24 | |
22 | 25 | function execute( $par ) { |
Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php |
— | — | @@ -17,7 +17,10 @@ |
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | parent::__construct( 'BrowseData' ); |
21 | | - wfLoadExtensionMessages( 'SemanticDrilldown' ); |
| 21 | + // Backwards compatibility for MediaWiki < 1.16 |
| 22 | + if ( function_exists( 'wfLoadExtensionMessages' ) ) { |
| 23 | + wfLoadExtensionMessages( 'SemanticDrilldown' ); |
| 24 | + } |
22 | 25 | } |
23 | 26 | |
24 | 27 | function execute( $query ) { |
— | — | @@ -142,6 +145,7 @@ |
143 | 146 | |
144 | 147 | $wgOut->addHTML( "\n <div class=\"drilldown-results\">\n" ); |
145 | 148 | $rep = new SDBrowseDataPage( $category, $subcategory, $applied_filters, $remaining_filters ); |
| 149 | + // Handling changed in MW version 1.18. |
146 | 150 | if ( method_exists( $rep, 'execute' ) ) { |
147 | 151 | $num = $rep->execute( $query ); |
148 | 152 | } else { |
— | — | @@ -165,6 +169,7 @@ |
166 | 170 | * Initialize the variables of this page |
167 | 171 | */ |
168 | 172 | function __construct( $category, $subcategory, $applied_filters, $remaining_filters ) { |
| 173 | + // Backwards compatibility for pre-version 1.18 |
169 | 174 | if ( $this instanceof SpecialPage ) { |
170 | 175 | parent::__construct( 'BrowseData' ); |
171 | 176 | } |