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');
58 $oContainerTpl =
new ilTemplate (
'tpl.shop_container.html',
true,
true,
'Services/Payment');
59 include_once
'./Services/Payment/classes/class.ilShopTopic.php';
60 include_once
'./Services/Payment/classes/class.ilShopTopics.php';
69 foreach($topics as $oTopic)
71 $html .= $this->
renderItems($oContainerTpl,
$results, array(
'id' => $oTopic->getId(),
'title' => $oTopic->getTitle()));
73 $html .= $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
77 $html .= $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
86 $oContainerTpl =
new ilTemplate (
'tpl.shop_container.html',
true,
true,
'Services/Payment');
87 include_once
'./Services/Payment/classes/class.ilShopTopic.php';
88 include_once
'./Services/Payment/classes/class.ilShopTopics.php';
97 foreach($topics as $oTopic)
99 $html .= $this->
renderItems($oContainerTpl,
$results, array(
'id' => $oTopic->getId(),
'title' => $oTopic->getTitle()));
101 $html .= $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
105 $html .= $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
113 $this->type_ordering = $a_type_ordering_array;
117 return $this->type_ordering;
121 $this->sort_field = $a_sort_field;
129 $this->sort_direction = $a_sort_direction;
138 if ($this->sort_direction !=
'' && $this->sort_field !=
'')
140 switch ($this->sort_field)
143 $numeric_sort =
true;
146 $numeric_sort =
false;
166 foreach($this->type_ordering as $act_type)
168 $item_html = array();
170 if(count(
$results[(
int)$topic[
'id']][$act_type]))
172 foreach(
$results[$topic[
'id']][$act_type] as $key => $item)
180 if($oPaymentObject->getSpecial() ==
'1')
184 $results[$topic[
'id']][$act_type][$key][
'title'] = $item[
'title'].
' '.
185 $results[$topic[
'id']][$act_type][$key][
'special_icon'] = $special_icon;
187 $results[$topic[
'id']][$act_type][$key][
'price'] = $lowest_price[
'price'];
192 $results[$topic[
'id']][$act_type][$key][
'price_string'] =
193 ($oPrice->getNumberOfPrices() > 1 ? $this->lng->txt(
'price_from').
' ' :
'').
197 $results[$topic[
'id']][$act_type][$key][
'shoppingcart_icon'] = $shoppingcart_icon.
' '.
199 $results[$topic[
'id']][$act_type][$key][
'paymethod_icon'] = $paymethod_icon;
202 include_once
'Services/MetaData/classes/class.ilMD.php';
203 $md_obj =
new ilMD($item[
'obj_id'], 0, $item[
'type']);
204 if(is_object($md_section = $md_obj->getLifecycle()))
206 $sep = $ent_str =
"";
207 foreach(($ids = $md_section->getContributeIds()) as $con_id)
209 $md_con = $md_section->getContribute($con_id);
210 if ($md_con->getRole() ==
"Author")
212 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
214 $md_ent = $md_con->getEntity($ent_id);
215 $ent_str = $ent_str.$sep.$md_ent->getEntity();
220 $results[$topic[
'id']][$act_type][$key][
'author'] = $ent_str;
226 foreach(
$results[$topic[
'id']][$act_type] as $key => $item)
233 $item_html[$item[
'ref_id']] = $html;
238 if(count($item_html) > 0)
241 $tpl->setCurrentBlock(
"container_header_row_image");
243 $tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
"objs_".$act_type));
244 $tpl->setVariable(
"BLOCK_HEADER_CONTENT", $this->lng->txt(
"objs_".$act_type));
248 foreach($item_html as
$ref_id => $html)
257 if($items_counter > 0)
259 $oContainerTpl->setCurrentBlock(
'loop_item');
260 $oContainerTpl->setCurrentBlock(
'topic_title');
261 $oContainerTpl->setVariable(
'TOPIC_TITLE', $topic[
'title']);
262 $oContainerTpl->parseCurrentBlock(
'topic_title');
264 $oContainerTpl->setVariable(
'CONTAINER_LIST_BLOCK', $html);
265 $oContainerTpl->parseCurrentBlock(
'loop_item');
266 $tpl->setContent($oContainerTpl->get());
267 $container_html =
$tpl->get();
269 return $container_html;
275 $oContainerTpl =
new ilTemplate (
'tpl.shop_container.html',
true,
true,
'Services/Payment');
277 foreach($this->result->getTopics() as $oTopic)
279 $this->
renderItems($oContainerTpl,
$results, array(
'id' => $oTopic->getId(),
'title' => $oTopic->getTitle()));
281 $this->
renderItems($oContainerTpl,
$results, array(
'id' => 0,
'title' => $this->lng->txt(
'payment_no_topic')));
283 return $oContainerTpl->get();
293 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
297 $a_tpl->touchBlock($this->cur_row_type);
298 $a_tpl->setCurrentBlock(
"container_standard_row");
299 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
301 $a_tpl->parseCurrentBlock();
302 $a_tpl->touchBlock(
"container_row");
313 $tpl =
new ilTemplate (
"tpl.container_list_block.html",
true,
true,
"Services/Container");
314 $this->cur_row_type =
"row_type_1";
441 $this->cur_row_type =
"";
451 if($cur_obj_type != $item[
'type'])
453 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
457 $item_list_gui->enableDelete(
false);
458 $item_list_gui->enableCut(
false);
459 $item_list_gui->enableCopy(
false);
460 $item_list_gui->enableLink(
false);
461 $item_list_gui->enableSubscribe(
false);
463 $item_list_gui->enablePayment(
true);
464 $item_list_gui->enableCommands(
true);
465 $item_list_gui->enablePath(
false);
466 $item_list_gui->insertCommands();
468 $item_list_gui->enableInfoScreen(
false);
469 $item_list_gui->enableSubstitutions(
false);
470 $item_list_gui->enableNoticeProperties(
false);
471 $item_list_gui->enablePreconditions(
false);
472 $item_list_gui->enableProperties(
false);
473 $item_list_gui->setBoldTitle(
true);
477 $item_list_gui->enableInfoScreen(
true);
478 $item_list_gui->enableCommands(
true);
482 switch($item[
'type'])
485 $demo_link =
'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=' . $item[
'ref_id'] .
'&purchasetype=demo';
489 $demo_link =
'ilias.php?baseClass=ilLMPresentationGUI&ref_id=' . $item[
'ref_id'] .
'&purchasetype=demo';
493 $demo_link = $this->ctrl->getLinkTargetByClass(
'ilshoppurchasegui',
'showDemoVersion') .
'&purchasetype=demo&ref_id=' . $item[
"ref_id"];
497 $demo_link = $this->ctrl->getLinkTargetByClass(
'ilshoppurchasegui',
'showDemoVersion') .
'&purchasetype=demo&ref_id=' . $item[
"ref_id"];
501 $item[
'title'] =
'<a href="' . $demo_link .
'">' . $item[
"title"] .
'</a>';
504 $tpl_pinfo =
new ilTemplate (
'tpl.shop_item_info.html',
true,
true,
'Services/Payment');
505 if($item[
'price_string'] !=
'')
507 $tpl_pinfo->setCurrentBlock(
'ploop');
508 $tpl_pinfo->setVariable(
'PROPERTY', $this->lng->txt(
'price_a'));
509 $tpl_pinfo->setVariable(
'VALUE', $item[
'price_string']);
510 $tpl_pinfo->parseCurrentBlock();
512 if($item[
'author'] !=
'')
514 $tpl_pinfo->setCurrentBlock(
'ploop');
515 $tpl_pinfo->setVariable(
'PROPERTY', $this->lng->txt(
'author'));
516 $tpl_pinfo->setVariable(
'VALUE', $item[
'author']);
517 $tpl_pinfo->parseCurrentBlock();
520 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
522 $tpl_pinfo->setCurrentBlock(
'image');
523 $tpl_pinfo->setVariable(
'SRC', $webpath_file);
524 $tpl_pinfo->setVariable(
'ALT', strip_tags($item[
'title']));
525 $tpl_pinfo->parseCurrentBlock();
528 $item_list_gui->addSubItemHTML($tpl_pinfo->get());
530 $html = $item_list_gui->getListItemHTML($item[
'ref_id'], $item[
'obj_id'], $item[
'title'], $item[
'description'],
false,
false,
"",
ilObjectListGUI::CONTEXT_SHOP);
531 return array($item, $html);
536 $this->result = $this->result->getResultsForPresentation();
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _formatPriceToString($a_price)
addStandardRow($a_tpl, $a_html)
static _lookupPobjectId($a_ref_id)
showAdvancedSearchResults()
newBlockTemplate()
returns a new list block template
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _addToShoppingCartSymbol($a_ref_id)
getObjectListItem($cur_obj_type, $item)
Class ilShopResultPresentationGUI.
static _getInstance($a_usr_id)
Get singleton instance.
setSortDirection($a_sort_direction)
renderItems($oContainerTpl, $results, $topic)
special template class to simplify handling of ITX/PEAR
static _getPaymethodSymbol($a_paymethod)
setTypeOrdering($a_type_ordering_array)
& _getListGUIByType($a_type)
static _getSpecialObjectSymbol()
static _hasAccess($a_ref_id, $a_transaction=0, $a_subtype='')
This class handles all operations on files in directory data/shop.
ilShopResultPresentationGUI($result)
setSortField($a_sort_field)