4 include_once
'Services/Payment/classes/class.ilShopBaseGUI.php';
5 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
51 if($ilUser->getProfileIncomplete())
58 if( $ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired() )
63 $next_class = $this->ctrl->getNextClass($this);
64 $cmd = $this->ctrl->getCmd();
68 case 'ilpageobjectgui':
73 $this->tpl->setContent(
$ret);
79 $cmd =
'performSearch';
102 include_once
'Services/COPage/classes/class.ilPageObject.php';
103 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
111 include_once
'Services/Style/classes/class.ilObjStyleSheet.php';
115 $page_gui =
new ilPageObjectGUI(
'shop', self::SHOP_PAGE_EDITOR_PAGE_ID);
116 $page_gui->setIntLinkHelpDefault(
'StructureObject', self::SHOP_PAGE_EDITOR_PAGE_ID);
117 $page_gui->setLinkXML(
'');
118 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
119 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
120 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
121 $page_gui->setPresentationTitle(
'');
122 $page_gui->setTemplateOutput(
false);
123 $page_gui->setHeader(
'');
124 $page_gui->setEnabledRepositoryObjects(
false);
125 $page_gui->setEnabledFileLists(
true);
126 $page_gui->setEnabledPCTabs(
true);
127 $page_gui->setEnabledMaps(
true);
129 return $page_gui->showPage();
134 global
$lng, $ilTabs;
136 $ilTabs->clearTargets();
137 $ilTabs->setBackTarget($lng->txt(
'back'), $this->ctrl->getLinkTarget($this),
'_top');
140 include_once
'Services/COPage/classes/class.ilPageObject.php';
141 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
143 $lng->loadLanguageModule(
'content');
145 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
152 $new_page_object->setParentId(0);
153 $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
154 $new_page_object->createFromXML();
157 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
159 $page_gui =
new ilPageObjectGUI(
'shop', self::SHOP_PAGE_EDITOR_PAGE_ID);
160 $page_gui->setIntLinkHelpDefault(
'StructureObject', self::SHOP_PAGE_EDITOR_PAGE_ID);
161 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
162 $page_gui->setLinkXML(
'');
163 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
164 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
165 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
166 $page_gui->setPresentationTitle(
'');
167 $page_gui->setTemplateOutput(
false);
168 $page_gui->setHeader(
'');
169 $page_gui->setEnabledRepositoryObjects(
false);
170 $page_gui->setEnabledFileLists(
true);
171 $page_gui->setEnabledMaps(
true);
172 $page_gui->setEnabledPCTabs(
true);
174 return $this->ctrl->forwardCommand($page_gui);
198 if(!is_object($oResult))
201 if((
bool)$this->oGeneralSettings->get(
'topics_allow_custom_sorting'))
218 $oResult->setResultPageNumber((
int)
$_GET[
'page_number']);
222 include_once
'Services/Search/classes/class.ilQueryParser.php';
224 $query_parser->setMinWordLength(0);
226 $query_parser->parse();
227 if (!$query_parser->validate())
233 $types = array(
'crs',
'lm',
'sahs',
'htlm',
'file',
'tst');
235 $query_parser->getQueryString() ==
'')
237 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
239 $object_search->setFields(array(
'title'));
240 $object_search->setFilter($types);
241 $object_search->setCustomSearchResultObject($oResult);
242 $object_search->setFilterShopTopicId((
int)$this->
getTopicId());
243 $res = $object_search->performSearch();
245 else if($this->
getType() ==
'author')
248 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
250 $meta_search->setMode(
'contribute');
251 $meta_search->setFilter($types);
252 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
253 $meta_search->setCustomSearchResultObject($oResult);
254 $res = $meta_search->performSearch();
258 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
260 $meta_search->setMode(
'title');
261 $meta_search->setFilter($types);
262 $meta_search->setCustomSearchResultObject($oResult);
263 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
264 $res = $meta_search->performSearch();
267 $meta_search->setMode(
'keyword');
268 $meta_search->setFilter($types);
269 $meta_search->setCustomSearchResultObject($oResult);
270 $meta_search->setFilterShopTopicId((
int)$this->
getTopicId());
271 $res->mergeEntries($meta_search->performSearch());
274 $res->filter(ROOT_FOLDER_ID,
true);
277 if(!count(
$res->getResults()))
284 include_once
'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
286 $search_result_presentation->setSortField(strtolower(trim($this->
getSortField())));
287 $search_result_presentation->setSortDirection(trim($this->
getSortDirection()));
289 $this->tpl->setVariable(
'RESULTS', $search_result_presentation->showResults());
296 unset(
$_POST[
'sel_filter_type']);
297 unset(
$_POST[
'filter_text']);
298 unset(
$_POST[
'filter_topic_id']);
299 unset(
$_POST[
'order_field']);
300 unset(
$_POST[
'order_direction']);
301 unset(
$_POST[
'topics_sorting_type']);
302 unset(
$_POST[
'topics_sorting_direction']);
304 unset(
$_POST[
'updateView']);
305 unset(
$_POST[
'show_filter']);
318 global $ilUser, $rbacreview, $ilToolbar;
322 if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
324 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
327 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.shop_content.html',
'Services/Payment');
329 $this->tpl->setVariable(
'PAGE_CONTENT', $this->
getPageHTML());
331 if(!
$_POST[
'show_filter'] &&
$_POST[
'updateView'] ==
'1')
336 if (
$_POST[
'updateView'] == 1)
340 $_SESSION[
'content_filter'][
'sel_filter_type'] =
$_POST[
'sel_filter_type'];
342 $_SESSION[
'content_filter'][
'filter_topic_id'] =
$_POST[
'filter_topic_id'];
345 $_SESSION[
'content_filter'][
'order_direction'] =
$_POST[
'order_direction'];
347 $_SESSION[
'content_filter'][
'topics_sorting_type'] =
$_POST[
'topics_sorting_type'];
348 $_SESSION[
'content_filter'][
'topics_sorting_direction'] =
$_POST[
'topics_sorting_direction'];
351 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
354 $filter_form->setFormAction($this->ctrl->getFormAction($this));
355 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
356 $filter_form->setId(
'formular');
357 $filter_form->setTableWidth(
'100 %');
359 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
360 $o_hide_check->setValue(1);
361 $o_hide_check->setChecked(
$_SESSION[
'content_filter'][
'show_filter'] ? 1 : 0);
364 $o_hidden->setValue(1);
365 $o_hidden->setPostVar(
'updateView');
366 $o_hide_check->addSubItem($o_hidden);
369 $filter_option = array(
370 'title' => $this->lng->txt(
'title'),
371 'author' => $this->lng->txt(
'author'),
372 'metadata' => $this->lng->txt(
'meta_data')
374 $o_filter->setTitle($this->lng->txt(
'search_in'));
375 $o_filter->setOptions($filter_option);
376 $o_filter->setValue(
$_SESSION[
'content_filter'][
'sel_filter_type']);
377 $o_filter->setPostVar(
'sel_filter_type');
378 $o_hide_check->addSubItem($o_filter);
382 $o_filter_by->setPostVar(
'filter_text');
383 $o_hide_check->addSubItem($o_filter_by);
387 $topic_option = array();
390 $topic_option[
''] = $this->lng->txt(
'please_select');
393 $topic_option[$oTopic->getId()] = $oTopic->getTitle();
398 $topic_option[
''] = $this->lng->txt(
'no_topics_yet');
401 $o_topic->setTitle($this->lng->txt(
'topic'));
402 $o_topic->setOptions($topic_option);
403 $o_topic->setValue(
$_SESSION[
'content_filter'][
'filter_topic_id']);
404 $o_topic->setPostVar(
'filter_topic_id');
405 $o_hide_check->addSubItem($o_topic);
407 if(count($oResult->getResults()))
409 $objects = (bool)$this->oGeneralSettings->get(
'objects_allow_custom_sorting');
413 $allow_objects_option = array(
414 'title' => $this->lng->txt(
'title'),
415 'author' => $this->lng->txt(
'author'),
416 'price' => $this->lng->txt(
'price_a')
419 $o_allow_objects->setTitle($this->lng->txt(
'sort_by'));
420 $o_allow_objects->setOptions($allow_objects_option);
422 $o_allow_objects->setPostVar(
'order_field');
423 $o_hide_check->addSubItem($o_allow_objects);
425 $direction_option = array(
426 'asc' => $this->lng->txt(
'sort_asc'),
427 'desc' => $this->lng->txt(
'sort_desc')
432 $o_object_direction->setOptions($direction_option);
434 $o_object_direction->setPostVar(
'order_direction');
436 $o_hide_check->addSubItem($o_object_direction);
439 $topics = (bool)$this->oGeneralSettings->get(
'topics_allow_custom_sorting');
443 $allow_topics_option = array(
447 if(ANONYMOUS_USER_ID != $ilUser->getId())
453 $o_allow_topics->setTitle($this->lng->txt(
'sort_topics_by'));
454 $o_allow_topics->setOptions($allow_topics_option);
457 $o_allow_topics->setPostVar(
'topics_sorting_type');
458 $o_hide_check->addSubItem($o_allow_topics);
460 $direction_option = array(
461 'asc' => $this->lng->txt(
'sort_asc'),
462 'desc' => $this->lng->txt(
'sort_desc')
466 $o_topics_direction->setOptions($direction_option);
468 $o_topics_direction->setPostVar(
'topics_sorting_direction');
470 $o_hide_check->addSubItem($o_topics_direction);
474 $filter_form->addCommandButton(
'setFilter', $this->lng->txt(
'pay_update_view'));
475 $filter_form->addCommandButton(
'resetFilter', $this->lng->txt(
'pay_reset_filter'));
476 $filter_form->addItem($o_hide_check);
478 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
484 $_SESSION[
'shop_content'][
'shop_topic_id'] = $this->topic_id = $a_topic_id;
492 $_SESSION[
'shop_content'][
'text'] = $this->
string = $a_str;
500 $_SESSION[
'shop_content'][
'type'] = $this->type = $a_type;
508 $_SESSION[
'shop_content'][
'order_direction'] = $this->sort_direction = $a_sort_direction;
516 $_SESSION[
'shop_content'][
'shop_order_field'] = $this->sort_field = $a_field;
526 if(ANONYMOUS_USER_ID == $ilUser->getId() &&
532 $_SESSION[
'shop_content'][
'order_topics_sorting_type'] = $this->sort_type_topics = $a_field;
538 if(ANONYMOUS_USER_ID == $ilUser->getId() &&
550 $_SESSION[
'shop_content'][
'shop_topics_sorting_direction'] = $this->sort_direction_topics = $a_sort_direction;
563 $ilTabs->setTabActive(
'content');