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 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
247 foreach($this->
getResults() as $c_ref_id => $obj_id)
249 $ilBench->start(
'Lucene',
'2100_res');
252 $ilBench->start(
'Lucene',
'2120_tree');
253 if(!$tree->isInTree($ref_id))
257 $ilBench->stop(
'Lucene',
'2120_tree');
269 "s_relevance" => sprintf(
"%03d",$this->
getRelevance($obj_id))
272 $preloader->addItem($obj_id, $obj_type, $ref_id);
274 $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)
308 return $this->searcher->getResult()->getRelevance($a_obj_id);
320 if($this->
getMode() != self::MODE_LUCENE or !is_object($this->searcher->getHighlighter()))
324 if(strlen($title = $this->searcher->getHighlighter()->getTitle($a_obj_id,$a_sub_id)))
338 if($this->
getMode() != self::MODE_LUCENE or !is_object($this->searcher->getHighlighter()))
342 if(strlen($title = $this->searcher->getHighlighter()->getDescription($a_obj_id,$a_sub_id)))
356 if($this->
getMode() != self::MODE_LUCENE or !is_object($this->searcher->getHighlighter()))
360 return $this->searcher->getHighlighter()->getContent($a_obj_id,$a_sub_id);
371 #$rel = $this->appendRelevance($obj_id); 380 $tpl =
new ilTemplate(
'tpl.lucene_additional_information.html',
true,
true,
'Services/Search');
381 $tpl->setVariable(
'SUBITEM',$sub);
386 $tpl->setVariable(
'MORE_PATH',$more);
389 $tpl->setVariable(
'RELEVANCE',$rel);
392 $item_list_gui->setAdditionalInformation(
$tpl->get());
403 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
405 $path_gui->enableTextOnly(
false);
406 $path_gui->setUseImages(
false);
408 $tpl =
new ilTemplate(
'tpl.lucene_path.html',
true,
true,
'Services/Search');
409 $tpl->setVariable(
'PATH_ITEM',$path_gui->getPath(ROOT_FOLDER_ID,$a_ref_id));
419 if($this->
getMode() != self::MODE_LUCENE)
429 $tpl =
new ilTemplate(
'tpl.lucene_more_references.html',
true,
true,
'Services/Search');
430 $this->ctrl->setParameter($this->
getContainer(),
'refs',$a_ref_id);
431 $tpl->setVariable(
'MORE_REFS_LINK',$this->ctrl->getLinkTarget($this->getContainer(),
''));
434 $tpl->setVariable(
'TXT_MORE_REFS',sprintf($this->lng->txt(
'lucene_all_occurrences'),$num_refs));
444 if($this->
getMode() != self::MODE_LUCENE)
454 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
460 $tpl =
new ilTemplate(
'tpl.lucene_relevance.html',
true,
true,
'Services/Search');
463 $width2 = (int) (100 - $width1);
465 $tpl->setCurrentBlock(
'relevance');
466 $tpl->setVariable(
'VAL_REL',sprintf(
"%d %%",$this->
getRelevance($a_obj_id)));
467 $tpl->setVariable(
'WIDTH_A',$width1);
468 $tpl->setVariable(
'WIDTH_B',$width2);
471 $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();
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.
Presentation of search results using object list gui.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
getSubitemIdsByObject($a_obj_id)
Get subitem ids for an object.