ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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['content'] = (string) ($result_set['content'] ?? '');
43
44 $rows[] = $row;
45 }
46
47 $this->setData($rows);
48 }
49
50 protected function fillRow(array $a_set): void
51 {
52 $this->tpl->setVariable('HREF_ITEM', $a_set['link']);
53 $this->tpl->setVariable('TXT_ITEM_TITLE', $a_set['title']);
54
55 if ($a_set['content'] !== '') {
56 $this->tpl->setVariable('HIGHLIGHT_CONTENT', $a_set['content']);
57 }
58 }
59}
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: shib_login.php:26