Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php |
— | — | @@ -62,9 +62,9 @@ |
63 | 63 | return htmlspecialchars($this->m_label); |
64 | 64 | } |
65 | 65 | switch ($this->m_mode) { |
66 | | - case SMW_PRINT_CATS: return htmlspecialchars($this->m_label); |
67 | | - case SMW_PRINT_RELS: return $linker->makeLinkObj($this->m_title, $this->m_label); |
68 | | - case SMW_PRINT_ATTS: return $linker->makeKnownLinkObj($this->m_title, $this->m_label); |
| 66 | + case SMW_PRINT_CATS: return htmlspecialchars($this->m_label); // TODO: link to Special:Categories |
| 67 | + case SMW_PRINT_RELS: return $linker->makeLinkObj($this->m_title, htmlspecialchars($this->m_label)); |
| 68 | + case SMW_PRINT_ATTS: return $linker->makeKnownLinkObj($this->m_title, htmlspecialchars($this->m_label)); |
69 | 69 | case SMW_PRINT_THIS: default: return htmlspecialchars($this->m_label); |
70 | 70 | } |
71 | 71 | |
— | — | @@ -73,8 +73,18 @@ |
74 | 74 | /** |
75 | 75 | * Obtain a Wiki-formatted representation of the label. |
76 | 76 | */ |
77 | | - public function getWikiText() { |
78 | | - return $this->m_label; |
| 77 | + public function getWikiText($linked = false) { |
| 78 | + if ( ($linked === NULL) || ($linked === false) || ($this->m_label == '') ) { |
| 79 | + return $this->m_label; |
| 80 | + } else { |
| 81 | + switch ($this->m_mode) { |
| 82 | + case SMW_PRINT_CATS: return $this->m_label; // TODO: link to Special:Categories |
| 83 | + case SMW_PRINT_RELS: case SMW_PRINT_ATTS: |
| 84 | + return '[[' . $this->m_title->getPrefixedText() . '|' . $this->m_label . ']]'; |
| 85 | + case SMW_PRINT_THIS: default: return $this->m_label; |
| 86 | + } |
| 87 | + } |
| 88 | + |
79 | 89 | } |
80 | 90 | |
81 | 91 | public function getTitle() { |
— | — | @@ -216,8 +226,8 @@ |
217 | 227 | protected $m_datavalue; |
218 | 228 | protected $m_comparator; |
219 | 229 | |
220 | | - public function SMWValueDescription(SMWDataValue $datavalue, $comparator = SMW_CMP_EQUAL) { |
221 | | - $this->m_datavalue = $datavalue; |
| 230 | + public function SMWValueDescription($datavalue, $comparator = SMW_CMP_EQ) { |
| 231 | + $this->m_datavalue = $datavalue; // might be NULL for SMW_CMP_ANY |
222 | 232 | $this->m_comparator = $comparator; |
223 | 233 | } |
224 | 234 | |
— | — | @@ -231,7 +241,7 @@ |
232 | 242 | |
233 | 243 | public function getQueryString() { |
234 | 244 | if ($this->m_datavalue !== NULL) { |
235 | | - switch ($m_comparator) { |
| 245 | + switch ($this->m_comparator) { |
236 | 246 | case SMW_CMP_EQ: |
237 | 247 | $comparator = ''; |
238 | 248 | break; |
— | — | @@ -247,7 +257,7 @@ |
248 | 258 | case SMW_CMP_ANY: default: |
249 | 259 | return '+'; |
250 | 260 | } |
251 | | - return $comparator . $datavalue->getShortWikiText(); // TODO: this fails if tooltips are used |
| 261 | + return $comparator . $this->m_datavalue->getWikiValue(); |
252 | 262 | } else { |
253 | 263 | return '+'; |
254 | 264 | } |
— | — | @@ -317,7 +327,7 @@ |
318 | 328 | } |
319 | 329 | $result .= $desc->getQueryString(); |
320 | 330 | } |
321 | | - return '(' . $result . ')'; |
| 331 | + return '<q>' . $result . '</q>'; |
322 | 332 | } |
323 | 333 | } |
324 | 334 | |
— | — | @@ -347,7 +357,7 @@ |
348 | 358 | } |
349 | 359 | |
350 | 360 | public function getQueryString() { |
351 | | - return '[[' . $this->m_relation->getText() . '::<q>' . $this->m_description->getQueryString() . '<q/>]]'; |
| 361 | + return '[[' . $this->m_relation->getText() . '::<q>' . $this->m_description->getQueryString() . '</q>]]'; |
352 | 362 | } |
353 | 363 | } |
354 | 364 | |
— | — | @@ -377,7 +387,7 @@ |
378 | 388 | } |
379 | 389 | |
380 | 390 | public function getQueryString() { |
381 | | - return '[[' . $this->m_attribute->getText() . '::' . $this->m_description->getQueryString() . ']]'; |
| 391 | + return '[[' . $this->m_attribute->getText() . ':=' . $this->m_description->getQueryString() . ']]'; |
382 | 392 | } |
383 | 393 | } |
384 | 394 | |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php |
— | — | @@ -189,7 +189,7 @@ |
190 | 190 | $object = current($this->content); |
191 | 191 | next($this->content); |
192 | 192 | if ($object instanceof SMWDataValue) { //print data values |
193 | | - return $object->getShortWikiText($linker); |
| 193 | + return $object->getShortWikiText($linked); |
194 | 194 | } elseif ($object instanceof Title) { // print Title objects |
195 | 195 | if ( ($linked === NULL) || ($linked === false) ) { |
196 | 196 | return $object->getPrefixedText(); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -566,12 +566,12 @@ |
567 | 567 | } // else: sortkey given but not found: do not sort |
568 | 568 | } |
569 | 569 | |
570 | | - print $from . "<br />\n" . $where . "<br />\n"; //DEBUG |
571 | | - foreach ($sql_options as $key => $val) { //DEBUG |
572 | | - print "$key => $val, "; |
573 | | - } |
574 | | - print "<br />\n"; |
575 | | - print $this->m_sortkey . " --> " . $this->m_sortfield . "<br />\n"; //DEBUG |
| 570 | +// print $from . "<br />\n" . $where . "<br />\n"; //DEBUG |
| 571 | +// foreach ($sql_options as $key => $val) { //DEBUG |
| 572 | +// print "$key => $val, "; |
| 573 | +// } |
| 574 | +// print "<br />\n"; |
| 575 | +// print $this->m_sortkey . " --> " . $this->m_sortfield . "<br />\n"; //DEBUG |
576 | 576 | |
577 | 577 | // Execute query and format result as array |
578 | 578 | $res = $db->select($from, |