ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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  {
19  global $ilCtrl, $ilObjDataCache;
20 
21  $valid_threads = ilForum::_getThreads($ilObjDataCache->lookupObjId($this->ref_id));
22 
23  $rows = array();
24  foreach($this->getResults()->getResults() as $result_set)
25  {
26  if(!array_key_exists($result_set['item_id'], $valid_threads))
27  {
28  continue;
29  }
30 
31  $row = array();
32 
33  $row['title'] = $valid_threads[$result_set['item_id']];
34 
35  $ilCtrl->setParameterByClass('ilObjForumGUI', 'thr_pk', $result_set['item_id']);
36  $row['link'] = $ilCtrl->getLinkTargetByClass('ilObjForumGUI', 'viewThread');
37 
38  $row['relevance'] = $result_set['relevance'];
39  $row['content'] = $result_set['content'];
40 
41  $rows[] = $row;
42  }
43 
44  $this->setData($rows);
45  }
46 
51  public function fillRow(array $a_set)
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  {
58  $this->tpl->setVariable('RELEVANCE', $this->getRelevanceHTML($a_set['relevance']));
59  }
60  if(strlen($a_set['content']))
61  {
62  $this->tpl->setVariable('HIGHLIGHT_CONTENT',$a_set['content']);
63  }
64  }
65 }
global $ilCtrl
Definition: ilias.php:18
static _getThreads($a_obj_id, $a_sort_mode=self::SORT_DATE)
Get thread infos of object.
Class ilObjForumSearchResultTableGUI.
parse()
Parse search result set and call set data.