63 $this->mode = $a_mode;
70 if (isset(
$_GET[
'details'])) {
71 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
95 $this->results = $a_result_data;
104 return $this->results ? $this->results : array();
115 $this->subitem_ids = $a_subids;
124 return $this->subitem_ids ? $this->subitem_ids : array();
134 return (isset($this->subitem_ids[$a_obj_id])
and $this->subitem_ids[$a_obj_id]) ?
135 $this->subitem_ids[$a_obj_id] :
148 $ilAccess = $DIC[
'ilAccess'];
150 foreach ($this->
getResults() as $ref_id => $obj_id) {
151 $this->all_references[$ref_id][] = $ref_id;
154 if ($new_ref == $ref_id) {
157 if (!$ilAccess->checkAccess(
'read',
'', $new_ref)) {
160 $this->all_references[$ref_id][] = $new_ref;
163 $this->has_more_ref_ids[$ref_id] = $counter;
169 if (!isset($this->has_more_ref_ids[$a_ref_id])
or 170 !$this->has_more_ref_ids[$a_ref_id]
or 171 isset(
$_SESSION[
'vis_references'][$a_ref_id])) {
175 return $this->has_more_ref_ids[$a_ref_id];
180 if (isset(
$_SESSION[
'vis_references'][$a_ref_id])) {
181 return $this->all_references[$a_ref_id] ? $this->all_references[$a_ref_id] : array();
183 return array($a_ref_id);
203 $this->searcher = $a_searcher;
234 $tree = $DIC[
'tree'];
240 $ilBench->start(
'Lucene',
'2000_pr');
242 $ilBench->stop(
'Lucene',
'2000_pr');
244 $lng->loadLanguageModule(
"cntr");
246 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
250 foreach ($this->
getResults() as $c_ref_id => $obj_id) {
251 $ilBench->start(
'Lucene',
'2100_res');
253 $ilBench->start(
'Lucene',
'2120_tree');
254 if (!
$tree->isInTree($ref_id)) {
257 $ilBench->stop(
'Lucene',
'2120_tree');
269 "s_relevance" => sprintf(
"%03d", $this->
getRelevance($obj_id)),
273 $preloader->addItem($obj_id, $obj_type, $ref_id);
275 $ilBench->stop(
'Lucene',
'2100_res');
282 $preloader->preload();
285 $ilBench->start(
'Lucene',
'2900_tb');
286 include_once(
"./Services/Search/classes/class.ilSearchResultTableGUI.php");
288 $result_table->setCustomPreviousNext($this->prev, $this->next);
290 $result_table->setData($set);
291 $this->thtml = $result_table->getHTML();
292 $ilBench->stop(
'Lucene',
'2900_tb');
306 if ($this->
getMode() == self::MODE_LUCENE) {
307 return $this->searcher->getResult()->getRelevance($a_obj_id);
319 if ($this->
getMode() != self::MODE_LUCENE
or !is_object($this->searcher->getHighlighter())) {
322 if (strlen(
$title = $this->searcher->getHighlighter()->getTitle($a_obj_id, $a_sub_id))) {
335 if ($this->
getMode() != self::MODE_LUCENE
or !is_object($this->searcher->getHighlighter())) {
338 if (strlen(
$title = $this->searcher->getHighlighter()->getDescription($a_obj_id, $a_sub_id))) {
351 if ($this->
getMode() != self::MODE_LUCENE
or !is_object($this->searcher->getHighlighter())) {
354 return $this->searcher->getHighlighter()->getContent($a_obj_id, $a_sub_id);
365 #$rel = $this->appendRelevance($obj_id); 367 if (!strlen($sub)
and 373 $tpl =
new ilTemplate(
'tpl.lucene_additional_information.html',
true,
true,
'Services/Search');
374 $tpl->setVariable(
'SUBITEM', $sub);
379 $tpl->setVariable(
'MORE_PATH', $more);
382 $tpl->setVariable(
'RELEVANCE', $rel);
385 $item_list_gui->setAdditionalInformation(
$tpl->get());
396 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
398 $path_gui->enableTextOnly(
false);
399 $path_gui->setUseImages(
false);
401 $tpl =
new ilTemplate(
'tpl.lucene_path.html',
true,
true,
'Services/Search');
402 $tpl->setVariable(
'PATH_ITEM', $path_gui->getPath(ROOT_FOLDER_ID, $a_ref_id));
412 if ($this->
getMode() != self::MODE_LUCENE) {
420 $tpl =
new ilTemplate(
'tpl.lucene_more_references.html',
true,
true,
'Services/Search');
421 $this->ctrl->setParameter($this->
getContainer(),
'refs', $a_ref_id);
422 $tpl->setVariable(
'MORE_REFS_LINK', $this->ctrl->getLinkTarget($this->getContainer(),
''));
425 $tpl->setVariable(
'TXT_MORE_REFS', sprintf($this->lng->txt(
'lucene_all_occurrences'), $num_refs));
435 if ($this->
getMode() != self::MODE_LUCENE) {
443 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
448 $tpl =
new ilTemplate(
'tpl.lucene_relevance.html',
true,
true,
'Services/Search');
450 include_once
"Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
454 $this->tpl->setCurrentBlock(
'relevance');
455 $this->tpl->setVariable(
'REL_PBAR', $pbar->render());
456 $this->tpl->parseCurrentBlock();
469 if ($this->
getMode() == self::MODE_STANDARD) {
472 } elseif (is_object($this->searcher->getHighlighter())) {
473 $subitem_ids = $this->searcher->getHighlighter()->getSubitemIds($obj_id);
474 $highlighter = $this->searcher->getHighlighter();
482 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSubItemListGUIFactory.php';
484 $sub_list->setHighlighter($highlighter);
486 return $sub_list->getHTML();
491 if (isset($_REQUEST[
'refs'])) {
492 $_SESSION[
'vis_references'][(int) $_REQUEST[
'refs']] = (
int) $_REQUEST[
'refs'];
appendMorePathes($a_ref_id)
Append more occurences link.
Creates a path for a start and endnode.
hasMoreReferences($a_ref_id)
parseResultReferences()
Check if more than one reference is visible.
lookupDescription($a_obj_id, $a_sub_id)
getHTML($a_new=false)
Get HTML.
setSearcher($a_searcher)
set searcher
static getInstanceByType($a_type, $a_cmd_class)
get instance by type
getSubitemIds()
Get subitem ids.
TableGUI class for search results.
static _lookupTitle($a_id)
lookup object title
appendAdditionalInformation($item_list_gui, $ref_id, $obj_id, $type)
Append path, relevance information.
lookupTitle($a_obj_id, $a_sub_id)
static _getAllReferences($a_id)
get all reference ids of object
getContainer()
Get container gui.
appendRelevance($a_obj_id)
Append relevance.
Preloader for object list GUIs.
appendPath($a_ref_id)
Append path.
static getInstance()
Factory.
Presentation of search results using object list gui.
static _lookupCreationDate($a_id)
Lookup creation date.
setResults($a_result_data)
Set result array.
static _lookupDescription($a_id)
lookup object description
appendSubItems($item_list_gui, $ref_id, $obj_id, $a_type)
Append subitems.
getRelevance($a_obj_id)
get relevance
special template class to simplify handling of ITX/PEAR
renderItemList()
Render item list.
getAllReferences($a_ref_id)
static setShowDetails($a_obj_id)
set show details.
setPreviousNext($a_p, $a_n)
Set previous next.
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct($container=null, $a_mode=self::MODE_LUCENE)
Constructor.
lookupContent($a_obj_id, $a_sub_id)
get content
setSubitemIds($a_subids)
Set subitem ids Used for like and fulltext search.
getSubitemIdsByObject($a_obj_id)
Get subitem ids for an object.