Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php |
— | — | @@ -1,4 +1,5 @@ |
2 | 2 | <?php |
| 3 | + |
3 | 4 | /** |
4 | 5 | * @file |
5 | 6 | * @ingroup SMWSpecialPage |
— | — | @@ -11,13 +12,6 @@ |
12 | 13 | * @author Daniel Herzig |
13 | 14 | */ |
14 | 15 | |
15 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
16 | | - die( 'Not an entry point.' ); |
17 | | -} |
18 | | - |
19 | | -global $wgAjaxExportList; |
20 | | -$wgAjaxExportList[] = "smwfGetValues"; |
21 | | - |
22 | 16 | /** |
23 | 17 | * This special page for Semantic MediaWiki implements a |
24 | 18 | * view on a relation-object pair,i.e. a typed backlink. |
— | — | @@ -28,6 +22,7 @@ |
29 | 23 | * @ingroup SpecialPage |
30 | 24 | */ |
31 | 25 | class SMWSearchByProperty extends SpecialPage { |
| 26 | + |
32 | 27 | /// string Name of the property searched for |
33 | 28 | private $propertystring = ''; |
34 | 29 | /// SMWPropertyValue The property that is searched for |
— | — | @@ -207,7 +202,7 @@ |
208 | 203 | $html .= '  ' . SMWInfolink::newBrowsingLink( '+', $result[0]->getLongWikiText() )->getHTML( smwfGetLinker() ); |
209 | 204 | } |
210 | 205 | |
211 | | - if ( is_object( $result[1] ) && ( ( $this->value != $result[1] ) || $highlight ) ) { |
| 206 | + if ( array_key_exists( 1, $result ) && is_object( $result[1] ) && ( ( $this->value != $result[1] ) || $highlight ) ) { |
212 | 207 | $html .= " <em><small>(" . $result[1]->getLongHTMLText( smwfGetLinker() ) . ")</small></em>"; |
213 | 208 | } |
214 | 209 | |
— | — | @@ -382,7 +377,14 @@ |
383 | 378 | $ret = array(); |
384 | 379 | |
385 | 380 | while ( $result ) { |
386 | | - $ret[] = array( $result[0]->getNextDataValue(), $result[1]->getNextDataValue() ); |
| 381 | + $r = array( $result[0]->getNextDataValue() ); |
| 382 | + |
| 383 | + if ( array_key_exists( 1, $result ) ) { |
| 384 | + $r[] = $result[1]->getNextDataValue(); |
| 385 | + } |
| 386 | + |
| 387 | + $ret[] = $r; |
| 388 | + |
387 | 389 | $result = $results->getNext(); |
388 | 390 | } |
389 | 391 | |