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 | |
Protected Attributes | |
| $search_cache = null | |
Definition at line 37 of file class.ilSearchResultPresentationGUI.php.
| ilSearchResultPresentationGUI::__appendChildLinks | ( | $ | html, | |
| $ | item, | |||
| &$ | item_list_gui | |||
| ) |
Definition at line 220 of file class.ilSearchResultPresentationGUI.php.
References $tpl, ilLink::_getLink(), ilGlossaryTerm::_lookGlossaryTerm(), ilObjForum::_lookupThreadSubject(), ilNewsItem::_lookupTitle(), 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 'Modules/LearningModule/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 './Modules/Forum/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;
case 'glo':
include_once './Modules/Glossary/classes/class.ilGlossaryTerm.php';
$this->lng->loadLanguageModule('content');
foreach($item['child'] as $child)
{
$tpl->setCurrentBlock("link_row");
$tpl->setVariable("CHAPTER_PAGE",$this->lng->txt('cont_term'));
$tpl->setVariable("SEPERATOR",': ');
$tpl->setVariable("LINK",ilLink::_getLink($item['ref_id'],'git',array('target' => 'git_'.$child.'_'.$item['ref_id'])));
$tpl->setVariable("TITLE",ilGlossaryTerm::_lookGlossaryTerm($child));
$tpl->parseCurrentBlock();
}
break;
case 'mcst':
include_once("./Services/News/classes/class.ilNewsItem.php");
foreach($item['child'] as $child)
{
$tpl->setCurrentBlock("link_row");
//$tpl->setVariable("CHAPTER_PAGE",$this->lng->txt('item'));
$item_list_gui->setChildId($child);
//$tpl->setVariable("SEPERATOR",': ');
$tpl->setVariable("LINK", $item_list_gui->getCommandLink('listItems'));
$tpl->setVariable("TARGET", $item_list_gui->getCommandFrame(''));
$tpl->setVariable("TITLE", ilNewsItem::_lookupTitle($child));
$tpl->parseCurrentBlock();
}
break;
default:
;
}
return $html . $tpl->get();
}
Here is the call graph for this function:
Here is the caller graph for this function:| 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 146 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");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilSearchResultPresentationGUI::addSeparatorRow | ( | &$ | a_tpl | ) |
Definition at line 214 of file class.ilSearchResultPresentationGUI.php.
Referenced by renderItemList().
{
$a_tpl->touchBlock("separator_row");
$a_tpl->touchBlock("container_row");
}
Here is the caller graph for this function:| 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 183 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");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilSearchResultPresentationGUI::ilSearchResultPresentationGUI | ( | &$ | result | ) |
Definition at line 46 of file class.ilSearchResultPresentationGUI.php.
References $ilCtrl, $lng, $result, $tpl, and ilUserSearchCache::_getInstance().
{
global $tpl,$lng,$ilCtrl,$ilUser;
$this->lng =& $lng;
$this->result =& $result;
$this->type_ordering = array(
"cat", "crs", "grp", "chat", "frm", "lres",
"glo", "webr", "file",'mcst', "exc",
"tst", "svy", "mep", "qpl", "spl");
$this->ctrl =& $ilCtrl;
include_once('Services/Search/classes/class.ilUserSearchCache.php');
$this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
}
Here is the call graph for this function:| & ilSearchResultPresentationGUI::newBlockTemplate | ( | ) |
returns a new list block template
private
Definition at line 206 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;
}
Here is the caller graph for this function:| & ilSearchResultPresentationGUI::renderItemList | ( | &$ | results | ) |
Definition at line 75 of file class.ilSearchResultPresentationGUI.php.
References $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();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilSearchResultPresentationGUI::resetRowType | ( | ) |
Definition at line 171 of file class.ilSearchResultPresentationGUI.php.
Referenced by renderItemList().
{
$this->cur_row_type = "";
}
Here is the caller graph for this function:| & ilSearchResultPresentationGUI::showResults | ( | ) |
Definition at line 65 of file class.ilSearchResultPresentationGUI.php.
References $results, and renderItemList().
{
// Get results
$results = $this->result->getResultsForPresentation();
return $html =& $this->renderItemList($results);
}
Here is the call graph for this function:| ilSearchResultPresentationGUI::$lng |
Definition at line 42 of file class.ilSearchResultPresentationGUI.php.
Referenced by ilSearchResultPresentationGUI().
| ilSearchResultPresentationGUI::$result = 0 |
Definition at line 44 of file class.ilSearchResultPresentationGUI.php.
Referenced by ilSearchResultPresentationGUI().
ilSearchResultPresentationGUI::$search_cache = null [protected] |
Definition at line 39 of file class.ilSearchResultPresentationGUI.php.
| ilSearchResultPresentationGUI::$tpl |
Definition at line 41 of file class.ilSearchResultPresentationGUI.php.
Referenced by __appendChildLinks(), ilSearchResultPresentationGUI(), newBlockTemplate(), and renderItemList().
1.7.1