r81762 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81761‎ | r81762 | r81763 >
Date:16:55, 8 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added some stuff
Modified paths:
  • /trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php
@@ -22,14 +22,32 @@
2323 return wfMsg( 'srf_printername_tagcloud' );
2424 }
2525
26 - public function getResult( $results, $params, $outputmode ) {
 26+ public function getResult( /* SMWQueryResult */ $results, /* array */ $params, $outputmode ) {
2727 // skip checks, results with 0 entries are normal
2828 $this->readParameters( $params, $outputmode );
2929 return $this->getResultText( $results, SMW_OUTPUT_HTML );
3030 }
3131
32 - public function getResultText( $results, $outputmode ) {
 32+ public function getResultText( /* SMWQueryResult */ $results, $outputmode ) {
 33+ return $this->getTagCloud( $this->getTags( $results ) );
 34+ }
 35+
 36+ protected function getTags( SMWQueryResult $results ) {
 37+ $tags = array();
3338
 39+ while ( /* array of SMWResultArray */ $row = $results->getNext() ) { // Objects (pages)
 40+ for ( $i = 0, $n = count( $row ); $i < $n; $i++ ) { // Properties
 41+ while ( ( $obj = $row[$i]->getNextObject() ) !== false ) { // Property values
 42+ if ( $obj->getTypeID() == '_wpg' ) {
 43+ $images[] = $obj->getTitle();
 44+ }
 45+ }
 46+ }
 47+ }
3448 }
3549
36 -}
\ No newline at end of file
 50+ protected function getTagCloud( array $tags ) {
 51+
 52+ }
 53+
 54+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r81764Follow up to r81762jeroendedauw17:20, 8 February 2011

Status & tagging log