Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php |
— | — | @@ -117,10 +117,10 @@ |
118 | 118 | * @param[in] $data SMWSemanticData The data to be displayed |
119 | 119 | * @param[in] $left bool Should properties be displayed on the left side? |
120 | 120 | * @param[in] $incoming bool Is this an incoming? Or an outgoing? |
| 121 | + * |
121 | 122 | * @return A string containing the HTML with the factbox |
122 | 123 | */ |
123 | 124 | private function displayData( SMWSemanticData $data, $left = true, $incoming = false ) { |
124 | | - $skin = $this->getSkin(); |
125 | 125 | // Some of the CSS classes are different for the left or the right side. |
126 | 126 | // In this case, there is an "i" after the "smwb-". This is set here. |
127 | 127 | $ccsPrefix = $left ? 'smwb-' : 'smwb-i'; |
— | — | @@ -134,11 +134,11 @@ |
135 | 135 | |
136 | 136 | if ( $dvProperty->isVisible() ) { |
137 | 137 | $dvProperty->setCaption( $this->getPropertyLabel( $dvProperty, $incoming ) ); |
138 | | - $proptext = $dvProperty->getShortHTMLText( $skin ) . "\n"; |
| 138 | + $proptext = $dvProperty->getShortHTMLText( smwfGetLinker() ) . "\n"; |
139 | 139 | } elseif ( $diProperty->getKey() == '_INST' ) { |
140 | | - $proptext = $skin->specialLink( 'Categories' ); |
| 140 | + $proptext = smwfGetLinker()->specialLink( 'Categories' ); |
141 | 141 | } elseif ( $diProperty->getKey() == '_REDI' ) { |
142 | | - $proptext = $skin->specialLink( 'Listredirects', 'isredirect' ); |
| 142 | + $proptext = smwfGetLinker()->specialLink( 'Listredirects', 'isredirect' ); |
143 | 143 | } else { |
144 | 144 | continue; // skip this line |
145 | 145 | } |
— | — | @@ -173,7 +173,17 @@ |
174 | 174 | } |
175 | 175 | |
176 | 176 | if ( $moreIncoming ) { // link to the remaining incoming pages: |
177 | | - $body .= '<a href="' . $skin->makeSpecialUrl( 'SearchByProperty', 'property=' . urlencode( $dvProperty->getWikiValue() ) . '&value=' . urlencode( $this->subject->getWikiValue() ) ) . '">' . wfMsg( "smw_browse_more" ) . "</a>\n"; |
| 177 | + $body .= Html::element( |
| 178 | + 'a', |
| 179 | + array( |
| 180 | + 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( |
| 181 | + 'property=' . urlencode( $dvProperty->getWikiValue() ) . |
| 182 | + '&value=' . urlencode( $this->subject->getWikiValue() ) |
| 183 | + ) |
| 184 | + ), |
| 185 | + wfMsg( "smw_browse_more" ) |
| 186 | + ); |
| 187 | + |
178 | 188 | } |
179 | 189 | |
180 | 190 | $body .= "</td>\n"; |
— | — | @@ -225,12 +235,10 @@ |
226 | 236 | private function displayHead() { |
227 | 237 | global $wgOut; |
228 | 238 | |
229 | | - $skin = $this->getSkin(); |
230 | | - |
231 | 239 | $wgOut->setHTMLTitle( $this->subject->getTitle() ); |
232 | 240 | $html = "<table class=\"smwb-factbox\" cellpadding=\"0\" cellspacing=\"0\">\n"; |
233 | 241 | $html .= "<tr class=\"smwb-title\"><td colspan=\"2\">\n"; |
234 | | - $html .= $skin->makeLinkObj( $this->subject->getTitle() ) . "\n"; // @todo Replace makeLinkObj with link as soon as we drop MW1.12 compatibility |
| 242 | + $html .= smwfGetLinker()->makeLinkObj( $this->subject->getTitle() ) . "\n"; // @todo Replace makeLinkObj with link as soon as we drop MW1.12 compatibility |
235 | 243 | $html .= "</td></tr>\n"; |
236 | 244 | $html .= "</table>\n"; |
237 | 245 | |
— | — | @@ -247,8 +255,8 @@ |
248 | 256 | "<table class=\"smwb-factbox\" cellpadding=\"0\" cellspacing=\"0\">\n" . |
249 | 257 | "<tr class=\"smwb-center\"><td colspan=\"2\">\n" . |
250 | 258 | ( $this->showincoming ? |
251 | | - $this->linkhere( wfMsg( 'smw_browse_hide_incoming' ), true, false, 0 ): |
252 | | - $this->linkhere( wfMsg( 'smw_browse_show_incoming' ), true, true, $this->offset ) ) . |
| 259 | + $this->linkHere( wfMsg( 'smw_browse_hide_incoming' ), true, false, 0 ): |
| 260 | + $this->linkHere( wfMsg( 'smw_browse_show_incoming' ), true, true, $this->offset ) ) . |
253 | 261 | " \n" . "</td></tr>\n" . "</table>\n"; |
254 | 262 | } |
255 | 263 | |
— | — | @@ -266,11 +274,11 @@ |
267 | 275 | if ( ( $this->offset > 0 ) || $more ) { |
268 | 276 | $offset = max( $this->offset - SMWSpecialBrowse::$incomingpropertiescount + 1, 0 ); |
269 | 277 | $html .= ( $this->offset == 0 ) ? wfMsg( 'smw_result_prev' ): |
270 | | - $this->linkhere( wfMsg( 'smw_result_prev' ), $this->showoutgoing, true, $offset ); |
| 278 | + $this->linkHere( wfMsg( 'smw_result_prev' ), $this->showoutgoing, true, $offset ); |
271 | 279 | $offset = $this->offset + SMWSpecialBrowse::$incomingpropertiescount - 1; |
272 | 280 | $html .= "     <strong>" . wfMsg( 'smw_result_results' ) . " " . ( $this->offset + 1 ) . |
273 | 281 | " – " . ( $offset ) . "</strong>     "; |
274 | | - $html .= $more ? $this->linkhere( wfMsg( 'smw_result_next' ), $this->showoutgoing, true, $offset ):wfMsg( 'smw_result_next' ); |
| 282 | + $html .= $more ? $this->linkHere( wfMsg( 'smw_result_next' ), $this->showoutgoing, true, $offset ):wfMsg( 'smw_result_next' ); |
275 | 283 | } |
276 | 284 | } |
277 | 285 | $html .= " \n" . "</td></tr>\n" . "</table>\n"; |
— | — | @@ -284,13 +292,23 @@ |
285 | 293 | * @param[in] $out bool Should the linked to page include outgoing properties? |
286 | 294 | * @param[in] $in bool Should the linked to page include incoming properties? |
287 | 295 | * @param[in] $offset int What is the offset for the incoming properties? |
| 296 | + * |
288 | 297 | * @return string HTML with the link to this page |
289 | 298 | */ |
290 | | - private function linkhere( $text, $out, $in, $offset ) { |
291 | | - $dir = $out ? ( $in ? 'both':'out' ):'in'; |
292 | | - $frag = ( $text == wfMsg( 'smw_browse_show_incoming' ) ) ? '#smw_browse_incoming':''; |
293 | | - return '<a href="' . htmlspecialchars( $this->getSkin()->makeSpecialUrl( 'Browse', |
294 | | - "offset={$offset}&dir={$dir}&article=" . urlencode( $this->subject->getLongWikiText() ) ) ) . "$frag\">$text</a>"; |
| 299 | + private function linkHere( $text, $out, $in, $offset ) { |
| 300 | + $dir = $out ? ( $in ? 'both' : 'out' ) : 'in'; |
| 301 | + $frag = ( $text == wfMsg( 'smw_browse_show_incoming' ) ) ? '#smw_browse_incoming' : ''; |
| 302 | + |
| 303 | + return Html::element( |
| 304 | + 'a', |
| 305 | + array( |
| 306 | + 'href' => SpecialPage::getSafeTitleFor( 'Browse' )->getLocalURL( |
| 307 | + "offset={$offset}&dir={$dir}" . |
| 308 | + '&article=' . urlencode( $this->subject->getLongWikiText() ) . $frag |
| 309 | + ) |
| 310 | + ), |
| 311 | + $text |
| 312 | + ); |
295 | 313 | } |
296 | 314 | |
297 | 315 | /** |
— | — | @@ -318,6 +336,7 @@ |
319 | 337 | $valoptions = new SMWRequestOptions(); |
320 | 338 | $valoptions->sort = true; |
321 | 339 | $valoptions->limit = SMWSpecialBrowse::$incomingvaluescount; |
| 340 | + |
322 | 341 | foreach ( $inproperties as $property ) { |
323 | 342 | $values = smwfGetStore()->getPropertySubjects( $property, $this->subject->getDataItem(), $valoptions ); |
324 | 343 | foreach ( $values as $value ) { |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php |
— | — | @@ -38,9 +38,11 @@ |
39 | 39 | $pagename = $wgRequest->getVal( 'from' ); |
40 | 40 | $propname = $wgRequest->getVal( 'type' ); |
41 | 41 | $limit = $wgRequest->getVal( 'limit' ); |
| 42 | + $offset = $wgRequest->getVal( 'offset' ); |
| 43 | + |
42 | 44 | if ( $limit == '' ) $limit = 20; |
43 | | - $offset = $wgRequest->getVal( 'offset' ); |
44 | 45 | if ( $offset == '' ) $offset = 0; |
| 46 | + |
45 | 47 | if ( $propname == '' ) { // No GET parameters? Try the URL: |
46 | 48 | $queryparts = explode( '::', $query ); |
47 | 49 | $propname = $query; |