Public Member Functions | |
ilSearchResultPresentationGUI (&$result) | |
& | showResults () |
& | renderItemList (&$results) |
addHeaderRow (&$a_tpl, $a_type) | |
adds a header row to a block template | |
resetRowType () | |
addStandardRow (&$a_tpl, $a_html, $a_ref_id) | |
adds a standard row to a block template | |
& | newBlockTemplate () |
returns a new list block template | |
addSeparatorRow (&$a_tpl) | |
__appendChildLinks ($html, $item, &$item_list_gui) | |
Data Fields | |
$tpl | |
$lng | |
$result = 0 |
Definition at line 36 of file class.ilSearchResultPresentationGUI.php.
ilSearchResultPresentationGUI::__appendChildLinks | ( | $ | html, | |
$ | item, | |||
&$ | item_list_gui | |||
) |
Definition at line 214 of file class.ilSearchResultPresentationGUI.php.
References $tpl, ilObjForum::_lookupThreadSubject(), ilLMObject::_lookupTitle(), and ilLMObject::_lookupType().
Referenced by renderItemList().
{ if(!count($item['child'])) { return $html; } $tpl = new ilTemplate('tpl.detail_links.html',true,true,'Services/Search'); $tpl->setVariable("HITS",$this->lng->txt('search_hits')); switch($item['type']) { case 'lm': include_once 'content/classes/class.ilLMObject.php'; foreach($item['child'] as $child) { $tpl->setCurrentBlock("link_row"); switch(ilLMObject::_lookupType($child)) { case 'pg': $tpl->setVariable("CHAPTER_PAGE",$this->lng->txt('obj_pg')); break; case 'st': $tpl->setVariable("CHAPTER_PAGE",$this->lng->txt('obj_st')); break; } $item_list_gui->setChildId($child); $tpl->setVariable("SEPERATOR",' -> '); $tpl->setVariable("LINK",$item_list_gui->getCommandLink('page')); $tpl->setVariable("TARGET",$item_list_gui->getCommandFrame('page')); $tpl->setVariable("TITLE",ilLMObject::_lookupTitle($child)); $tpl->parseCurrentBlock(); } break; case 'frm': include_once 'classes/class.ilObjForum.php'; foreach($item['child'] as $child) { $thread_post = explode('_',$child); $tpl->setCurrentBlock("link_row"); $tpl->setVariable("CHAPTER_PAGE",$this->lng->txt('thread')); $item_list_gui->setChildId($thread_post); $tpl->setVariable("SEPERATOR",': '); $tpl->setVariable("LINK",$item_list_gui->getCommandLink('posting')); $tpl->setVariable("TARGET",$item_list_gui->getCommandFrame('')); $tpl->setVariable("TITLE",ilObjForum::_lookupThreadSubject($thread_post[0])); $tpl->parseCurrentBlock(); } break; default: ; } return $html . $tpl->get(); }
ilSearchResultPresentationGUI::addHeaderRow | ( | &$ | a_tpl, | |
$ | a_type | |||
) |
adds a header row to a block template
object | $a_tpl block template | |
string | $a_type object type private |
Definition at line 140 of file class.ilSearchResultPresentationGUI.php.
References $title, and ilUtil::getImagePath().
Referenced by renderItemList().
{ if ($a_type != "lres") { $icon = ilUtil::getImagePath("icon_".$a_type.".gif"); $title = $this->lng->txt("objs_".$a_type); } else { $icon = ilUtil::getImagePath("icon_lm.gif"); $title = $this->lng->txt("learning_resources"); } $a_tpl->setCurrentBlock("container_header_row_image"); $a_tpl->setVariable("HEADER_IMG", $icon); $a_tpl->setVariable("HEADER_ALT", $title); $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title); $a_tpl->parseCurrentBlock(); #$a_tpl->setCurrentBlock("container_header_row"); #$a_tpl->parseCurrentBlock(); #$a_tpl->touchBlock("container_row"); }
ilSearchResultPresentationGUI::addSeparatorRow | ( | &$ | a_tpl | ) |
Definition at line 208 of file class.ilSearchResultPresentationGUI.php.
Referenced by renderItemList().
{ $a_tpl->touchBlock("separator_row"); $a_tpl->touchBlock("container_row"); }
ilSearchResultPresentationGUI::addStandardRow | ( | &$ | a_tpl, | |
$ | a_html, | |||
$ | a_ref_id | |||
) |
adds a standard row to a block template
object | $a_tpl block template | |
string | $a_html html code private |
Definition at line 177 of file class.ilSearchResultPresentationGUI.php.
References ilUtil::formCheckbox().
Referenced by renderItemList().
{ $this->cur_row_type = ($this->cur_row_type == "row_type_1") ? "row_type_2" : "row_type_1"; $a_tpl->touchBlock($this->cur_row_type); $a_tpl->setCurrentBlock("container_standard_row"); $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html); // add checkbox for saving results $a_tpl->setVariable("BLOCK_ROW_CHECK",ilUtil::formCheckbox(0,'result[]',$a_ref_id)); $a_tpl->setVariable("ITEM_ID",$a_ref_id); $a_tpl->parseCurrentBlock(); $a_tpl->touchBlock("container_row"); }
ilSearchResultPresentationGUI::ilSearchResultPresentationGUI | ( | &$ | result | ) |
Definition at line 43 of file class.ilSearchResultPresentationGUI.php.
& ilSearchResultPresentationGUI::newBlockTemplate | ( | ) |
returns a new list block template
private
Definition at line 200 of file class.ilSearchResultPresentationGUI.php.
References $tpl.
Referenced by renderItemList().
{ $tpl =& new ilTemplate ("tpl.container_list_block.html",true, true); $this->cur_row_type = "row_type_1"; return $tpl; }
& ilSearchResultPresentationGUI::renderItemList | ( | &$ | results | ) |
Definition at line 69 of file class.ilSearchResultPresentationGUI.php.
References $key, $ref_id, $results, $tpl, __appendChildLinks(), ilSearchObjectListFactory::_getInstance(), addHeaderRow(), addSeparatorRow(), addStandardRow(), newBlockTemplate(), and resetRowType().
Referenced by showResults().
{ global $objDefinition; $html = ''; $cur_obj_type = ""; $tpl =& $this->newBlockTemplate(); $first = true; foreach($this->type_ordering as $act_type) { $item_html = array(); if (is_array($results[$act_type])) { foreach($results[$act_type] as $key => $item) { // get list gui class for each object type if ($cur_obj_type != $item["type"]) { include_once 'Services/Search/classes/class.ilSearchObjectListFactory.php'; $item_list_gui = ilSearchObjectListFactory::_getInstance($item['type']); } $html = $item_list_gui->getListItemHTML( $item["ref_id"], $item["obj_id"], $item["title"], $item["description"]); if($html) { $html = $this->__appendChildLinks($html,$item,$item_list_gui); $item_html[$item["ref_id"]] = $html; } } // output block for resource type if(count($item_html) > 0) { // separator row if (!$first) { $this->addSeparatorRow($tpl); } $first = false; // add a header for each resource type $this->addHeaderRow($tpl, $act_type); $this->resetRowType(); // content row foreach($item_html as $ref_id => $html) { $this->addStandardRow($tpl, $html, $ref_id); } } } } return $tpl->get(); }
ilSearchResultPresentationGUI::resetRowType | ( | ) |
Definition at line 165 of file class.ilSearchResultPresentationGUI.php.
Referenced by renderItemList().
{
$this->cur_row_type = "";
}
& ilSearchResultPresentationGUI::showResults | ( | ) |
Definition at line 59 of file class.ilSearchResultPresentationGUI.php.
References $results, and renderItemList().
{ // Get results $results = $this->result->getResultsForPresentation(); return $html =& $this->renderItemList($results); }
ilSearchResultPresentationGUI::$lng |
Definition at line 39 of file class.ilSearchResultPresentationGUI.php.
Referenced by ilSearchResultPresentationGUI().
ilSearchResultPresentationGUI::$result = 0 |
Definition at line 41 of file class.ilSearchResultPresentationGUI.php.
Referenced by ilSearchResultPresentationGUI().
ilSearchResultPresentationGUI::$tpl |
Definition at line 38 of file class.ilSearchResultPresentationGUI.php.
Referenced by __appendChildLinks(), ilSearchResultPresentationGUI(), newBlockTemplate(), and renderItemList().