ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilRepositoryObjectSearchResultTableGUI.php
Go to the documentation of this file.
1<?php
2
3include_once './Services/Table/classes/class.ilTable2GUI.php';
4
6{
7 private $settings = null;
8 protected $ref_id = 0;
9 private $search_term = '';
10
11 private $results = null;
12
18 public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
19 {
21 $this->ref_id = $a_ref_id;
22 $this->setId('repository_object_search_result_' . $this->ref_id);
23 parent::__construct($a_parent_obj, $a_parent_cmd);
24 }
25
30 public function setSearchTerm($a_term)
31 {
32 $this->search_term = $a_term;
33 }
34
39 public function getSearchTerm()
40 {
41 return $this->search_term;
42 }
43
48 public function getSettings()
49 {
50 return $this->settings;
51 }
52
58 {
59 $this->results = $a_result;
60 }
61
62 public function getResults()
63 {
64 return $this->results;
65 }
66
70 public function init()
71 {
72 $this->initColumns();
73 $this->initRowTemplate();
74
75 global $DIC;
76
77 $ilCtrl = $DIC['ilCtrl'];
78 $lng = $DIC['lng'];
79
80 $this->setEnableHeader(true);
81 $this->setShowRowsSelector(false);
82 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
83 $this->setLimit(0);
84
85 $this->setTitle($lng->txt('search_results') . ' "' . str_replace(array('"'), '', $this->getSearchTerm()) . '"');
86 }
87
91 protected function initColumns()
92 {
93 global $DIC;
94
95 $lng = $DIC['lng'];
96
97
98 if ($this->getSettings()->enabledLucene()) {
99 $lng->loadLanguageModule('search');
100 #$this->addColumn($lng->txt("title"), "title", "80%");
101 #$this->addColumn($lng->txt("lucene_relevance_short"), "relevance", "20%");
102 $this->addColumn($lng->txt("title"), "", "80%");
103 $this->addColumn($lng->txt("lucene_relevance_short"), "", "20%");
104 } else {
105 $this->addColumn($lng->txt("title"), "", "100%");
106 }
107 }
108
112 protected function initRowTemplate()
113 {
114 $this->setRowTemplate('tpl.repository_object_search_result_row.html', 'Services/Search');
115 }
116
117
121 abstract public function parse();
122
123
127 public function getRelevanceHTML($a_rel)
128 {
129 $tpl = new ilTemplate('tpl.lucene_relevance.html', true, true, 'Services/Search');
130
131 include_once "Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
133 $pbar->setCurrent($a_rel);
134
135 $tpl->setCurrentBlock('relevance');
136 $tpl->setVariable('REL_PBAR', $pbar->render());
137 $tpl->parseCurrentBlock();
138
139 return $tpl->get();
140 }
141}
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Factory.
setResults(ilRepositoryObjectDetailSearchResult $a_result)
Set result object.
parse()
Parse search result set and call set data.
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
Constructor.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
special template class to simplify handling of ITX/PEAR
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46