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';
40 $this->cur_ref_id = (int)
$_GET[
'ref_id'];
41 $this->cmd = $ilCtrl->getCmd();
51 # $this->setSortField($_SESSION['shop_content']['shop_order_field']);
63 if($ilUser->getProfileIncomplete())
70 if($ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired())
75 $next_class = $this->ctrl->getNextClass($this);
79 case 'ilpageobjectgui':
85 $this->tpl->setContent(
$ret);
95 if(!$this->genSet->get(
'show_general_filter')
96 && !$this->genSet->get(
'show_topics_filter')
97 && !$this->genSet->get(
'show_shop_explorer')
100 $cmd =
'performSearch';
107 $cmd =
'showSpecialContent';
111 $cmd =
'performSearch';
116 $cmd =
'resetFilter';
122 $cmd =
'performSearch';
126 if($this->cmd !=
'firstpage' && (isset(
$_GET[
'ref_id']) || $this->cmd ==
'showTree')) #&&
$_GET[
'ref_id'] != ROOT_FOLDER_ID )
129 $container = array(
"root",
"cat",
'catr',
"grp",
"icrs",
"crs",
'crsr',
'rcrs');
131 if(in_array($obj_type, $container))
133 $cmd =
'showContainerContent';
137 $cmd =
'performSearch';
156 #return $this->performSearch();
162 include_once
'Services/COPage/classes/class.ilPageObject.php';
163 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
171 include_once
'Services/Style/classes/class.ilObjStyleSheet.php';
175 $page_gui =
new ilPageObjectGUI(
'shop', self::SHOP_PAGE_EDITOR_PAGE_ID);
176 $page_gui->setIntLinkHelpDefault(
'StructureObject', self::SHOP_PAGE_EDITOR_PAGE_ID);
177 $page_gui->setLinkXML(
'');
178 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
179 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
180 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
181 $page_gui->setPresentationTitle(
'');
182 $page_gui->setTemplateOutput(
false);
183 $page_gui->setHeader(
'');
184 $page_gui->setEnabledRepositoryObjects(
false);
185 $page_gui->setEnabledFileLists(
true);
186 $page_gui->setEnabledPCTabs(
true);
187 $page_gui->setEnabledMaps(
true);
189 return $page_gui->showPage();
194 global
$lng, $ilTabs;
196 $ilTabs->clearTargets();
197 $ilTabs->setBackTarget($lng->txt(
'back'), $this->ctrl->getLinkTarget($this),
'_top');
200 include_once
'Services/COPage/classes/class.ilPageObject.php';
201 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
203 $lng->loadLanguageModule(
'content');
205 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
212 $new_page_object->setParentId(0);
213 $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
214 $new_page_object->createFromXML();
217 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
219 $page_gui =
new ilPageObjectGUI(
'shop', self::SHOP_PAGE_EDITOR_PAGE_ID);
220 $page_gui->setIntLinkHelpDefault(
'StructureObject', self::SHOP_PAGE_EDITOR_PAGE_ID);
221 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
222 $page_gui->setLinkXML(
'');
223 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
224 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
225 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
226 $page_gui->setPresentationTitle(
'');
227 $page_gui->setTemplateOutput(
false);
228 $page_gui->setHeader(
'');
229 $page_gui->setEnabledRepositoryObjects(
false);
230 $page_gui->setEnabledFileLists(
true);
231 $page_gui->setEnabledMaps(
true);
232 $page_gui->setEnabledPCTabs(
true);
234 return $this->ctrl->forwardCommand($page_gui);
257 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
258 $shop_explorer_tpl =
new ilTemplate(
'tpl.shop_explorer.html',
true,
true,
'Services/Payment');
260 include_once (
"./Services/Payment/classes/class.ilShopRepositoryExplorer.php");
262 $active_node = (
$_GET[
"active_node"] >= 1)
263 ?
$_GET[
"active_node"]
264 : (
$_GET[
"ref_id"] >= 1)
271 $exp->setUseStandardFrame(
false);
272 $exp->setExpandTarget(
"ilias.php?baseClass=ilshopcontroller&ref_id=1&cmd=showTree");
274 $exp->setFrameUpdater(
"tree",
"updater");
275 $exp->setTargetGet(
"ref_id");
277 if(
$_GET[
"repexpand"] ==
"")
279 $expanded = $tree->readRootId();
283 $expanded =
$_GET[
"repexpand"];
286 $exp->setExpand($expanded);
290 $path = $tree->getPathId($active_node);
293 $exp->setForceOpenPath(
$path);
294 $exp->setExpand($expanded);
298 $exp->setForceOpenPath(
$path + array($top_node));
300 $exp->highlightNode($active_node);
306 $head_tpl =
new ilTemplate(
"tpl.cont_tree_head.html",
true,
true,
307 "Services/Repository");
309 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
313 $title = $lng->txt(
"repository");
315 $head_tpl->setVariable(
"IMG_SRC",
$path);
316 $head_tpl->setVariable(
"ALT_IMG", $lng->txt(
"icon") .
" " .
$title);
317 $head_tpl->setVariable(
"LINK_TXT",
$title);
318 $head_tpl->setVariable(
"LINK_HREF",
"ilias.php?baseClass=ilshopcontroller&ref_id=1");
319 $exp->setTreeLead($head_tpl->get());
321 $exp->initItemCounter(1);
322 $exp->setOutput($tree->getParentId($top_node), 1,
329 $output = $exp->getOutput(
true);
332 if($ilCtrl->isAsynch())
337 $shop_explorer_tpl->setVariable(
"EXPLORER", $output);
338 $ilCtrl->setParameter($this,
"repexpand",
$_GET[
"repexpand"]);
341 $tpl->setLeftContent($shop_explorer_tpl->get());
346 if(!is_object($oResult))
349 if((
bool)$this->oGeneralSettings->get(
'topics_allow_custom_sorting'))
368 $oResult->setTopics($topics);
369 $oResult->setResultPageNumber((
int)
$_GET[
'page_number']);
373 include_once
'Services/Search/classes/class.ilQueryParser.php';
375 $query_parser->setMinWordLength(0);
377 $query_parser->parse();
378 if(!$query_parser->validate())
384 $types = array(
'crs',
'lm',
'sahs',
'htlm',
'file',
'tst',
'exc',
'glo');
386 $query_parser->getQueryString() ==
''
389 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
391 $object_search->setFields(array(
'title'));
392 $object_search->setFilter($types);
393 $object_search->setCustomSearchResultObject($oResult);
394 $object_search->setFilterShopTopicId((
int)$this->
getTopicId());
395 $res = $object_search->performSearch();
397 else if($this->
getType() ==
'author')
399 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
401 $meta_search->setMode(
'contribute');
402 $meta_search->setFilter($types);
403 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
404 $meta_search->setCustomSearchResultObject($oResult);
405 $res = $meta_search->performSearch();
409 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
411 $meta_search->setMode(
'title');
412 $meta_search->setFilter($types);
413 $meta_search->setCustomSearchResultObject($oResult);
414 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
415 $res = $meta_search->performSearch();
418 $meta_search->setMode(
'keyword');
419 $meta_search->setFilter($types);
420 $meta_search->setCustomSearchResultObject($oResult);
421 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
422 $res->mergeEntries($meta_search->performSearch());
425 $res->filter(ROOT_FOLDER_ID,
true);
428 if(!count(
$res->getResults()))
430 #ilUtil::sendInfo($this->lng->txt('payment_shop_not_objects_found'));
431 $this->tpl->setVariable(
'ERROR', $this->lng->txt(
'payment_shop_not_objects_found'));
437 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
439 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
440 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
442 $this->tpl->setVariable(
'RESULTS', $search_result_presentation->showResults());
451 unset(
$_POST[
'sel_filter_type']);
452 unset(
$_POST[
'filter_text']);
453 unset(
$_POST[
'filter_topic_id']);
454 unset(
$_POST[
'order_field']);
455 unset(
$_POST[
'order_direction']);
456 unset(
$_POST[
'topics_sorting_type']);
457 unset(
$_POST[
'topics_sorting_direction']);
459 unset(
$_POST[
'updateView']);
460 unset(
$_POST[
'show_filter']);
475 global
$ilUser, $rbacreview, $ilToolbar;
477 if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
479 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
482 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.shop_content.html',
'Services/Payment');
483 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
485 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
486 #$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
498 $presentation_results[$result[
'pt_topic_fk']][
$type][] =
500 'ref_id' => $result[
'ref_id'],
502 'description' => $description,
505 'topic_id' => $result[
'pt_topic_fk'],
506 'child' => $result[
'child']
509 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
513 $this->tpl->setVariable(
'PAGE_CONTENT', $this->lng->txt(
'please_choose_category'));
516 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
518 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
519 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
521 $html = $search_result_presentation->showSpecials();
523 $this->tpl->setVariable(
'RESULTS', $html);
525 $show_general_filter = $this->oGeneralSettings->get(
'show_general_filter');
526 $show_topics_filter = $this->oGeneralSettings->get(
'show_topics_filter');
527 $show_shop_explorer = $this->oGeneralSettings->get(
'show_shop_explorer');
529 if($show_general_filter)
532 $this->tpl->setVariable(
'FORM', $g_filter_html);
534 if($show_topics_filter)
538 if($show_shop_explorer)
546 global
$ilUser, $rbacreview, $ilToolbar;
548 if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
550 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
553 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.shop_content.html',
'Services/Payment');
554 if(!count($oResult->getResults()))
556 $this->tpl->setVariable(
'ERROR', $this->lng->txt(
'payment_shop_not_objects_found'));
557 #$this->tpl->setVariable('ERROR',ilUtil::sendInfo($this->lng->txt('payment_shop_not_objects_found')));
560 $show_general_filter = $this->oGeneralSettings->get(
'show_general_filter');
561 $show_topics_filter = $this->oGeneralSettings->get(
'show_topics_filter');
562 $show_shop_explorer = $this->oGeneralSettings->get(
'show_shop_explorer');
564 if($show_general_filter)
567 $this->tpl->setVariable(
'FORM', $g_filter_html);
569 if($show_topics_filter)
573 if($show_shop_explorer)
585 global
$ilUser, $rbacreview, $ilToolbar;
587 if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
589 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
592 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
605 $presentation_results[$pobjects[
'pt_topic_fk']][
$type][] =
607 'ref_id' => $pobjects[
'ref_id'],
609 'description' => $description,
612 'topic_id' => $pobjects[
'pt_topic_fk'],
613 'child' => $pobjects[
'child']
620 if(count($pobjects) >= 1)
624 $obj_id = $result[
'obj_id'];
625 $title = $result[
'title'];
626 $description = $result[
'description'];
627 $type = $result[
'type'];
629 $presentation_results[$result[
'pt_topic_fk']][
$type][] =
631 'ref_id' => $result[
'ref_id'],
633 'description' => $description,
636 'topic_id' => $result[
'pt_topic_fk'],
637 'child' => $result[
'child']
643 $shop_content_tpl =
new ilTemplate(
'tpl.shop_content.html',
true,
true,
'Services/Payment');
644 $shop_content_tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
646 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
648 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
649 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
651 $html = $search_result_presentation->showSpecials();
653 $shop_content_tpl->setVariable(
'RESULTS', $html);
655 $show_general_filter = $this->oGeneralSettings->get(
'show_general_filter');
656 $show_topics_filter = $this->oGeneralSettings->get(
'show_topics_filter');
657 $show_shop_explorer = $this->oGeneralSettings->get(
'show_shop_explorer');
659 if($show_general_filter)
662 $shop_content_tpl->setVariable(
'FORM', $g_filter_html);
664 if($show_topics_filter)
668 if($show_shop_explorer)
673 $tpl->setContent($shop_content_tpl->parse());
680 if(!
$_POST[
'show_filter'] &&
$_POST[
'updateView'] ==
'1')
685 if(
$_POST[
'updateView'] == 1)
689 $_SESSION[
'content_filter'][
'sel_filter_type'] =
$_POST[
'sel_filter_type'];
691 $_SESSION[
'content_filter'][
'filter_topic_id'] =
$_POST[
'filter_topic_id'];
694 $_SESSION[
'content_filter'][
'order_direction'] =
$_POST[
'order_direction'];
696 $_SESSION[
'content_filter'][
'topics_sorting_type'] =
$_POST[
'topics_sorting_type'];
697 $_SESSION[
'content_filter'][
'topics_sorting_direction'] =
$_POST[
'topics_sorting_direction'];
701 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
704 $filter_form->setFormAction($this->ctrl->getFormAction($this));
705 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
706 $filter_form->setId(
'formular');
707 $filter_form->setTableWidth(
'100 %');
709 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
710 $o_hide_check->setValue(1);
711 $o_hide_check->setChecked(
$_SESSION[
'content_filter'][
'show_filter'] ? 1 : 0);
714 $o_hidden->setValue(1);
715 $o_hidden->setPostVar(
'updateView');
716 $o_hide_check->addSubItem($o_hidden);
719 $filter_option = array(
720 'title' => $this->lng->txt(
'title'),
721 'author' => $this->lng->txt(
'author'),
722 'metadata' => $this->lng->txt(
'meta_data')
724 $o_filter->setTitle($this->lng->txt(
'search_in'));
725 $o_filter->setOptions($filter_option);
726 $o_filter->setValue(
$_SESSION[
'content_filter'][
'sel_filter_type']);
727 $o_filter->setPostVar(
'sel_filter_type');
728 $o_hide_check->addSubItem($o_filter);
731 $o_filter_by->setPostVar(
'filter_text');
732 $o_hide_check->addSubItem($o_filter_by);
736 $topic_option = array();
739 $topic_option[
''] = $this->lng->txt(
'please_select');
742 $topic_option[$oTopic->getId()] = $oTopic->getTitle();
747 $topic_option[
''] = $this->lng->txt(
'no_topics_yet');
750 $o_topic->setTitle($this->lng->txt(
'topic'));
751 $o_topic->setOptions($topic_option);
752 $o_topic->setValue(
$_SESSION[
'content_filter'][
'filter_topic_id']);
753 $o_topic->setPostVar(
'filter_topic_id');
754 $o_hide_check->addSubItem($o_topic);
756 #if(count($oResult->getResults()))
759 $objects = (bool)$this->oGeneralSettings->get(
'objects_allow_custom_sorting');
763 $allow_objects_option = array(
764 'title' => $this->lng->txt(
'title'),
765 'author' => $this->lng->txt(
'author'),
766 'price' => $this->lng->txt(
'price_a')
769 $o_allow_objects->setTitle($this->lng->txt(
'sort_by'));
770 $o_allow_objects->setOptions($allow_objects_option);
772 $o_allow_objects->setPostVar(
'order_field');
773 $o_hide_check->addSubItem($o_allow_objects);
775 $direction_option = array(
776 'asc' => $this->lng->txt(
'sort_asc'),
777 'desc' => $this->lng->txt(
'sort_desc')
782 $o_object_direction->setOptions($direction_option);
784 $o_object_direction->setPostVar(
'order_direction');
786 $o_hide_check->addSubItem($o_object_direction);
789 $topics = (bool)$this->oGeneralSettings->get(
'topics_allow_custom_sorting');
793 $allow_topics_option = array(
797 if(ANONYMOUS_USER_ID != $ilUser->getId())
803 $o_allow_topics->setTitle($this->lng->txt(
'sort_topics_by'));
804 $o_allow_topics->setOptions($allow_topics_option);
807 $o_allow_topics->setPostVar(
'topics_sorting_type');
808 $o_hide_check->addSubItem($o_allow_topics);
810 $direction_option = array(
811 'asc' => $this->lng->txt(
'sort_asc'),
812 'desc' => $this->lng->txt(
'sort_desc')
816 $o_topics_direction->setOptions($direction_option);
818 $o_topics_direction->setPostVar(
'topics_sorting_direction');
820 $o_hide_check->addSubItem($o_topics_direction);
824 $filter_form->addCommandButton(
'setFilter', $this->lng->txt(
'pay_update_view'));
825 $filter_form->addCommandButton(
'resetFilter', $this->lng->txt(
'pay_reset_filter'));
826 $filter_form->addItem($o_hide_check);
828 return $filter_form->getHTML();
835 $this->tpl->setCurrentBlock(
'show_topics_filter');
842 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
843 $this->tpl->setVariable(
'SORTING_FORM_ACTION', $this->ctrl->getFormAction($this,
'setFilter'));
845 $this->tpl->setVariable(
'SET_FILTER_VAL', $this->lng->txt(
'pay_update_view'));
847 $this->tpl->setCurrentBlock(
'topics_option');
848 $this->tpl->setVariable(
'SORT_TOPICS', $this->lng->txt(
'topic'));
850 $this->tpl->setVariable(
'FILTER_TOPIC_ID',
'no_selection');
851 $this->tpl->setVariable(
'FILTER_TOPIC_TEXT',
'------------');
852 if(
$_POST[
'cmd'] ==
'firstpage')
853 $this->tpl->setVariable(
'FILTER_TOPIC_SELECTED',
'selected');
854 $this->tpl->parseCurrentBlock(
'topics_option');
856 $this->tpl->setVariable(
'FILTER_TOPIC_ID',
'all');
857 $this->tpl->setVariable(
'FILTER_TOPIC_TEXT', $this->lng->txt(
'all'));
858 if(
$_POST[
'filter_topic_id'] ==
'all')
859 $this->tpl->setVariable(
'FILTER_TOPIC_SELECTED',
'selected');
860 $this->tpl->parseCurrentBlock(
'topics_option');
864 foreach($oTopics as $oTopic)
866 $this->tpl->setVariable(
'FILTER_TOPIC_ID', $oTopic->getId());
867 $this->tpl->setVariable(
'FILTER_TOPIC_TEXT', $oTopic->getTitle());
868 if(
$_POST[
'filter_topic_id'] == $oTopic->getId())
869 $this->tpl->setVariable(
'FILTER_TOPIC_SELECTED',
'selected');
870 $this->tpl->parseCurrentBlock(
'topics_option');
876 $objects = (bool)$this->oGeneralSettings->get(
'objects_allow_custom_sorting');
880 $allow_objects_option = array(
881 'title' => $this->lng->txt(
'title'),
882 'author' => $this->lng->txt(
'author'),
883 'price' => $this->lng->txt(
'price_a')
885 $this->tpl->setCurrentBlock(
'order_field');
886 $this->tpl->setVariable(
'SORT_BY_TEXT', $this->lng->txt(
'sort_by'));
888 foreach($allow_objects_option as $key=> $value)
890 $this->tpl->setVariable(
'ORDER_FIELD_VALUE', $key);
891 $this->tpl->setVariable(
'ORDER_FIELD_TEXT', $value);
892 if(
$_POST[
'order_field'] == $key)
893 $this->tpl->setVariable(
'ORDER_FIELD_SELECTED',
'selected');
894 $this->tpl->parseCurrentBlock(
'order_field');
898 $topics = (bool)$this->oGeneralSettings->get(
'topics_allow_custom_sorting');
903 $allow_topics_option = array(
907 if(ANONYMOUS_USER_ID != $ilUser->getId())
921 $this->topic_id = $a_topic_id;
931 $this->
string = $a_str;
941 $this->type = $a_type;
951 $this->sort_direction = $a_sort_direction;
961 $this->sort_field = $a_field;
973 if(ANONYMOUS_USER_ID == $ilUser->getId() &&
980 $this->sort_type_topics = $a_field;
987 if(ANONYMOUS_USER_ID == $ilUser->getId() &&
999 $_SESSION[
'shop_content'][
'shop_topics_sorting_direction'] = $this->sort_direction_topics = $a_sort_direction;
1012 $ilTabs->setTabActive(
'content');