59 $this->mode = $a_mode;
66 if(isset(
$_GET[
'details']))
68 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
92 $this->results = $a_result_data;
101 return $this->results ? $this->results : array();
112 $this->subitem_ids = $a_subids;
121 return $this->subitem_ids ? $this->subitem_ids : array();
131 return (isset($this->subitem_ids[$a_obj_id]) and $this->subitem_ids[$a_obj_id]) ?
132 $this->subitem_ids[$a_obj_id] :
155 if(!$ilAccess->checkAccess(
'read',
'',$new_ref))
159 $this->all_references[
$ref_id][] = $new_ref;
162 $this->has_more_ref_ids[
$ref_id] = $counter;
168 if(!isset($this->has_more_ref_ids[$a_ref_id]) or
169 !$this->has_more_ref_ids[$a_ref_id] or
170 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]))
182 return $this->all_references[$a_ref_id] ? $this->all_references[$a_ref_id] : array();
186 return array($a_ref_id);
206 $this->searcher = $a_searcher;
239 $ilBench->start(
'Lucene',
'2000_pr');
241 $ilBench->stop(
'Lucene',
'2000_pr');
243 $lng->loadLanguageModule(
"cntr");
245 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
249 foreach($this->
getResults() as $c_ref_id => $obj_id)
251 $ilBench->start(
'Lucene',
'2100_res');
254 $ilBench->start(
'Lucene',
'2120_tree');
255 if(!$tree->isInTree($ref_id))
259 $ilBench->stop(
'Lucene',
'2120_tree');
271 "s_relevance" => sprintf(
"%03d",$this->
getRelevance($obj_id))
274 $preloader->addItem($obj_id, $obj_type, $ref_id);
276 $ilBench->stop(
'Lucene',
'2100_res');
284 $preloader->preload();
287 $ilBench->start(
'Lucene',
'2900_tb');
288 include_once(
"./Services/Search/classes/class.ilSearchResultTableGUI.php");
290 $result_table->setCustomPreviousNext($this->prev, $this->next);
292 $result_table->setData($set);
293 $this->thtml = $result_table->getHTML();
294 $ilBench->stop(
'Lucene',
'2900_tb');
308 if($this->
getMode() == self::MODE_LUCENE)
310 return $this->searcher->getResult()->getRelevance($a_obj_id);
322 if($this->
getMode() != self::MODE_LUCENE or !is_object($this->searcher->getHighlighter()))
326 if(strlen($title = $this->searcher->getHighlighter()->getTitle($a_obj_id,$a_sub_id)))
340 if($this->
getMode() != self::MODE_LUCENE or !is_object($this->searcher->getHighlighter()))
344 if(strlen($title = $this->searcher->getHighlighter()->getDescription($a_obj_id,$a_sub_id)))
358 if($this->
getMode() != self::MODE_LUCENE or !is_object($this->searcher->getHighlighter()))
362 return $this->searcher->getHighlighter()->getContent($a_obj_id,$a_sub_id);
373 #$rel = $this->appendRelevance($obj_id);
382 $tpl =
new ilTemplate(
'tpl.lucene_additional_information.html',
true,
true,
'Services/Search');
383 $tpl->setVariable(
'SUBITEM',$sub);
388 $tpl->setVariable(
'MORE_PATH',$more);
391 $tpl->setVariable(
'RELEVANCE',$rel);
394 $item_list_gui->setAdditionalInformation(
$tpl->get());
405 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
407 $path_gui->enableTextOnly(
false);
408 $path_gui->setUseImages(
false);
410 $tpl =
new ilTemplate(
'tpl.lucene_path.html',
true,
true,
'Services/Search');
411 $tpl->setVariable(
'PATH_ITEM',$path_gui->getPath(ROOT_FOLDER_ID,$a_ref_id));
421 if($this->
getMode() != self::MODE_LUCENE)
431 $tpl =
new ilTemplate(
'tpl.lucene_more_references.html',
true,
true,
'Services/Search');
432 $this->ctrl->setParameter($this->
getContainer(),
'refs',$a_ref_id);
433 $tpl->setVariable(
'MORE_REFS_LINK',$this->ctrl->getLinkTarget($this->getContainer(),
''));
436 $tpl->setVariable(
'TXT_MORE_REFS',sprintf($this->lng->txt(
'lucene_all_occurrences'),$num_refs));
446 if($this->
getMode() != self::MODE_LUCENE)
456 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
462 $tpl =
new ilTemplate(
'tpl.lucene_relevance.html',
true,
true,
'Services/Search');
464 include_once
"Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php";
468 $this->tpl->setCurrentBlock(
'relevance');
469 $this->tpl->setVariable(
'REL_PBAR', $pbar->render());
470 $this->tpl->parseCurrentBlock();
483 if($this->
getMode() == self::MODE_STANDARD)
488 elseif(is_object($this->searcher->getHighlighter()))
490 $subitem_ids = $this->searcher->getHighlighter()->getSubitemIds($obj_id);
491 $highlighter = $this->searcher->getHighlighter();
500 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSubItemListGUIFactory.php';
502 $sub_list->setHighlighter($highlighter);
504 return $sub_list->getHTML();