4 include_once
'Services/Payment/classes/class.ilShopBaseGUI.php';
5 include_once
'Services/Payment/classes/class.ilPaymentSettings.php';
6 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
7 include_once
'./Services/Payment/classes/class.ilShopRepositoryExplorer.php';
9 include_once
'./Services/Payment/classes/class.ilShopSearchResult.php';
42 parent::__construct();
48 $this->cmd =
'setFilter';
52 $this->cmd = $ilCtrl->getCmd();
55 $this->cur_ref_id = (int)
$_GET[
'ref_id'];
74 $next_class = $this->ctrl->getNextClass($this);
75 if(isset(
$_GET[
'ref_id']))
77 $this->cmd =
'showTree';
88 $this->tpl->setContent(
$ret);
98 if($this->settings->get(
'use_shop_specials') ==
true)
103 $cmd =
'showSpecialContent';
107 $cmd =
'performSearch';
112 $container = array(
"root",
"cat",
'catr',
"grp",
"crs",
'crsr',
'rcrs');
114 if(in_array($obj_type, $container))
118 $cmd =
'showContainerContent';
122 $cmd =
'performSearch';
126 $cmd =
'resetFilter';
132 $cmd =
'performSearch';
147 $show_general_filter = $this->settings->get(
'show_general_filter');
148 $show_topics_filter = $this->settings->get(
'show_topics_filter');
149 $topics_enabled = $this->settings->get(
'enable_topics');
150 $show_shop_explorer = $this->settings->get(
'show_shop_explorer');
152 if($show_general_filter)
155 $this->tpl->setCurrentBlock(
'show_general_filter');
156 $this->tpl->setVariable(
'FORM', $g_filter_html);
157 $this->tpl->parseCurrentBlock();
160 if($show_topics_filter && $topics_enabled)
164 if($show_shop_explorer)
177 #return $this->performSearch(); 183 include_once
'Services/Payment/classes/class.ilShopPage.php';
184 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
192 include_once
'Services/Style/classes/class.ilObjStyleSheet.php';
196 $page_gui =
new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
198 return $page_gui->showPage();
203 global
$lng, $ilTabs;
205 $ilTabs->clearTargets();
206 $ilTabs->setBackTarget($lng->txt(
'back'), $this->ctrl->getLinkTarget($this),
'_top');
209 include_once
'Services/Payment/classes/class.ilShopPage.php';
210 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
212 $lng->loadLanguageModule(
'content');
214 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
221 $new_page_object->setParentId(0);
222 $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
223 $new_page_object->createFromXML();
226 $this->ctrl->setReturnByClass(
'ilshoppagegui',
'edit');
228 $page_gui =
new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
230 return $this->ctrl->forwardCommand($page_gui);
237 $_SESSION[
'content_filter'][
'sel_filter_type'] =
$_POST[
'sel_filter_type'];
239 $_SESSION[
'content_filter'][
'filter_topic_id'] =
$_POST[
'filter_topic_id'];
242 $_SESSION[
'content_filter'][
'order_direction'] =
$_POST[
'order_direction'];
244 $_SESSION[
'content_filter'][
'topics_sorting_type'] =
$_POST[
'topics_sorting_type'];
245 $_SESSION[
'content_filter'][
'topics_sorting_direction'] =
$_POST[
'topics_sorting_direction'];
264 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
265 $tpl->addCss(
'Services/Payment/css/shop_explorer.css');
267 include_once (
"./Services/Payment/classes/class.ilShopRepositoryExplorer.php");
269 $active_node = (
$_GET[
"active_node"] >= 1)
270 ?
$_GET[
"active_node"]
271 : (
$_GET[
"ref_id"] >= 1)
278 $exp->setUseStandardFrame(
false);
279 $exp->setExpandTarget(
"ilias.php?baseClass=ilshopcontroller&ref_id=1&cmd=showTree");
281 $exp->setFrameUpdater(
"tree",
"updater");
282 $exp->setTargetGet(
"ref_id");
284 if(
$_GET[
"repexpand"] ==
"")
286 $expanded = $tree->readRootId();
290 $expanded =
$_GET[
"repexpand"];
293 $exp->setExpand($expanded);
297 $path = $tree->getPathId($active_node);
300 $exp->setForceOpenPath(
$path);
301 $exp->setExpand($expanded);
305 $exp->setForceOpenPath(
$path + array($top_node));
307 $exp->highlightNode($active_node);
313 $head_tpl =
new ilTemplate(
"tpl.cont_tree_head.html",
true,
true,
314 "Services/Repository");
316 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
317 $title =
$nd[
"title"];
318 if($title ==
"ILIAS")
320 $title = $lng->txt(
"repository");
322 $head_tpl->setVariable(
"IMG_SRC",
$path);
323 $head_tpl->setVariable(
"ALT_IMG", $lng->txt(
"icon") .
" " . $title);
324 $head_tpl->setVariable(
"LINK_TXT", $title);
325 $head_tpl->setVariable(
"LINK_HREF",
"ilias.php?baseClass=ilshopcontroller&ref_id=1");
326 $exp->setTreeLead($head_tpl->get());
328 $exp->initItemCounter(1);
329 $exp->setOutput($tree->getParentId($top_node), 1,
336 $output = $exp->getOutput(
true);
339 if($ilCtrl->isAsynch())
345 $ilCtrl->setParameter($this,
"repexpand",
$_GET[
"repexpand"]);
346 $tpl->setLeftContent($output);
351 if(!is_object($oResult))
354 if((
bool)$this->settings->get(
'topics_allow_custom_sorting'))
373 $oResult->setTopics($topics);
374 $oResult->setResultPageNumber((
int)
$_GET[
'page_number']);
378 include_once
'Services/Search/classes/class.ilQueryParser.php';
380 $query_parser->setMinWordLength(0);
382 $query_parser->parse();
383 if(!$query_parser->validate())
389 $types = array(
'crs',
'lm',
'sahs',
'htlm',
'file',
'tst',
'exc',
'glo');
391 $query_parser->getQueryString() ==
'' 394 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
396 $object_search->setFields(array(
'title'));
397 $object_search->setFilter($types);
398 $object_search->setCustomSearchResultObject($oResult);
399 $object_search->setFilterShopTopicId((
int)$this->
getTopicId());
400 $res = $object_search->performSearch();
402 else if($this->
getType() ==
'author')
404 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
406 $meta_search->setMode(
'contribute');
407 $meta_search->setFilter($types);
408 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
409 $meta_search->setCustomSearchResultObject($oResult);
410 $res = $meta_search->performSearch();
414 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
416 $meta_search->setMode(
'title');
417 $meta_search->setFilter($types);
418 $meta_search->setCustomSearchResultObject($oResult);
419 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
420 $res = $meta_search->performSearch();
423 $meta_search->setMode(
'keyword');
424 $meta_search->setFilter($types);
425 $meta_search->setCustomSearchResultObject($oResult);
426 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
427 $res->mergeEntries($meta_search->performSearch());
430 $res->filter(ROOT_FOLDER_ID,
true);
433 if(!count(
$res->getResults()))
446 unset(
$_POST[
'sel_filter_type']);
447 unset(
$_POST[
'filter_text']);
448 unset(
$_POST[
'filter_topic_id']);
449 unset(
$_POST[
'order_field']);
450 unset(
$_POST[
'order_direction']);
451 unset(
$_POST[
'topics_sorting_type']);
452 unset(
$_POST[
'topics_sorting_direction']);
453 unset(
$_POST[
'updateView']);
454 unset(
$_POST[
'show_filter']);
468 global
$ilUser, $rbacreview, $ilToolbar;
470 if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
472 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
475 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.shop_content.html',
'Services/Payment');
476 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
478 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
490 $presentation_results[(int)$result[
'pt_topic_fk']][
$type][] =
492 'ref_id' => $result[
'ref_id'],
494 'description' => $description,
497 'topic_id' => (
int)$result[
'pt_topic_fk'],
498 'child' => $result[
'child']
501 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
505 $this->tpl->setVariable(
'PAGE_CONTENT', $this->lng->txt(
'please_choose_category'));
508 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
510 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
511 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
513 $html = $search_result_presentation->showSpecials();
515 $this->tpl->setVariable(
'RESULTS', $html);
521 global
$ilUser, $rbacreview, $ilToolbar;
523 if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
525 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
528 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.shop_content.html',
'Services/Payment');
529 if(!count($oResult->getResults()))
531 $this->tpl->setVariable(
'ERROR',
ilUtil::sendInfo($this->lng->txt(
'payment_shop_not_objects_found')));
534 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
535 $filter_topics_id = NULL;
536 if(
$_SESSION[
'content_filter'][
'filter_topic_id'] != NULL)
538 $filter_topics_id = (int)
$_SESSION[
'content_filter'][
'filter_topic_id'];
549 $presentation_results[(int)$result[
'pt_topic_fk']][
$type][] = array(
550 'ref_id' => $result[
'ref_id'],
'title' => $title,
'description' => $description,
'type' =>
$type,
'obj_id' => $obj_id,
'topic_id' => (
int)$result[
'pt_topic_fk'],
'child' => $result[
'child']
553 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
557 $this->tpl->setVariable(
'PAGE_CONTENT', $this->lng->txt(
'please_choose_category'));
560 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
562 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
563 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
565 $html = $search_result_presentation->showTopics();
569 foreach($oResult->getResults() as
$result)
575 $tmp_res = array(
'ref_id' =>
$result[
'ref_id'],
'title' => $title,
'description' => $description,
576 'type' =>
$result[
'type'],
'obj_id' => $obj_id,
'topic_id' => 0,
'child' => 0);
578 $presentation_results[0][
$result[
'type']][] = $tmp_res;
581 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
583 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
584 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
586 $html = $search_result_presentation->showTopics();
588 $this->tpl->setVariable(
'RESULTS', $html);
599 if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
601 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
604 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
606 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.shop_content.html',
'Services/Payment');
607 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
620 $presentation_results[$pobjects[
'pt_topic_fk']][
$type][] =
622 'ref_id' => $pobjects[
'ref_id'],
624 'description' => $description,
627 'topic_id' => $pobjects[
'pt_topic_fk'],
628 'child' => $pobjects[
'child']
635 if(count($pobjects) >= 1)
639 $obj_id = $result[
'obj_id'];
640 $title = $result[
'title'];
641 $description = $result[
'description'];
642 $type = $result[
'type'];
644 $presentation_results[$result[
'pt_topic_fk']][
$type][] =
646 'ref_id' => $result[
'ref_id'],
648 'description' => $description,
651 'topic_id' => $result[
'pt_topic_fk'],
652 'child' => $result[
'child']
658 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
660 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
661 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
663 if(!$presentation_results)
665 $this->tpl->setVariable(
'RESULTS', $this->lng->txt(
'payment_shop_not_objects_found'));
669 $html = $search_result_presentation->showSpecials();
670 $this->tpl->setVariable(
'RESULTS', $html);
677 include_once
'Services/Payment/classes/class.ilShopFilterGUI.php';
679 $filterGUI->initFilter();
680 if($this->cmd ==
'setFilter')
682 $filterGUI->writeFilterToSession();
686 $filterGUI->resetFilter();
688 return $filterGUI->getHtml();
695 $this->tpl->setCurrentBlock(
'show_topics_filter');
702 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
703 $this->tpl->setVariable(
'SORTING_FORM_ACTION', $this->ctrl->getFormAction($this,
'setFilter'));
705 $this->tpl->setVariable(
'SET_FILTER_VAL', $this->lng->txt(
'pay_update_view'));
707 $this->tpl->setCurrentBlock(
'topics_option');
708 $this->tpl->setVariable(
'SORT_TOPICS', $this->lng->txt(
'topic'));
710 $this->tpl->setVariable(
'FILTER_TOPIC_ID',
'no_selection');
711 $this->tpl->setVariable(
'FILTER_TOPIC_TEXT',
'------------');
712 if(
$_POST[
'cmd'] ==
'firstpage')
713 $this->tpl->setVariable(
'FILTER_TOPIC_SELECTED',
'selected');
714 $this->tpl->parseCurrentBlock(
'topics_option');
716 $this->tpl->setVariable(
'FILTER_TOPIC_ID',
'all');
717 $this->tpl->setVariable(
'FILTER_TOPIC_TEXT', $this->lng->txt(
'all'));
718 if(
$_POST[
'filter_topic_id'] ==
'all')
719 $this->tpl->setVariable(
'FILTER_TOPIC_SELECTED',
'selected');
720 $this->tpl->parseCurrentBlock(
'topics_option');
724 foreach($oTopics as $oTopic)
726 $this->tpl->setVariable(
'FILTER_TOPIC_ID', $oTopic->getId());
727 $this->tpl->setVariable(
'FILTER_TOPIC_TEXT', $oTopic->getTitle());
728 if(
$_POST[
'filter_topic_id'] == $oTopic->getId())
729 $this->tpl->setVariable(
'FILTER_TOPIC_SELECTED',
'selected');
730 $this->tpl->parseCurrentBlock(
'topics_option');
736 $objects = (bool)$this->settings->get(
'objects_allow_custom_sorting');
740 $allow_objects_option = array(
741 'title' => $this->lng->txt(
'title'),
742 'author' => $this->lng->txt(
'author'),
743 'price' => $this->lng->txt(
'price_a')
745 $this->tpl->setCurrentBlock(
'order_field');
746 $this->tpl->setVariable(
'SORT_BY_TEXT', $this->lng->txt(
'sort_by'));
748 foreach($allow_objects_option as $key=> $value)
750 $this->tpl->setVariable(
'ORDER_FIELD_VALUE', $key);
751 $this->tpl->setVariable(
'ORDER_FIELD_TEXT', $value);
752 if(
$_POST[
'order_field'] == $key)
753 $this->tpl->setVariable(
'ORDER_FIELD_SELECTED',
'selected');
754 $this->tpl->parseCurrentBlock(
'order_field');
758 $topics = (bool)$this->settings->get(
'topics_allow_custom_sorting');
763 $allow_topics_option = array(
767 if(ANONYMOUS_USER_ID != $ilUser->getId())
777 $this->topic_id = $a_topic_id;
787 $this->
string = $a_str;
797 $this->type = $a_type;
807 $this->sort_direction = $a_sort_direction;
817 $this->sort_field = $a_field;
829 if(ANONYMOUS_USER_ID == $ilUser->getId() &&
836 $this->sort_type_topics = $a_field;
843 if(ANONYMOUS_USER_ID == $ilUser->getId() &&
855 $_SESSION[
'shop_content'][
'shop_topics_sorting_direction'] = $this->sort_direction_topics = $a_sort_direction;
867 parent::prepareOutput();
868 $ilTabs->setTabActive(
'content');
setSortingTypeTopics($a_field)
setSortingDirectionTopics($a_sort_direction)
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
const TOPICS_SORT_BY_CREATEDATE
static _lookupPobjectId($a_ref_id)
static _getContainerObjects($a_ref_id)
const TOPICS_SORT_MANUALLY
static _getObjectData($a_id)
static _getTopicsObjects($topic_id=NULL)
const TOPICS_SORT_BY_TITLE
const SHOW_CONTAINER_CONTENT
static _lookupTitle($a_id)
lookup object title
searchResult stores all result of a search query.
const SHOP_PAGE_EDITOR_PAGE_ID
Class ilShopResultPresentationGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
performSearch($oResult=null)
static _isBuyable($a_ref_id, $a_subtype='')
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
showGeneralFilter($a_count_result=0)
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
showTopicsFilter($a_count_result=0)
static _getSpecialObjects()
special template class to simplify handling of ITX/PEAR
getSortingDirectionTopics()
_getInstance($a_search_type)
static _getShopMetaDataSearchInstance($query_parser)
get reference of LikeShopMetaDataSearch.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setFilterMode($filter_mode)
static _getShopObjectSearchInstance($query_parser)
get reference of LikeShopObjectSearch.
static _lookupType($a_id, $a_reference=false)
lookup object type
const SHOW_SPECIAL_CONTENT
getContentStylePath($a_style_id)
get content style path
showTopicsContent($oResult)
setSortDirection($a_sort_direction)