Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | /** |
47 | 47 | * Checks whether it conforms to the given schema of print requests, adds the |
48 | 48 | * row to the result, and returns true. Otherwise returns false. |
49 | | - * TODO: should we just skip the checks and trust our callers? |
| 49 | + * @todo Should we just skip the checks and trust our callers? |
50 | 50 | */ |
51 | 51 | public function addRow($row) { |
52 | 52 | reset($row); |
— | — | @@ -177,7 +177,7 @@ |
178 | 178 | * Return URL of a page that displays those search results |
179 | 179 | * (and enables browsing results, and is accessible even without |
180 | 180 | * JavaScript enabled browsers). |
181 | | - * @deprecated use SMWQueryResult::getQueryLink() in SMW >1.1 |
| 181 | + * @deprecated Use SMWQueryResult::getQueryLink() in SMW >1.1. This method will last be available in SMW 1.3 and vanish thereafter. |
182 | 182 | */ |
183 | 183 | public function getQueryURL() { |
184 | 184 | $title = Title::makeTitle(NS_SPECIAL, 'ask'); |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | * Return titlestring of a page that displays those search results |
208 | 208 | * (and enables browsing results, and is accessible even without |
209 | 209 | * JavaScript enabled browsers). |
210 | | - * @deprecated use SMWQueryResult::getQueryLink() in SMW >1.1 |
| 210 | + * @deprecated use SMWQueryResult::getQueryLink() in SMW >1.1. This method will last be available in SMW 1.3 and vanish thereafter. |
211 | 211 | */ |
212 | 212 | public function getQueryTitle($prefixed = true) { |
213 | 213 | if ($prefixed) { |
— | — | @@ -243,8 +243,7 @@ |
244 | 244 | |
245 | 245 | /** |
246 | 246 | * Container for the contents of a single result field of a query result, |
247 | | - * i.e. basically an array of Titles or SMWDataValues with some additional |
248 | | - * parameters. |
| 247 | + * i.e. basically an array of SMWDataValues with some additional parameters. |
249 | 248 | */ |
250 | 249 | class SMWResultArray { |
251 | 250 | protected $printrequest; |
— | — | @@ -277,41 +276,59 @@ |
278 | 277 | |
279 | 278 | /** |
280 | 279 | * Return the main text representation of the next result object |
281 | | - * (Title or SMWDataValue) as HTML. |
| 280 | + * (Title or SMWDataValue) in the specified format. |
282 | 281 | * |
283 | 282 | * The parameter $linker controls linking of title values and should |
284 | | - * be some Linker object (or NULL for no linking). |
285 | | - * @deprecated Use SMWResultArray::getNextText() |
| 283 | + * be some Linker object (or NULL for no linking). At some stage its |
| 284 | + * interpretation should be part of the generalised SMWDataValue. |
286 | 285 | */ |
287 | | - public function getNextHTMLText($linker = NULL) { |
| 286 | + public function getNextText($outputmode, $linker = NULL) { |
288 | 287 | $object = current($this->content); |
289 | 288 | next($this->content); |
290 | 289 | if ($object instanceof SMWDataValue) { //print data values |
291 | 290 | if ($object->getTypeID() == '_wpg') { // prefer "long" text for page-values |
292 | | - return $object->getLongHTMLText($linker); |
| 291 | + return $object->getLongText($outputmode, $linker); |
293 | 292 | } else { |
294 | | - return $object->getShortHTMLText($linker); |
| 293 | + return $object->getShortText($outputmode, $linker); |
295 | 294 | } |
296 | 295 | } else { |
297 | 296 | return false; |
298 | 297 | } |
299 | 298 | } |
300 | 299 | |
| 300 | + |
301 | 301 | /** |
| 302 | + * Would there be more query results that were |
| 303 | + * not shown due to a limit? |
| 304 | + */ |
| 305 | + public function hasFurtherResults() { |
| 306 | + return $this->furtherres; |
| 307 | + } |
| 308 | + |
| 309 | + /** |
| 310 | + * Return an SMWPrintRequest object describing what is contained in this |
| 311 | + * result set. |
| 312 | + */ |
| 313 | + public function getPrintRequest() { |
| 314 | + return $this->printrequest; |
| 315 | + } |
| 316 | + |
| 317 | + /** |
302 | 318 | * Return the main text representation of the next result object |
303 | | - * (Title or SMWDataValue) as Wikitext. The parameter $linked controls |
304 | | - * linking of title values and should be non-NULL and non-false if this |
305 | | - * is desired. |
306 | | - * @deprecated Use SMWResultArray::getNextText() |
| 319 | + * (Title or SMWDataValue) as HTML. |
| 320 | + * |
| 321 | + * The parameter $linker controls linking of title values and should |
| 322 | + * be some Linker object (or NULL for no linking). |
| 323 | + * @deprecated Use SMWResultArray::getNextText(). This method will last be available in SMW 1.3 and vanish thereafter. |
307 | 324 | */ |
308 | | - public function getNextWikiText($linked = NULL) { |
| 325 | + public function getNextHTMLText($linker = NULL) { |
309 | 326 | $object = current($this->content); |
310 | 327 | next($this->content); |
311 | 328 | if ($object instanceof SMWDataValue) { //print data values |
312 | 329 | if ($object->getTypeID() == '_wpg') { // prefer "long" text for page-values |
313 | | - return $object->getLongWikiText($linked); |
| 330 | + return $object->getLongHTMLText($linker); |
314 | 331 | } else { |
315 | | - return $object->getShortWikiText($linked); |
| 332 | + return $object->getShortHTMLText($linker); |
316 | 333 | } |
317 | 334 | } else { |
318 | 335 | return false; |
— | — | @@ -320,41 +337,24 @@ |
321 | 338 | |
322 | 339 | /** |
323 | 340 | * Return the main text representation of the next result object |
324 | | - * (Title or SMWDataValue) in the specified format. |
325 | | - * |
326 | | - * The parameter $linker controls linking of title values and should |
327 | | - * be some Linker object (or NULL for no linking). At some stage its |
328 | | - * interpretation should be part of the generalised SMWDataValue. |
| 341 | + * (Title or SMWDataValue) as Wikitext. The parameter $linked controls |
| 342 | + * linking of title values and should be non-NULL and non-false if this |
| 343 | + * is desired. |
| 344 | + * @deprecated Use SMWResultArray::getNextText(). This method will last be available in SMW 1.3 and vanish thereafter. |
329 | 345 | */ |
330 | | - public function getNextText($outputmode, $linker = NULL) { |
| 346 | + public function getNextWikiText($linked = NULL) { |
331 | 347 | $object = current($this->content); |
332 | 348 | next($this->content); |
333 | 349 | if ($object instanceof SMWDataValue) { //print data values |
334 | 350 | if ($object->getTypeID() == '_wpg') { // prefer "long" text for page-values |
335 | | - return $object->getLongText($outputmode, $linker); |
| 351 | + return $object->getLongWikiText($linked); |
336 | 352 | } else { |
337 | | - return $object->getShortText($outputmode, $linker); |
| 353 | + return $object->getShortWikiText($linked); |
338 | 354 | } |
339 | 355 | } else { |
340 | 356 | return false; |
341 | 357 | } |
342 | 358 | } |
343 | 359 | |
344 | | - |
345 | | - /** |
346 | | - * Would there be more query results that were |
347 | | - * not shown due to a limit? |
348 | | - */ |
349 | | - public function hasFurtherResults() { |
350 | | - return $this->furtherres; |
351 | | - } |
352 | | - |
353 | | - /** |
354 | | - * Return an SMWPrintRequest object describing what is contained in this |
355 | | - * result set. |
356 | | - */ |
357 | | - public function getPrintRequest() { |
358 | | - return $this->printrequest; |
359 | | - } |
360 | 360 | } |
361 | 361 | |