Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php |
— | — | @@ -65,22 +65,30 @@ |
66 | 66 | function getPageHeader() { |
67 | 67 | return '<p>' . wfMsg( 'smw_unusedproperties_docu' ) . "</p><br />\n"; |
68 | 68 | } |
69 | | - |
70 | | - function formatResult( $skin, $result ) { |
71 | | - $proplink = $skin->makeKnownLinkObj( $result->getWikiPageValue()->getTitle(), $result->getWikiValue() ); |
72 | | - $types = smwfGetStore()->getPropertyValues( $result->getWikiPageValue(), new SMWDIProperty( '_TYPE' ) ); // TODO: do not bypass SMWDataValueFactory! |
| 69 | + function formatResult( $skin, /* SMWDIProperty */ $result ) { |
| 70 | + $proplink = $skin->makeKnownLinkObj( |
| 71 | + $result->getDiWikiPage()->getTitle(), |
| 72 | + SMWDataValueFactory::newDataItemValue( $result->getDiWikiPage(), new SMWDIProperty( '_TYPE' ) )->getWikiValue() |
| 73 | + ); |
| 74 | + |
| 75 | + $types = smwfGetStore()->getPropertyValues( $result->getDiWikiPage(), new SMWDIProperty( '_TYPE' ) ); // TODO: do not bypass SMWDataValueFactory! |
73 | 76 | $errors = array(); |
| 77 | + |
74 | 78 | if ( count( $types ) >= 1 ) { |
75 | | - $typestring = current( $types )->getLongHTMLText( $skin ); |
| 79 | + $typestring = SMWDataValueFactory::newDataItemValue( current( $types ), new SMWDIProperty( '_TYPE' ) )->getLongHTMLText( $skin ); |
76 | 80 | } else { |
77 | 81 | $type = SMWDataValueFactory::newPropertyObjectValue( SMWPropertyValue::makeProperty( '_TYPE' ) ); |
78 | 82 | $type->setDBkeys( array( '_wpg' ) ); |
79 | 83 | $typestring = $type->getLongHTMLText( $skin ); |
80 | 84 | $errors[] = wfMsg( 'smw_propertylackstype', $type->getLongHTMLText() ); |
81 | 85 | } |
| 86 | + |
82 | 87 | return wfMsg( 'smw_unusedproperty_template', $proplink, $typestring ) . ' ' . smwfEncodeMessages( $errors ); |
83 | 88 | } |
84 | 89 | |
| 90 | + /** |
| 91 | + * @return array of SMWDIProperty |
| 92 | + */ |
85 | 93 | function getResults( $requestoptions ) { |
86 | 94 | return smwfGetStore()->getUnusedPropertiesSpecial( $requestoptions ); |
87 | 95 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php |
— | — | @@ -362,7 +362,7 @@ |
363 | 363 | * |
364 | 364 | * @param SMWRequestOptions $requestoptions |
365 | 365 | * |
366 | | - * @return array |
| 366 | + * @return array of SMWDIProperty |
367 | 367 | */ |
368 | 368 | public abstract function getUnusedPropertiesSpecial( $requestoptions = null ); |
369 | 369 | |