Index: trunk/extensions/interact/SpecialInteract.php |
— | — | @@ -43,9 +43,13 @@ |
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | | - function formatResult( $skin, $result) { |
| 47 | + function formatResult( $result, $old = null ) { |
| 48 | + if($old) { // pre-1.9 |
| 49 | + $skin = $result; |
| 50 | + $result = $old; |
| 51 | + } |
48 | 52 | $title = Title::makeTitle( $result->namespace, $result->title ); |
49 | | - $link = $skin->makeKnownLinkObj( $title ); |
| 53 | + $link = $old ? $skin->makeKnownLinkObj( $title ) : Linker::makeKnownLinkObj( $title ); |
50 | 54 | return "$link"; |
51 | 55 | } |
52 | 56 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialTypes.php |
— | — | @@ -87,9 +87,9 @@ |
88 | 88 | /** |
89 | 89 | * Returns the info about a type as HTML |
90 | 90 | */ |
91 | | - function getTypeInfo ($label, $skin) { |
| 91 | + function getTypeInfo ($label, $skin = null) { // if $skin is left null, we better be in MW1.9+ |
92 | 92 | $title = Title::makeTitle( SMW_NS_TYPE, $label ); |
93 | | - $link = $skin->makeLinkObj( $title, $title->getText() ); |
| 93 | + $link = $skin ? $skin->makeLinkObj( $title, $title->getText() ) : Linker::makeLinkObj( $title, $title->getText() ); |
94 | 94 | |
95 | 95 | // Unlike Attributes and Relations, we don't have a count and there's no URL to search by type. |
96 | 96 | $text = $link; |
— | — | @@ -117,8 +117,13 @@ |
118 | 118 | |
119 | 119 | } |
120 | 120 | |
121 | | - function formatResult( $skin, $result ) { |
122 | | - return $this->getTypeInfo($result->title, $skin); |
| 121 | + function formatResult( $result, $old = null ) { |
| 122 | + if($old) { // pre-1.9 |
| 123 | + $skin = $result; |
| 124 | + $result = $old; |
| 125 | + return $this->getTypeInfo($result->title, $skin); |
| 126 | + } |
| 127 | + return $this->getTypeInfo($result->title); |
123 | 128 | } |
124 | 129 | |
125 | 130 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialUnusedRelations.php |
— | — | @@ -61,10 +61,15 @@ |
62 | 62 | return false;
|
63 | 63 | }
|
64 | 64 |
|
65 | | - function formatResult( $skin, $result ) {
|
| 65 | + function formatResult( $result, $old = null ) {
|
| 66 | + if($old) { // pre-1.9
|
| 67 | + $skin = $result;
|
| 68 | + $result = $old;
|
| 69 | + }
|
66 | 70 | global $wgLang;
|
67 | 71 | $title = Title::makeTitle( SMW_NS_RELATION, $result->title );
|
68 | | - return $skin->makeLinkObj( $title, $title->getText() );
|
| 72 | + return $old ? $skin->makeLinkObj( $title, $title->getText() )
|
| 73 | + : Linker::makeLinkObj( $title, $title->getText() );
|
69 | 74 | }
|
70 | 75 | }
|
71 | 76 |
|
— | — | @@ -99,4 +104,4 @@ |
100 | 105 |
|
101 | 106 |
|
102 | 107 | }
|
103 | | -?> |
\ No newline at end of file |
| 108 | +?>
|
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialAttributes.php |
— | — | @@ -53,11 +53,16 @@ |
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | |
57 | | - function formatResult( $skin, $result ) { |
| 57 | + function formatResult( $result, $old = null ) { |
| 58 | + if($old) { // pre-1.9 |
| 59 | + $skin = $result; |
| 60 | + $result = $old; |
| 61 | + } |
58 | 62 | global $wgLang, $wgExtraNamespaces; |
59 | 63 | // The attribute title is in value, see getSQL(). |
60 | 64 | $attrtitle = Title::makeTitle( SMW_NS_ATTRIBUTE, $result->value ); |
61 | | - $attrlink = $skin->makeLinkObj( $attrtitle, $attrtitle->getText() ); |
| 65 | + $attrlink = $old ? $skin->makeLinkObj( $attrtitle, $attrtitle->getText() ) |
| 66 | + : Linker::makeLinkObj( $attrtitle, $attrtitle->getText() ); |
62 | 67 | // The value_datatype is in title, see getSQL(). |
63 | 68 | if (strncmp($result->title, $wgExtraNamespaces[SMW_NS_TYPE], count($wgExtraNamespaces[SMW_NS_TYPE])) == 0) { |
64 | 69 | // The value_datatype is a Type: page name. |
— | — | @@ -72,10 +77,10 @@ |
73 | 78 | $typetitle = NULL; |
74 | 79 | } |
75 | 80 | } |
76 | | - $typelink = $skin->makeLinkObj( $typetitle); |
| 81 | + $typelink = $old ? $skin->makeLinkObj( $typetitle ) : Linker::makeLinkObj( $typetitle ); |
77 | 82 | // Note: It doesn't seem possible to reuse this infolink object. |
78 | 83 | $searchlink = new SMWInfolink( |
79 | | - SMWInfolink::makeAttributeSearchURL($attrtitle->getText(),'',$skin), |
| 84 | + SMWInfolink::makeAttributeSearchURL($attrtitle->getText(),''), |
80 | 85 | '+','smwsearch'); |
81 | 86 | |
82 | 87 | return "$attrlink ($result->count)" . wfMsg('smw_attr_type_join', $typelink) . ' ' . $searchlink->getHTML(); |
— | — | @@ -92,4 +97,4 @@ |
93 | 98 | SpecialPage::addPage( new SpecialPage('Attributes','',true,'doSpecialAttributes',false) ); |
94 | 99 | } |
95 | 100 | |
96 | | -?> |
\ No newline at end of file |
| 101 | +?> |
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialUnusedAttributes.php |
— | — | @@ -60,10 +60,15 @@ |
61 | 61 | return false;
|
62 | 62 | }
|
63 | 63 |
|
64 | | - function formatResult( $skin, $result ) {
|
| 64 | + function formatResult( $result, $old = null ) {
|
| 65 | + if($old) { // pre-1.9
|
| 66 | + $skin = $result;
|
| 67 | + $result = $old;
|
| 68 | + }
|
65 | 69 | global $wgLang;
|
66 | 70 | $title = Title::makeTitle( SMW_NS_ATTRIBUTE, $result->title );
|
67 | | - return $skin->makeLinkObj( $title, $title->getText() );
|
| 71 | + return $old ? $skin->makeLinkObj( $title, $title->getText() )
|
| 72 | + : Linker::makeLinkObj( $title, $title->getText() );
|
68 | 73 | }
|
69 | 74 | }
|
70 | 75 |
|
— | — | @@ -77,4 +82,4 @@ |
78 | 83 | SpecialPage::addPage( new SpecialPage('UnusedAttributes','',true,'doSpecialUnsusedAttributes',false) );
|
79 | 84 | }
|
80 | 85 |
|
81 | | -?> |
\ No newline at end of file |
| 86 | +?>
|
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialRelations.php |
— | — | @@ -53,13 +53,18 @@ |
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | |
57 | | - function formatResult( $skin, $result ) { |
| 57 | + function formatResult( $result, $old = null ) { |
| 58 | + if($old) { // pre-1.9 |
| 59 | + $skin = $result; |
| 60 | + $result = $old; |
| 61 | + } |
58 | 62 | global $wgLang; |
59 | 63 | $title = Title::makeTitle( SMW_NS_RELATION, $result->title ); |
60 | | - $rlink = $skin->makeLinkObj( $title, $title->getText() ); |
| 64 | + $rlink = $old ? $skin->makeLinkObj( $title, $title->getText() ) |
| 65 | + : Linker::makeLinkObj( $title, $title->getText() ); |
61 | 66 | // Note: It doesn't seem possible to reuse this infolink object. |
62 | 67 | $searchlink = new SMWInfolink( |
63 | | - SMWInfolink::makeRelationSearchURL($title->getText(),'',$skin), |
| 68 | + SMWInfolink::makeRelationSearchURL($title->getText(),''), |
64 | 69 | '+','smwsearch'); |
65 | 70 | |
66 | 71 | return "$rlink ($result->count) " . $searchlink->getHTML(); |
— | — | @@ -77,4 +82,4 @@ |
78 | 83 | SpecialPage::addPage( new SpecialPage('Relations','',true,'doSpecialRelations',false) ); |
79 | 84 | } |
80 | 85 | |
81 | | -?> |
\ No newline at end of file |
| 86 | +?> |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Datatype.php |
— | — | @@ -324,9 +324,9 @@ |
325 | 325 | * @access public |
326 | 326 | * @static |
327 | 327 | */ |
328 | | - static function makeAttributeSearchURL($attribute,$value,$skin) { |
| 328 | + static function makeAttributeSearchURL($attribute,$value) { |
329 | 329 | global $wgServer; |
330 | | - return $wgServer . $skin->makeSpecialUrl('SearchTriple','attribute=' . urlencode($attribute) . '&value=' . urlencode($value) . '&do=' . urlencode('Search Attributes')); |
| 330 | + return $wgServer . Skin::makeSpecialUrl('SearchTriple','attribute=' . urlencode($attribute) . '&value=' . urlencode($value) . '&do=' . urlencode('Search Attributes')); |
331 | 331 | } |
332 | 332 | |
333 | 333 | /** |
— | — | @@ -334,9 +334,9 @@ |
335 | 335 | * @access public |
336 | 336 | * @static |
337 | 337 | */ |
338 | | - static function makeRelationSearchURL($relation,$object,$skin) { |
| 338 | + static function makeRelationSearchURL($relation,$object) { |
339 | 339 | global $wgServer; |
340 | | - return $wgServer . $skin->makeSpecialUrl('SearchTriple','relation=' . urlencode($relation) . '&object=' . urlencode($object) . '&do=' . urlencode('Search Relations')); |
| 340 | + return $wgServer . Skin::makeSpecialUrl('SearchTriple','relation=' . urlencode($relation) . '&object=' . urlencode($object) . '&do=' . urlencode('Search Relations')); |
341 | 341 | } |
342 | 342 | |
343 | 343 | /** |
Index: trunk/extensions/LinkSearch/LinkSearch.php |
— | — | @@ -75,12 +75,16 @@ |
76 | 76 | AND el_index LIKE $encSearch"; |
77 | 77 | } |
78 | 78 | |
79 | | - function formatResult( $skin, $result ) { |
| 79 | + function formatResult( $result, $old = null ) { |
| 80 | + if($old) { // pre-1.9 |
| 81 | + $skin = $result; |
| 82 | + $result = $old; |
| 83 | + } |
80 | 84 | $title = Title::makeTitle( $result->namespace, $result->title ); |
81 | 85 | $url = $result->url; |
82 | 86 | |
83 | | - $pageLink = $skin->makeKnownLinkObj( $title ); |
84 | | - $urlLink = $skin->makeExternalLink( $url, $url ); |
| 87 | + $pageLink = $old ? $skin->makeKnownLinkObj( $title ) : Linker::makeKnownLinkObj( $title ); |
| 88 | + $urlLink = $old ? $skin->makeExternalLink( $url, $url ) : Linker::makeExternalLink( $url, $url ); |
85 | 89 | |
86 | 90 | return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink ); |
87 | 91 | } |
Index: trunk/extensions/CrossNamespaceLinks/SpecialCrossNamespaceLinks_body.php |
— | — | @@ -102,13 +102,18 @@ |
103 | 103 | |
104 | 104 | function sortDescending() { return false; } |
105 | 105 | |
106 | | - function formatResult( $skin, $result ) { |
| 106 | + function formatResult( $result, $old = null ) { |
| 107 | + if($old) { // pre-1.9 |
| 108 | + $skin = $result; |
| 109 | + $result = $old; |
| 110 | + } |
107 | 111 | global $wgContLang, $wgLang; |
108 | 112 | |
109 | 113 | $nt = Title::makeTitle( NS_MAIN, $result->title ); |
110 | 114 | $text = $wgContLang->convert( $nt->getPrefixedText() ); |
111 | 115 | |
112 | | - $plink = $skin->makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) ); |
| 116 | + $plink = $old ? $skin->makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) ) |
| 117 | + : Linker::makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) ); |
113 | 118 | |
114 | 119 | return wfMsgExt( 'crossnamespacelinkstext', array( 'parsemag' ), $plink, $wgLang->formatNum( $result->namespace ), htmlspecialchars( $wgLang->getNsText( $result->value ) ) ); |
115 | 120 | } |