r88900 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88899‎ | r88900 | r88901 >
Date:16:51, 26 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
address bug 29151
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php
@@ -65,22 +65,30 @@
6666 function getPageHeader() {
6767 return '<p>' . wfMsg( 'smw_unusedproperties_docu' ) . "</p><br />\n";
6868 }
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!
7376 $errors = array();
 77+
7478 if ( count( $types ) >= 1 ) {
75 - $typestring = current( $types )->getLongHTMLText( $skin );
 79+ $typestring = SMWDataValueFactory::newDataItemValue( current( $types ), new SMWDIProperty( '_TYPE' ) )->getLongHTMLText( $skin );
7680 } else {
7781 $type = SMWDataValueFactory::newPropertyObjectValue( SMWPropertyValue::makeProperty( '_TYPE' ) );
7882 $type->setDBkeys( array( '_wpg' ) );
7983 $typestring = $type->getLongHTMLText( $skin );
8084 $errors[] = wfMsg( 'smw_propertylackstype', $type->getLongHTMLText() );
8185 }
 86+
8287 return wfMsg( 'smw_unusedproperty_template', $proplink, $typestring ) . ' ' . smwfEncodeMessages( $errors );
8388 }
8489
 90+ /**
 91+ * @return array of SMWDIProperty
 92+ */
8593 function getResults( $requestoptions ) {
8694 return smwfGetStore()->getUnusedPropertiesSpecial( $requestoptions );
8795 }
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php
@@ -362,7 +362,7 @@
363363 *
364364 * @param SMWRequestOptions $requestoptions
365365 *
366 - * @return array
 366+ * @return array of SMWDIProperty
367367 */
368368 public abstract function getUnusedPropertiesSpecial( $requestoptions = null );
369369

Status & tagging log