Index: trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php |
— | — | @@ -22,14 +22,32 @@ |
23 | 23 | return wfMsg( 'srf_printername_tagcloud' ); |
24 | 24 | } |
25 | 25 | |
26 | | - public function getResult( $results, $params, $outputmode ) { |
| 26 | + public function getResult( /* SMWQueryResult */ $results, /* array */ $params, $outputmode ) { |
27 | 27 | // skip checks, results with 0 entries are normal |
28 | 28 | $this->readParameters( $params, $outputmode ); |
29 | 29 | return $this->getResultText( $results, SMW_OUTPUT_HTML ); |
30 | 30 | } |
31 | 31 | |
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(); |
33 | 38 | |
| 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 | + } |
34 | 48 | } |
35 | 49 | |
36 | | -} |
\ No newline at end of file |
| 50 | + protected function getTagCloud( array $tags ) { |
| 51 | + |
| 52 | + } |
| 53 | + |
| 54 | +} |