Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | $count = 0; |
174 | 174 | foreach ($objects as $object) { |
175 | 175 | $count += 1; |
176 | | - $html .= $object->getValueDescription(); |
| 176 | + $html .= $object->getLongHTMLText($skin); |
177 | 177 | if ($count<$objectcount) $html .= ", "; |
178 | 178 | } |
179 | 179 | $html .= $vsep."\n"; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_OldDataValue.php |
— | — | @@ -302,19 +302,32 @@ |
303 | 303 | /*********************************************************************/ |
304 | 304 | |
305 | 305 | public function getShortWikiText($linked = NULL) { |
306 | | - return $this->getUserValue(); |
| 306 | + return $this->vuser; |
307 | 307 | } |
308 | 308 | |
309 | 309 | public function getShortHTMLText($linker = NULL) { |
310 | | - return $this->getUserValue(); |
| 310 | + return $this->getShortWikiText(); |
311 | 311 | } |
312 | 312 | |
313 | 313 | public function getLongWikiText($linked = NULL) { |
314 | | - return $this->getValueDescription(); |
| 314 | + // copied from deprecated getValueDescription |
| 315 | + if ($this->description === false) { |
| 316 | + if ($this->error === false) { |
| 317 | + if (count($this->others)>0) { |
| 318 | + $sep = ''; |
| 319 | + foreach ($this->others as $other) { |
| 320 | + $this->description .= $sep . $other; |
| 321 | + if ('' == $sep) $sep = ' ('; else $sep = ', '; |
| 322 | + } |
| 323 | + if (' (' != $sep) $this->description .= ')'; |
| 324 | + } |
| 325 | + } else { $this->description = '<span class="smwwarning">' . $this->error . '</span>'; } |
| 326 | + } |
| 327 | + return $this->description; |
315 | 328 | } |
316 | 329 | |
317 | 330 | public function getLongHTMLText($linker = NULL) { |
318 | | - return $this->getValueDescription(); |
| 331 | + return $this->getLongWikiText(); |
319 | 332 | } |
320 | 333 | |
321 | 334 | /** |
— | — | @@ -329,8 +342,11 @@ |
330 | 343 | * This method might return FALSE if the data value was |
331 | 344 | * initialised not from a user value string and parsing the |
332 | 345 | * given value failed. |
| 346 | + * |
| 347 | + * @DEPRECATED |
333 | 348 | */ |
334 | 349 | function getUserValue() { |
| 350 | + trigger_error("The function getUserValue() is deprecated. Use getShortWikiText() or getShortHTMLText(),", E_USER_NOTICE); |
335 | 351 | return $this->vuser; |
336 | 352 | } |
337 | 353 | |
— | — | @@ -338,8 +354,11 @@ |
339 | 355 | * Return a single value string, obtained by parsing the |
340 | 356 | * supplied user or XSD value. Canonical representation |
341 | 357 | * that includes a unit. Wikitext. |
| 358 | + * |
| 359 | + * @DEPRECATED |
342 | 360 | */ |
343 | 361 | function getStringValue() { |
| 362 | + trigger_error("The function getUserValue() is deprecated. Use getShortWikiText() or getShortHTMLText(),", E_USER_NOTICE); |
344 | 363 | if ( count($this->others) > 0 ) { |
345 | 364 | reset($this->others); |
346 | 365 | return current($this->others); // return first element |
— | — | @@ -409,8 +428,11 @@ |
410 | 429 | * Return the long description of the value, as printed for |
411 | 430 | * example in the factbox. If errors occurred, return the error message |
412 | 431 | * The result always is a wiki-source string. |
| 432 | + * |
| 433 | + * @DEPRECATED |
413 | 434 | */ |
414 | 435 | function getValueDescription() { |
| 436 | + trigger_error("The function getValueDescription() is deprecated. Use getLongWikiText() or getLongHTMLText().", E_USER_NOTICE); |
415 | 437 | if ($this->description === false) { |
416 | 438 | if ($this->error === false) { |
417 | 439 | if (count($this->others)>0) { |
— | — | @@ -454,7 +476,7 @@ |
455 | 477 | * be used to compare different value objects. |
456 | 478 | */ |
457 | 479 | function getHash() { |
458 | | - return $this->getValueDescription() . $this->vxsd . $this->unit; |
| 480 | + return $this->getLongWikiText() . $this->vxsd . $this->unit; |
459 | 481 | // (user_out is needed here to distinguish error messages, which |
460 | 482 | // usually have no XSD and no unit) |
461 | 483 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | * @DEPRECATED |
23 | 23 | */ |
24 | 24 | static function newAttributeValue($attribute, $value=false) { |
| 25 | + trigger_error("The function SMWDataValue::newAttributeValue() is deprecated.", E_USER_NOTICE); |
25 | 26 | return SMWDataValueFactory::newAttributeValue($attribute, $value); |
26 | 27 | } |
27 | 28 | |
— | — | @@ -33,6 +34,7 @@ |
34 | 35 | * @DEPRECATED |
35 | 36 | */ |
36 | 37 | static function newSpecialValue($specialprop, $value=false) { |
| 38 | + trigger_error("The function SMWDataValue::newSpecialValue() is deprecated.", E_USER_NOTICE); |
37 | 39 | return SMWDataValueFactory::newSpecialValue($specialprop, $value); |
38 | 40 | } |
39 | 41 | |
— | — | @@ -44,6 +46,7 @@ |
45 | 47 | * @DEPRECATED |
46 | 48 | */ |
47 | 49 | static function newTypedValue(SMWTypeHandler $type, $value=false) { |
| 50 | + trigger_error("The function SMWDataValue::newTypedValue() is deprecated.", E_USER_NOTICE); |
48 | 51 | return SMWDataValueFactory::newTypeHandlerValue($type, $value); |
49 | 52 | } |
50 | 53 | |
— | — | @@ -55,6 +58,7 @@ |
56 | 59 | * @DEPRECATED |
57 | 60 | */ |
58 | 61 | public function getUserValue() { |
| 62 | + trigger_error("The function SMWDataValue::getUserValue() is deprecated.", E_USER_NOTICE); |
59 | 63 | return $this->getShortWikiText(); |
60 | 64 | } |
61 | 65 | |
— | — | @@ -62,6 +66,7 @@ |
63 | 67 | * @DEPRECATED |
64 | 68 | */ |
65 | 69 | public function getValueDescription() { |
| 70 | + trigger_error("The function SMWDataValue::getValueDescription() is deprecated.", E_USER_NOTICE); |
66 | 71 | return $this->getLongWikiText(); |
67 | 72 | } |
68 | 73 | |
— | — | @@ -69,6 +74,7 @@ |
70 | 75 | * @DEPRECATED |
71 | 76 | */ |
72 | 77 | public function getTooltip() { |
| 78 | + //trigger_error("The function SMWDataValue::getTooltip() is deprecated.", E_USER_NOTICE); |
73 | 79 | return ''; |
74 | 80 | } |
75 | 81 | |
Index: trunk/extensions/SemanticMediaWiki/includes/articlepages/SMW_PropertyPage.php |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | } |
157 | 157 | $i++; |
158 | 158 | if ($i < 4) { |
159 | | - $r .= $value->getValueDescription(); |
| 159 | + $r .= $value->getLongHTMLText($this->getSkin()); |
160 | 160 | $sep = ' '; |
161 | 161 | foreach ($value->getInfolinks() as $link) { |
162 | 162 | $r .= $sep . $link->getHTML($this->getSkin()); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | $sql, 'SMW::getAttributeValues', $this->getSQLOptions($requestoptions,$value_column) ); |
187 | 187 | if($db->numRows( $res ) > 0) { |
188 | 188 | while($row = $db->fetchObject($res)) { |
189 | | - $dv = SMWDataValue::newTypedValue(SMWTypeHandlerFactory::getTypeHandlerByID($row->value_datatype)); |
| 189 | + $dv = SMWDataValueFactory::newTypehandlerValue(SMWTypeHandlerFactory::getTypeHandlerByID($row->value_datatype)); |
190 | 190 | $dv->setAttribute($attribute->getText()); |
191 | 191 | $dv->setXSDValue($row->value_xsd, $row->value_unit); |
192 | 192 | $result[] = $dv; |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | 'SMW::getAttributeValues', $this->getSQLOptions($requestoptions,$value_column) ); |
203 | 203 | if($db->numRows( $res ) > 0) { |
204 | 204 | while($row = $db->fetchObject($res)) { |
205 | | - $dv = SMWDataValue::newTypedValue(SMWTypeHandlerFactory::getTypeHandlerByID('text')); |
| 205 | + $dv = SMWDataValueFactory::newTypehandlerValue(SMWTypeHandlerFactory::getTypeHandlerByID('text')); |
206 | 206 | $dv->setAttribute($attribute->getText()); |
207 | 207 | $dv->setXSDValue($row->value_blob, ''); |
208 | 208 | $result[] = $dv; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | } |
60 | 60 | |
61 | 61 | public function getShortHTMLText($linker = NULL) { |
| 62 | + ///TODO Support linking |
62 | 63 | return implode(', ', $this->m_typevalues); |
63 | 64 | } |
64 | 65 | |