Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -498,9 +498,9 @@ |
499 | 499 | * @return string |
500 | 500 | */ |
501 | 501 | protected function getInputForm( $printoutstring, $urltail ) { |
502 | | - global $wgUser, $smwgQSortingSupport, $smwgResultFormats; |
| 502 | + global $smwgQSortingSupport, $smwgResultFormats; |
503 | 503 | |
504 | | - $skin = $wgUser->getSkin(); |
| 504 | + $skin = $this->getSkin(); |
505 | 505 | $result = ''; |
506 | 506 | |
507 | 507 | if ( $this->m_editquery ) { |
— | — | @@ -643,9 +643,9 @@ |
644 | 644 | * @return string |
645 | 645 | */ |
646 | 646 | protected function getNavigationBar( SMWQueryResult $res, $urltail ) { |
647 | | - global $wgUser, $smwgQMaxInlineLimit; |
| 647 | + global $smwgQMaxInlineLimit; |
648 | 648 | |
649 | | - $skin = $wgUser->getSkin(); |
| 649 | + $skin = $this->getSkin(); |
650 | 650 | $offset = $this->m_params['offset']; |
651 | 651 | $limit = $this->m_params['limit']; |
652 | 652 | |
— | — | @@ -813,4 +813,21 @@ |
814 | 814 | return $input->getHtml(); |
815 | 815 | } |
816 | 816 | |
| 817 | + /** |
| 818 | + * Compatibility method to get the skin; MW 1.18 introduces a getSkin method in SpecialPage. |
| 819 | + * |
| 820 | + * @since 1.6 |
| 821 | + * |
| 822 | + * @return Skin |
| 823 | + */ |
| 824 | + public function getSkin() { |
| 825 | + if ( method_exists( 'SpecialPage', 'getSkin' ) ) { |
| 826 | + return parent::getSkin(); |
| 827 | + } |
| 828 | + else { |
| 829 | + global $wgUser; |
| 830 | + return $wgUser->getSkin(); |
| 831 | + } |
| 832 | + } |
| 833 | + |
817 | 834 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_QueryPage.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | * @param $shownavigation show navigation like "next 200"? |
42 | 42 | */ |
43 | 43 | function doQuery( $offset, $limit, $shownavigation = true ) { |
44 | | - global $wgUser, $wgOut, $wgContLang; |
| 44 | + global $wgOut, $wgContLang; |
45 | 45 | |
46 | 46 | $options = new SMWRequestOptions(); |
47 | 47 | $options->limit = $limit; |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $res = $this->getResults( $options ); |
51 | 51 | $num = count( $res ); |
52 | 52 | |
53 | | - $sk = $wgUser->getSkin(); |
| 53 | + $sk = $this->getSkin(); |
54 | 54 | $sname = $this->getName(); |
55 | 55 | |
56 | 56 | if ( $shownavigation ) { |
— | — | @@ -96,5 +96,22 @@ |
97 | 97 | return $num; |
98 | 98 | } |
99 | 99 | |
| 100 | + /** |
| 101 | + * Compatibility method to get the skin; MW 1.18 introduces a getSkin method in SpecialPage. |
| 102 | + * |
| 103 | + * @since 1.6 |
| 104 | + * |
| 105 | + * @return Skin |
| 106 | + */ |
| 107 | + public function getSkin() { |
| 108 | + if ( method_exists( 'SpecialPage', 'getSkin' ) ) { |
| 109 | + return parent::getSkin(); |
| 110 | + } |
| 111 | + else { |
| 112 | + global $wgUser; |
| 113 | + return $wgUser->getSkin(); |
| 114 | + } |
| 115 | + } |
| 116 | + |
100 | 117 | } |
101 | 118 | |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php |
— | — | @@ -18,8 +18,6 @@ |
19 | 19 | global $wgAjaxExportList; |
20 | 20 | $wgAjaxExportList[] = "smwfGetValues"; |
21 | 21 | |
22 | | -// function smwfGetValues($p, $v) { return SMWSearchByProperty::getSuggestedValues($p, $v); } |
23 | | - |
24 | 22 | /** |
25 | 23 | * This special page for Semantic MediaWiki implements a |
26 | 24 | * view on a relation-object pair,i.e. a typed backlink. |
— | — | @@ -101,8 +99,8 @@ |
102 | 100 | * @return string HTML of the search by property function |
103 | 101 | */ |
104 | 102 | private function displaySearchByProperty() { |
105 | | - global $wgUser, $wgOut, $smwgSearchByPropertyFuzzy; |
106 | | - $skin = $wgUser->getSkin(); |
| 103 | + global $wgOut, $smwgSearchByPropertyFuzzy; |
| 104 | + $skin = $this->getSkin(); |
107 | 105 | |
108 | 106 | if ( $this->propertystring == '' ) { |
109 | 107 | return '<p>' . wfMsg( 'smw_sbv_docu' ) . "</p>\n"; |
— | — | @@ -175,8 +173,7 @@ |
176 | 174 | * @return string HTML with the bullet list and a header |
177 | 175 | */ |
178 | 176 | private function displayResults( $results, $number = - 1, $first = true, $highlight = false ) { |
179 | | - global $wgUser; |
180 | | - $skin = $wgUser->getSkin(); |
| 177 | + $skin = $this->getSkin(); |
181 | 178 | |
182 | 179 | $html = "<ul>\n"; |
183 | 180 | |
— | — | @@ -206,8 +203,8 @@ |
207 | 204 | * @return string HTML with the navigation bar |
208 | 205 | */ |
209 | 206 | private function getNavigationBar( $count ) { |
210 | | - global $wgUser, $smwgQMaxInlineLimit; |
211 | | - $skin = $wgUser->getSkin(); |
| 207 | + global $smwgQMaxInlineLimit; |
| 208 | + $skin = $this->getSkin(); |
212 | 209 | |
213 | 210 | if ( $this->offset > 0 ) |
214 | 211 | $navigation = '<a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'SearchByProperty', 'offset=' . max( 0, $this->offset - $this->limit ) . '&limit=' . $this->limit . '&property=' . urlencode( $this->property->getWikiValue() ) . '&value=' . urlencode( $this->value->getWikiValue() ) ) ) . '">' . wfMsg( 'smw_result_prev' ) . '</a>'; |
— | — | @@ -329,5 +326,22 @@ |
330 | 327 | |
331 | 328 | return $html; |
332 | 329 | } |
| 330 | + |
| 331 | + /** |
| 332 | + * Compatibility method to get the skin; MW 1.18 introduces a getSkin method in SpecialPage. |
| 333 | + * |
| 334 | + * @since 1.6 |
| 335 | + * |
| 336 | + * @return Skin |
| 337 | + */ |
| 338 | + public function getSkin() { |
| 339 | + if ( method_exists( 'SpecialPage', 'getSkin' ) ) { |
| 340 | + return parent::getSkin(); |
| 341 | + } |
| 342 | + else { |
| 343 | + global $wgUser; |
| 344 | + return $wgUser->getSkin(); |
| 345 | + } |
| 346 | + } |
333 | 347 | |
334 | 348 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Table.php |
— | — | @@ -90,4 +90,5 @@ |
91 | 91 | public function getParameters() { |
92 | 92 | return array_merge( parent::getParameters(), parent::textDisplayParameters() ); |
93 | 93 | } |
| 94 | + |
94 | 95 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | |
114 | 114 | public function getParameters() { |
115 | 115 | $params = parent::getParameters(); |
116 | | - |
| 116 | + |
117 | 117 | $params['embedformat'] = new Parameter( 'embedformat' ); |
118 | 118 | $params['embedformat']->setDescription( wfMsg( 'smw_paramdesc_embedformat' ) ); |
119 | 119 | $params['embedformat']->setDefault( '' ); |