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';
7 include_once
'Services/Payment/classes/class.ilShopUtils.php';
38 $this->type_ordering = array(
39 "cat",
"crs",
"grp",
"chat",
"frm",
"wiki",
"lres",
40 "glo",
"webr",
"lm",
"sahs",
"htlm",
"file",
'mcst',
"exc",
41 "tst",
"svy",
"sess",
"mep",
"qpl",
"spl");
45 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
53 $results = $this->result->getResultsForPresentation();
62 $oContainerTpl =
new ilTemplate (
'tpl.shop_container.html',
true,
true,
'Services/Payment');
63 include_once
'./Services/Payment/classes/class.ilShopTopic.php';
64 include_once
'./Services/Payment/classes/class.ilShopTopics.php';
72 foreach($topics as $oTopic)
74 $this->
renderItems($oContainerTpl,
$results, array(
'id' => $oTopic->getId(),
'title' => $oTopic->getTitle()));
76 $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
80 $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
83 $html = $oContainerTpl->get();
90 $this->type_ordering = $a_type_ordering_array;
94 return $this->type_ordering;
98 $this->sort_field = $a_sort_field;
106 $this->sort_direction = $a_sort_direction;
115 if ($this->sort_direction !=
'' && $this->sort_field !=
'')
117 switch ($this->sort_field)
120 $numeric_sort =
true;
123 $numeric_sort =
false;
144 foreach($this->type_ordering as $act_type)
146 $item_html = array();
148 if(count(
$results[$topic[
'id']][$act_type]))
150 foreach(
$results[$topic[
'id']][$act_type] as $key => $item)
159 if($oPaymentObject->getSpecial() ==
'1')
163 $results[$topic[
'id']][$act_type][$key][
'title'] = $item[
'title'].
' '.
165 $results[$topic[
'id']][$act_type][$key][
'special_icon'] = $special_icon;
167 $results[$topic[
'id']][$act_type][$key][
'price'] = $lowest_price[
'price'];
176 $results[$topic[
'id']][$act_type][$key][
'price_string'] =
177 ($oPrice->getNumberOfPrices() > 1 ? $this->lng->txt(
'price_from').
' ' :
'').
181 $results[$topic[
'id']][$act_type][$key][
'shoppingcart_icon'] = $shoppingcart_icon.
' '.
183 $results[$topic[
'id']][$act_type][$key][
'paymethod_icon'] = $paymethod_icon;
186 include_once
'Services/MetaData/classes/class.ilMD.php';
187 $md_obj =
new ilMD($item[
'obj_id'], 0, $item[
'type']);
188 if(is_object($md_section = $md_obj->getLifecycle()))
190 $sep = $ent_str =
"";
191 foreach(($ids = $md_section->getContributeIds()) as $con_id)
193 $md_con = $md_section->getContribute($con_id);
194 if ($md_con->getRole() ==
"Author")
196 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
198 $md_ent = $md_con->getEntity($ent_id);
199 $ent_str = $ent_str.$sep.$md_ent->getEntity();
204 $results[$topic[
'id']][$act_type][$key][
'author'] = $ent_str;
210 foreach(
$results[$topic[
'id']][$act_type] as $key => $item)
213 if ($cur_obj_type != $item[
'type'])
215 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
218 $item_list_gui->initItem(
222 $item[
'description'],
225 $item_list_gui->enableDelete(
false);
226 $item_list_gui->enableCut(
false);
227 $item_list_gui->enableCopy(
false);
228 $item_list_gui->enableLink(
false);
229 $item_list_gui->enableSubscribe(
false);
231 $item_list_gui->enablePayment(
true);
232 $item_list_gui->enableCommands(
true);
233 $item_list_gui->enablePath(
false);
234 $item_list_gui->insertCommands();
236 $item_list_gui->enableInfoScreen(
false);
237 $item_list_gui->enableSubstitutions(
false);
238 $item_list_gui->enableNoticeProperties(
false);
239 $item_list_gui->enablePreconditions(
false);
240 $item_list_gui->enableProperties(
false);
241 $item_list_gui->setBoldTitle(
true);
246 $item_list_gui->enableInfoScreen(
true);
247 $item_list_gui->enableCommands(
true);
251 switch ($item[
'type'])
254 $demo_link =
'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.$item[
'ref_id'].
'&purchasetype=demo';
258 $demo_link =
'ilias.php?baseClass=ilLMPresentationGUI&ref_id='.$item[
'ref_id'].
'&purchasetype=demo';
262 $demo_link = $this->ctrl->getLinkTargetByClass(
'ilshoppurchasegui',
'showDemoVersion').
'&purchasetype=demo&ref_id='.$item[
"ref_id"];
266 $demo_link = $this->ctrl->getLinkTargetByClass(
'ilshoppurchasegui',
'showDemoVersion').
'&purchasetype=demo&ref_id='.$item[
"ref_id"];
270 $item[
'title'] =
'<a href="'.$demo_link.
'">'.$item[
"title"].
'</a>';
273 $tpl_pinfo =
new ilTemplate (
'tpl.shop_item_info.html',
true,
true,
'Services/Payment');
274 if($item[
'price_string'] !=
'')
276 $tpl_pinfo->setCurrentBlock(
'ploop');
277 $tpl_pinfo->setVariable(
'PROPERTY', $this->lng->txt(
'price_a'));
278 $tpl_pinfo->setVariable(
'VALUE', $item[
'price_string']);
279 $tpl_pinfo->parseCurrentBlock();
281 if($item[
'author'] !=
'')
283 $tpl_pinfo->setCurrentBlock(
'ploop');
284 $tpl_pinfo->setVariable(
'PROPERTY', $this->lng->txt(
'author'));
285 $tpl_pinfo->setVariable(
'VALUE', $item[
'author']);
286 $tpl_pinfo->parseCurrentBlock();
289 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
291 $tpl_pinfo->setCurrentBlock(
'image');
292 $tpl_pinfo->setVariable(
'SRC', $webpath_file);
293 $tpl_pinfo->setVariable(
'ALT', strip_tags($item[
'title']));
294 $tpl_pinfo->parseCurrentBlock();
297 $item_list_gui->addSubItemHTML($tpl_pinfo->get());
299 $html = $item_list_gui->getListItemHTML(
303 $item[
'description'],
311 $item_html[$item[
'ref_id']] = $html;
316 if(count($item_html) > 0)
330 foreach($item_html as
$ref_id => $html)
339 if($items_counter > 0)
341 $oContainerTpl->setCurrentBlock(
'loop');
342 $oContainerTpl->setVariable(
'TOPIC_TITLE', $topic[
'title']);
343 $oContainerTpl->setVariable(
'COTAINER_LIST_BLOCK',
$tpl->get());
344 $oContainerTpl->parseCurrentBlock();
347 $tpl->setContent($oContainerTpl->get());
353 $oContainerTpl =
new ilTemplate (
'tpl.shop_container.html',
true,
true,
'Services/Payment');
355 foreach($this->result->getTopics() as $oTopic)
357 $this->
renderItems($oContainerTpl,
$results, array(
'id' => $oTopic->getId(),
'title' => $oTopic->getTitle()));
359 $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
361 return $oContainerTpl->get();
371 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
375 $a_tpl->touchBlock($this->cur_row_type);
376 $a_tpl->setCurrentBlock(
"container_standard_row");
377 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
380 #$a_tpl->setVariable("BLOCK_ROW_CHECK",ilUtil::formCheckbox(0,'result[]',$a_ref_id));
381 #$a_tpl->setVariable("ITEM_ID",$a_ref_id);
382 $a_tpl->parseCurrentBlock();
383 $a_tpl->touchBlock(
"container_row");
394 $tpl =
new ilTemplate (
"tpl.container_list_block.html",
true,
true,
395 "Services/Container");
396 $this->cur_row_type =
"row_type_1";
410 if ($a_type !=
"lres")
413 $title = $this->lng->txt(
"objs_".$a_type);
418 $title = $this->lng->txt(
"learning_resources");
421 $a_tpl->setCurrentBlock(
"container_header_row_image");
422 $a_tpl->setVariable(
"HEADER_IMG", $icon);
423 $a_tpl->setVariable(
"HEADER_ALT",
$title);
424 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT",
$title);
425 $a_tpl->parseCurrentBlock();
428 #$a_tpl->setCurrentBlock("container_header_row");
429 #$a_tpl->parseCurrentBlock();
430 #$a_tpl->touchBlock("container_row");
435 $a_tpl->touchBlock(
"separator_row");
436 $a_tpl->touchBlock(
"container_row");
442 if(!count($item[
'child']))
446 $tpl =
new ilTemplate(
'tpl.detail_links.html',
true,
true,
'Services/Search');
448 switch($item[
'type'])
451 $tpl->setVariable(
"HITS",$this->lng->txt(
'search_hits'));
452 include_once
'Modules/LearningModule/classes/class.ilLMObject.php';
453 foreach($item[
'child'] as $child)
455 $tpl->setCurrentBlock(
"link_row");
460 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'obj_pg'));
463 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'obj_st'));
466 $item_list_gui->setChildId($child);
467 $tpl->setVariable(
"SEPERATOR",
' -> ');
468 $tpl->setVariable(
"LINK",$item_list_gui->getCommandLink(
'page'));
469 $tpl->setVariable(
"TARGET",$item_list_gui->getCommandFrame(
'page'));
471 $tpl->parseCurrentBlock();
476 $tpl->setVariable(
"HITS",$this->lng->txt(
'search_hits'));
477 include_once
'./Modules/Forum/classes/class.ilObjForum.php';
479 foreach($item[
'child'] as $child)
481 $thread_post = explode(
'_',$child);
483 $tpl->setCurrentBlock(
"link_row");
484 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'thread'));
486 $item_list_gui->setChildId($thread_post);
487 $tpl->setVariable(
"SEPERATOR",
': ');
488 $tpl->setVariable(
"LINK",$item_list_gui->getCommandLink(
'posting'));
489 $tpl->setVariable(
"TARGET",$item_list_gui->getCommandFrame(
''));
490 $tpl->setVariable(
"TITLE",ilObjForum::_lookupThreadSubject($thread_post[0]));
491 $tpl->parseCurrentBlock();
496 $tpl->setVariable(
"HITS",$this->lng->txt(
'search_hits'));
497 include_once
'./Modules/Glossary/classes/class.ilGlossaryTerm.php';
499 $this->lng->loadLanguageModule(
'content');
500 foreach($item[
'child'] as $child)
502 $tpl->setCurrentBlock(
"link_row");
503 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'cont_term'));
504 $tpl->setVariable(
"SEPERATOR",
': ');
505 $tpl->setVariable(
"LINK",
ilLink::_getLink($item[
'ref_id'],
'git',array(
'target' =>
'git_'.$child.
'_'.$item[
'ref_id'])));
507 $tpl->parseCurrentBlock();
512 $tpl->setVariable(
"HITS",$this->lng->txt(
'search_hits'));
513 include_once
'./Modules/Wiki/classes/class.ilWikiPage.php';
514 include_once
'./Modules/Wiki/classes/class.ilWikiUtil.php';
516 $this->lng->loadLanguageModule(
'wiki');
517 foreach($item[
'child'] as $child)
520 $tpl->setCurrentBlock(
"link_row");
521 $tpl->setVariable(
"CHAPTER_PAGE",$this->lng->txt(
'wiki_page'));
522 $tpl->setVariable(
"SEPERATOR",
': ');
525 $tpl->setVariable(
"TITLE", $page_title);
526 $tpl->parseCurrentBlock();
531 $tpl->setVariable(
"HITS",$this->lng->txt(
'search_hits'));
532 include_once(
"./Services/News/classes/class.ilNewsItem.php");
534 foreach($item[
'child'] as $child)
536 $tpl->setCurrentBlock(
"link_row");
539 $item_list_gui->setChildId($child);
541 $tpl->setVariable(
"LINK", $item_list_gui->getCommandLink(
'listItems'));
542 $tpl->setVariable(
"TARGET", $item_list_gui->getCommandFrame(
''));
544 $tpl->parseCurrentBlock();
552 return $html .
$tpl->get();
557 $this->cur_row_type =
"";