4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
20 function __construct($a_parent_obj, $a_parent_cmd, $a_presenter)
24 $this->presenter = $a_presenter;
25 parent::__construct($a_parent_obj, $a_parent_cmd);
26 $this->
setTitle($lng->txt(
"search_results"));
31 #$this->addColumn($this->lng->txt("type"), "type", "1"); 32 #$this->addColumn($this->lng->txt("search_title_description"), "title_sort"); 33 $this->
addColumn($this->lng->txt(
"type"),
"type",
"1");
34 $this->
addColumn($this->lng->txt(
"search_title_description"),
"title");
37 #$this->addColumn($this->lng->txt('lucene_relevance_short'),'s_relevance','50px'); 38 $this->
addColumn($this->lng->txt(
'lucene_relevance_short'),
'relevance',
'50px');
42 $this->
addColumn($this->lng->txt(
"actions"),
"",
"10px");
46 $this->
setRowTemplate(
"tpl.search_result_row.html",
"Services/Search");
51 include_once
"Services/Object/classes/class.ilObjectActivation.php";
63 return parent::numericOrdering($a_field);
71 global
$lng, $objDefinition;
73 $obj_id = $a_set[
"obj_id"];
75 $type = $a_set[
'type'];
77 $description = $a_set[
'description'];
78 $relevance = $a_set[
'relevance'];
85 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchObjectListGUIFactory.php';
87 $item_list_gui->initItem(
$ref_id,$obj_id,
$title,$description);
88 $item_list_gui->setContainerObject($this->parent_obj);
89 $item_list_gui->setSearchFragment($this->presenter->lookupContent($obj_id,0));
90 $item_list_gui->setSeparateCommands(
true);
94 $this->presenter->appendAdditionalInformation($item_list_gui,
$ref_id,$obj_id,$type);
96 $this->tpl->setVariable(
"ACTION_HTML", $item_list_gui->getCommandsHTML());
98 if($html = $item_list_gui->getListItemHTML(
$ref_id,$obj_id,
$title,$description))
100 $item_html[
$ref_id][
'html'] = $html;
101 $item_html[
$ref_id][
'type'] = $type;
104 $this->tpl->setVariable(
"HREF_IMG", $item_list_gui->default_command[
"link"]);
110 $width1 = (int) ((
int) $relevance / 2);
111 $width2 = (int) ((50 - $width1));
113 $this->tpl->setCurrentBlock(
'relev');
114 $this->tpl->setVariable(
'VAL_REL',sprintf(
"%d %%",$relevance));
115 $this->tpl->setVariable(
'WIDTH_A',$width1);
116 $this->tpl->setVariable(
'WIDTH_B',$width2);
119 $this->tpl->parseCurrentBlock();
122 $this->tpl->setVariable(
"ITEM_HTML", $html);
124 if(!$objDefinition->isPlugin($type))
126 $type_txt = $lng->txt(
'icon').
' '.$lng->txt(
'obj_'.$type);
131 include_once(
"./Services/Component/classes/class.ilPlugin.php");
136 $this->tpl->setVariable(
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
setEnableNumInfo($a_val)
Set enable num info.
TableGUI class for search results.
enabledRelevance()
Check if relevance is visible.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
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="")
Add a column to the header.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action)
Set Form action parameter.
__construct($a_parent_obj, $a_parent_cmd, $a_presenter)
Constructor.
numericOrdering($a_field)
setEnableHeader($a_enableheader)
Set Enable Header.
fillRow($a_set)
Fill table row.
setEnableTitle($a_enabletitle)
Set Enable Title.
static factory($a_type)
Get list gui by type This method caches all the returned list guis.