Index: trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php |
— | — | @@ -20,6 +20,8 @@ |
21 | 21 | protected $maxTags; |
22 | 22 | protected $minTagSize; |
23 | 23 | |
| 24 | + protected $tagsHtml = array(); |
| 25 | + |
24 | 26 | public function getName() { |
25 | 27 | return wfMsg( 'srf_printername_tagcloud' ); |
26 | 28 | } |
— | — | @@ -39,12 +41,6 @@ |
40 | 42 | |
41 | 43 | $this->includeName = $params['includename'] == 'yes'; |
42 | 44 | |
43 | | - if ( !array_key_exists( 'linkpages', $params ) || !in_array( $params['linkpages'], array( 'yes', 'no' ) ) ) { |
44 | | - $params['linkpages'] = 'yes'; |
45 | | - } |
46 | | - |
47 | | - $this->linkPages = $params['linkpages'] == 'yes'; |
48 | | - |
49 | 45 | if ( !array_key_exists( 'increase', $params ) || !in_array( $params['increase'], array( 'linear', 'log' ) ) ) { |
50 | 46 | $params['increase'] = 'log'; |
51 | 47 | } |
— | — | @@ -101,10 +97,7 @@ |
102 | 98 | * @return array |
103 | 99 | */ |
104 | 100 | protected function getTags( SMWQueryResult $results, $outputmode ) { |
105 | | - global $wgUser; |
106 | | - |
107 | 101 | $tags = array(); |
108 | | - $skin = $wgUser->getSkin(); |
109 | 102 | |
110 | 103 | while ( /* array of SMWResultArray */ $row = $results->getNext() ) { // Objects (pages) |
111 | 104 | for ( $i = 0, $n = count( $row ); $i < $n; $i++ ) { // Properties |
— | — | @@ -118,14 +111,17 @@ |
119 | 112 | |
120 | 113 | // Get the HTML for the tag content. Pages are linked, other stuff is just plaintext. |
121 | 114 | if ( $obj->getTypeID() == '_wpg' ) { |
122 | | - $value = $this->linkPages ? $obj->getLongText( $outputmode, $skin ) : $obj->getTitle()->getText(); |
| 115 | + $value = $obj->getTitle()->getText(); |
| 116 | + $html = $obj->getLongText( $outputmode, $this->getLinker( method_exists( $obj, 'isMainObject' ) && $obj->isMainObject() ) ); |
123 | 117 | } |
124 | 118 | else { |
125 | | - $value = $obj->getShortText( $outputmode, $skin ); |
| 119 | + $html = $obj->getShortText( $outputmode, $this->getLinker( false ) ); |
| 120 | + $value = $html; |
126 | 121 | } |
127 | 122 | |
128 | 123 | if ( !array_key_exists( $value, $tags ) ) { |
129 | 124 | $tags[$value] = 0; |
| 125 | + $this->tagsHtml[$value] = $html; // Store the HTML separetely, so sorting can be done easily. |
130 | 126 | } |
131 | 127 | |
132 | 128 | $tags[$value]++; |
— | — | @@ -251,7 +247,7 @@ |
252 | 248 | $htmlTags[] = Html::rawElement( |
253 | 249 | 'span', |
254 | 250 | array( 'style' => "font-size:$size%" ), |
255 | | - $name |
| 251 | + $this->tagsHtml[$name] |
256 | 252 | ); |
257 | 253 | } |
258 | 254 | |
— | — | @@ -273,7 +269,6 @@ |
274 | 270 | $params = parent::getParameters(); |
275 | 271 | |
276 | 272 | $params[] = array( 'name' => 'includename', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_includename' ), 'values' => array( 'yes', 'no' ) ); |
277 | | - $params[] = array( 'name' => 'linkpages', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_linkpages' ), 'values' => array( 'yes', 'no' ) ); |
278 | 273 | $params[] = array( 'name' => 'increase', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_increase' ), 'values' => array( 'linear', 'log' ) ); |
279 | 274 | $params[] = array( 'name' => 'tagorder', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_tagorder' ), 'values' => array( 'alphabetic', 'asc', 'desc', 'random', 'unchanged' ) ); |
280 | 275 | |
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php |
— | — | @@ -81,7 +81,6 @@ |
82 | 82 | // "tagcloud" format |
83 | 83 | 'srf_printername_tagcloud' => 'Tag cloud', |
84 | 84 | 'srf_paramdesc_includename' => 'If the names of the object themselves should be included', |
85 | | - 'srf_paramdesc_linkpages' => 'If pages should be linked', |
86 | 85 | 'srf_paramdesc_increase' => 'How to increase the size of tags', |
87 | 86 | 'srf_paramdesc_tagorder' => 'The order of the tags', |
88 | 87 | 'srf_paramdesc_mincount' => 'The minimum amount of times a value needs to occur to be listed', |