4 include_once
'Services/Payment/classes/class.ilPaymentPrices.php';
5 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
6 include_once
'Services/Payment/classes/class.ilFileDataShop.php';
37 $this->type_ordering = array(
38 "cat",
"crs",
"grp",
"lres",
39 "glo",
"webr",
"file",
'mcst',
"exc",
40 "tst",
"svy",
"sess",
"mep",
"qpl",
"spl");
44 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
52 $results = $this->result->getResultsForPresentation();
59 $this->type_ordering = $a_type_ordering_array;
63 return $this->type_ordering;
67 $this->sort_field = $a_sort_field;
75 $this->sort_direction = $a_sort_direction;
84 if ($this->sort_direction !=
'' && $this->sort_field !=
'')
86 switch ($this->sort_field)
92 $numeric_sort =
false;
112 foreach($this->type_ordering as $act_type)
114 $item_html = array();
116 if(count(
$results[$topic[
'id']][$act_type]))
118 foreach(
$results[$topic[
'id']][$act_type] as $key => $item)
125 $results[$topic[
'id']][$act_type][$key][
'price'] = $lowest_price[
'price'];
127 $results[$topic[
'id']][$act_type][$key][
'price_string'] =
128 ($oPrice->getNumberOfPrices() > 1 ? $this->lng->txt(
'price_from').
' ' :
'').
132 include_once
'Services/MetaData/classes/class.ilMD.php';
133 $md_obj =
new ilMD($item[
'obj_id'], 0, $item[
'type']);
134 if(is_object($md_section = $md_obj->getLifecycle()))
136 $sep = $ent_str =
"";
137 foreach(($ids = $md_section->getContributeIds()) as $con_id)
139 $md_con = $md_section->getContribute($con_id);
140 if ($md_con->getRole() ==
"Author")
142 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
144 $md_ent = $md_con->getEntity($ent_id);
145 $ent_str = $ent_str.$sep.$md_ent->getEntity();
150 $results[$topic[
'id']][$act_type][$key][
'author'] = $ent_str;
156 foreach(
$results[$topic[
'id']][$act_type] as $key => $item)
159 if ($cur_obj_type != $item[
'type'])
161 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
165 $item_list_gui->enableDelete(
false);
166 $item_list_gui->enableCut(
false);
167 $item_list_gui->enableCopy(
false);
168 $item_list_gui->enableLink(
false);
169 $item_list_gui->enableSubscribe(
false);
171 $item_list_gui->enablePayment(
true);
172 $item_list_gui->enableCommands(
false);
173 $item_list_gui->enablePath(
false);
174 $item_list_gui->insertCommands();
176 $item_list_gui->enableInfoScreen(
false);
177 $item_list_gui->enableSubstitutions(
false);
178 $item_list_gui->enableNoticeProperties(
false);
179 $item_list_gui->enablePreconditions(
false);
180 $item_list_gui->enableProperties(
false);
181 $item_list_gui->setBoldTitle(
true);
186 $item_list_gui->enableInfoScreen(
true);
187 $item_list_gui->enableCommands(
true);
190 $tpl_pinfo =
new ilTemplate (
'tpl.shop_item_info.html',
true,
true,
'Services/Payment');
191 if($item[
'price_string'] !=
'')
193 $tpl_pinfo->setCurrentBlock(
'ploop');
194 $tpl_pinfo->setVariable(
'PROPERTY', $this->lng->txt(
'price_a'));
195 $tpl_pinfo->setVariable(
'VALUE', $item[
'price_string']);
196 $tpl_pinfo->parseCurrentBlock();
198 if($item[
'author'] !=
'')
200 $tpl_pinfo->setCurrentBlock(
'ploop');
201 $tpl_pinfo->setVariable(
'PROPERTY', $this->lng->txt(
'author'));
202 $tpl_pinfo->setVariable(
'VALUE', $item[
'author']);
203 $tpl_pinfo->parseCurrentBlock();
206 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
208 $tpl_pinfo->setCurrentBlock(
'image');
209 $tpl_pinfo->setVariable(
'SRC', $webpath_file);
210 $tpl_pinfo->setVariable(
'ALT', $item[
'title']);
211 $tpl_pinfo->parseCurrentBlock();
214 $item_list_gui->addSubItemHTML($tpl_pinfo->get());
216 $html = $item_list_gui->getListItemHTML(
226 $item_html[$item[
'ref_id']] = $html;
231 if(count($item_html) > 0)
245 foreach($item_html as
$ref_id => $html)
255 if($items_counter > 0)
257 $oContainerTpl->setCurrentBlock(
'loop');
258 $oContainerTpl->setVariable(
'TOPIC_TITLE', $topic[
'title']);
259 $oContainerTpl->setVariable(
'COTAINER_LIST_BLOCK',
$tpl->get());
260 $oContainerTpl->parseCurrentBlock();
268 $oContainerTpl =
new ilTemplate (
'tpl.shop_container.html',
true,
true,
'Services/Payment');
270 foreach($this->result->getTopics() as $oTopic)
272 $this->
renderItems($oContainerTpl,
$results, array(
'id' => $oTopic->getId(),
'title' => $oTopic->getTitle()));
274 $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
276 return $oContainerTpl->get();
288 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
292 $a_tpl->touchBlock($this->cur_row_type);
293 $a_tpl->setCurrentBlock(
"container_standard_row");
294 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
297 #$a_tpl->setVariable("BLOCK_ROW_CHECK",ilUtil::formCheckbox(0,'result[]',$a_ref_id));
298 #$a_tpl->setVariable("ITEM_ID",$a_ref_id);
299 $a_tpl->parseCurrentBlock();
300 $a_tpl->touchBlock(
"container_row");
311 $tpl =
new ilTemplate (
"tpl.container_list_block.html",
true,
true,
312 "Services/Container");
313 $this->cur_row_type =
"row_type_1";
327 if ($a_type !=
"lres")
330 $title = $this->lng->txt(
"objs_".$a_type);
335 $title = $this->lng->txt(
"learning_resources");
338 $a_tpl->setCurrentBlock(
"container_header_row_image");
339 $a_tpl->setVariable(
"HEADER_IMG", $icon);
340 $a_tpl->setVariable(
"HEADER_ALT",
$title);
341 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT",
$title);
342 $a_tpl->parseCurrentBlock();
345 #$a_tpl->setCurrentBlock("container_header_row");
346 #$a_tpl->parseCurrentBlock();
347 #$a_tpl->touchBlock("container_row");
352 $a_tpl->touchBlock(
"separator_row");
353 $a_tpl->touchBlock(
"container_row");
359 if(!count($item[
'child']))
363 $tpl =
new ilTemplate(
'tpl.detail_links.html',
true,
true,
'Services/Search');
364 $tpl->setVariable(
"HITS",$this->lng->txt(
'search_hits'));
366 switch($item[
'type'])
369 include_once
'Modules/LearningModule/classes/class.ilLMObject.php';
370 foreach($item[
'child'] as $child)
372 $tpl->setCurrentBlock(
"link_row");
377 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'obj_pg'));
380 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'obj_st'));
383 $item_list_gui->setChildId($child);
384 $tpl->setVariable(
"SEPERATOR",
' -> ');
385 $tpl->setVariable(
"LINK",$item_list_gui->getCommandLink(
'page'));
386 $tpl->setVariable(
"TARGET",$item_list_gui->getCommandFrame(
'page'));
388 $tpl->parseCurrentBlock();
393 include_once
'./Modules/Glossary/classes/class.ilGlossaryTerm.php';
395 $this->lng->loadLanguageModule(
'content');
396 foreach($item[
'child'] as $child)
398 $tpl->setCurrentBlock(
"link_row");
399 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'cont_term'));
400 $tpl->setVariable(
"SEPERATOR",
': ');
401 $tpl->setVariable(
"LINK",
ilLink::_getLink($item[
'ref_id'],
'git',array(
'target' =>
'git_'.$child.
'_'.$item[
'ref_id'])));
403 $tpl->parseCurrentBlock();
408 include_once(
"./Services/News/classes/class.ilNewsItem.php");
410 foreach($item[
'child'] as $child)
412 $tpl->setCurrentBlock(
"link_row");
415 $item_list_gui->setChildId($child);
417 $tpl->setVariable(
"LINK", $item_list_gui->getCommandLink(
'listItems'));
418 $tpl->setVariable(
"TARGET", $item_list_gui->getCommandFrame(
''));
420 $tpl->parseCurrentBlock();
428 return $html .
$tpl->get();
433 $this->cur_row_type =
"";