ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjForumSearchResultTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Search/classes/class.ilRepositoryObjectSearchResultTableGUI.php';
5 
10 {
14  public function parse()
15  {
16  global $DIC;
17 
18  $valid_threads = ilForum::_getThreads($DIC['ilObjDataCache']->lookupObjId($this->ref_id));
19 
20  $rows = array();
21  foreach ($this->getResults()->getResults() as $result_set) {
22  if (!array_key_exists($result_set['item_id'], $valid_threads)) {
23  continue;
24  }
25 
26  $row = array();
27 
28  $row['title'] = $valid_threads[$result_set['item_id']];
29 
30  $DIC->ctrl()->setParameterByClass('ilObjForumGUI', 'thr_pk', $result_set['item_id']);
31  $row['link'] = $DIC->ctrl()->getLinkTargetByClass('ilObjForumGUI', 'viewThread');
32 
33  $row['relevance'] = $result_set['relevance'];
34  $row['content'] = $result_set['content'];
35 
36  $rows[] = $row;
37  }
38 
39  $this->setData($rows);
40  }
41 
46  public function fillRow($a_set)
47  {
48  $this->tpl->setVariable('HREF_ITEM', $a_set['link']);
49  $this->tpl->setVariable('TXT_ITEM_TITLE', $a_set['title']);
50 
51  if ($this->getSettings()->enabledLucene()) {
52  $this->tpl->setVariable('RELEVANCE', $this->getRelevanceHTML($a_set['relevance']));
53  }
54  if (strlen($a_set['content'])) {
55  $this->tpl->setVariable('HIGHLIGHT_CONTENT', $a_set['content']);
56  }
57  }
58 }
global $DIC
Definition: saml.php:7
static _getThreads($a_obj_id, $a_sort_mode=self::SORT_DATE)
Get thread infos of object.
Create styles array
The data for the language used.
$rows
Definition: xhr_table.php:10
Class ilObjForumSearchResultTableGUI.