ILIAS  release_8 Revision v8.24
class.ilObjForumSearchResultTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 public function parse(): void
24 {
25 global $DIC;
26
27 $valid_threads = ilForum::getSortedThreadSubjects($DIC['ilObjDataCache']->lookupObjId($this->ref_id));
28
29 $rows = [];
30 foreach ($this->getResults()->getResults() as $result_set) {
31 if (!array_key_exists($result_set['item_id'], $valid_threads)) {
32 continue;
33 }
34
35 $row = [];
36
37 $row['title'] = $valid_threads[$result_set['item_id']];
38
39 $DIC->ctrl()->setParameterByClass(ilObjForumGUI::class, 'thr_pk', $result_set['item_id']);
40 $row['link'] = $DIC->ctrl()->getLinkTargetByClass(ilObjForumGUI::class, 'viewThread');
41
42 $row['relevance'] = (float) ($result_set['relevance'] ?? 0.0);
43 $row['content'] = (string) ($result_set['content'] ?? '');
44
45 $rows[] = $row;
46 }
47
48 $this->setData($rows);
49 }
50
51 protected function fillRow(array $a_set): void
52 {
53 $this->tpl->setVariable('HREF_ITEM', $a_set['link']);
54 $this->tpl->setVariable('TXT_ITEM_TITLE', $a_set['title']);
55
56 if ($this->getSettings()->enabledLucene()) {
57 $this->tpl->setVariable('RELEVANCE', $this->getRelevanceHTML($a_set['relevance']));
58 }
59
60 if ($a_set['content'] !== '') {
61 $this->tpl->setVariable('HIGHLIGHT_CONTENT', $a_set['content']);
62 }
63 }
64}
static getSortedThreadSubjects(int $a_obj_id, int $a_sort_mode=self::SORT_DATE)
fillRow(array $a_set)
Standard Version of Fill Row.
setData(array $a_data)
Set table data.
global $DIC
Definition: feed.php:28
$rows
Definition: xhr_table.php:10