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;
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();
510 if(isset($_REQUEST[
'refs']))
512 $_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.
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.
Create styles array
The data for the language used.
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.