ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilShopGUI Class Reference

Class ilShopGUI. More...

+ Inheritance diagram for ilShopGUI:
+ Collaboration diagram for ilShopGUI:

Public Member Functions

 __construct ($_post='')
 
 executeCommand ()
 
 clearFilter ()
 
 getPageHTML ()
 
 forwardToPageObject ()
 
 setFilter ()
 
 showShopExplorer ()
 
 performSearch ($oResult=null)
 
 resetFilter ()
 
 showSpecialContent ()
 
 showShopContent ($oResult)
 
 showContainerContent ()
 
 showGeneralFilter ($a_count_result=0)
 
 showTopicsFilter ($a_count_result=0)
 
 setTopicId ($a_topic_id)
 
 getTopicId ()
 
 setString ($a_str)
 
 getString ()
 
 setType ($a_type)
 
 getType ()
 
 setSortDirection ($a_sort_direction)
 
 getSortDirection ()
 
 setSortField ($a_field)
 
 getSortField ()
 
 setSortingTypeTopics ($a_field)
 
 getSortingTypeTopics ()
 
 setSortingDirectionTopics ($a_sort_direction)
 
 getSortingDirectionTopics ()
 
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()
 

Data Fields

const SHOP_PAGE_EDITOR_PAGE_ID = 99999999
 
 $genSet = null
 
 $cur_ref_id = null
 

Protected Member Functions

 prepareOutput ()
 
- Protected Member Functions inherited from ilShopBaseGUI
 prepareOutput ()
 
 addPager ($result, $a_session_key)
 
 buildSubTabs ()
 
 setSection ($a_section)
 
 getSection ()
 
 setSubSection ($a_sub_section)
 
 getSubSection ()
 
 showButton ($a_cmd, $a_text, $a_target='')
 
 initTableGUI ()
 
 setTableGUIBasicData ($tbl, $result_set, $a_default_order_column='')
 

Private Attributes

 $sort_type_topics = ''
 
 $sort_direction_topics = ''
 
 $sort_field = ''
 
 $sort_direction = ''
 
 $string = ''
 
 $type = ''
 
 $topic_id = 0
 

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $oGeneralSettings = null
 
 $section = 0
 
 $sub_section = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilShopGUI::__construct (   $_post = '')

Definition at line 34 of file class.ilShopGUI.php.

References $_GET, $_POST, $_SESSION, $ilCtrl, ilPaymentSettings\_getInstance(), setSortDirection(), setSortField(), setSortingDirectionTopics(), setSortingTypeTopics(), setString(), setTopicId(), and setType().

35  {
36  parent::__construct();
37 
38  global $ilCtrl;
39 
40  $this->cur_ref_id = (int)$_GET['ref_id'];
41  $this->cmd = $ilCtrl->getCmd();
42 
43  // set filter settings
44  $this->setType($_SESSION['shop_content']['type']);
45  $this->setString($_SESSION['shop_content']['text']);
46  $this->setTopicId($_POST['filter_topic_id']);
47 
48  // set sorting
49  $this->setSortingTypeTopics($_SESSION['shop_content']['order_topics_sorting_type']);
50  $this->setSortingDirectionTopics($_SESSION['shop_content']['shop_topics_sorting_direction']);
51 # $this->setSortField($_SESSION['shop_content']['shop_order_field']);
52  $this->setSortField($_POST['order_field']);
53  $this->setSortDirection($_SESSION['shop_content']['shop_order_direction']);
54 
55  $this->genSet = ilPaymentSettings::_getInstance();
56  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setSortingTypeTopics($a_field)
setSortingDirectionTopics($a_sort_direction)
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
setType($a_type)
global $ilCtrl
Definition: ilias.php:18
setString($a_str)
setSortField($a_field)
setTopicId($a_topic_id)
setSortDirection($a_sort_direction)
+ Here is the call graph for this function:

Member Function Documentation

◆ clearFilter()

ilShopGUI::clearFilter ( )

Definition at line 132 of file class.ilShopGUI.php.

References setString(), setTopicId(), and setType().

Referenced by executeCommand().

133  {
134  $this->setString('');
135  $this->setType('');
136  $this->setTopicId(0);
137 
138  #return $this->performSearch();
139  }
setType($a_type)
setString($a_str)
setTopicId($a_topic_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilShopGUI::executeCommand ( )

Definition at line 58 of file class.ilShopGUI.php.

References $_GET, $cmd, $ret, ilObject\_lookupObjId(), ilObject\_lookupType(), clearFilter(), forwardToPageObject(), prepareOutput(), and ilPaymentSettings\useShopSpecials().

59  {
60  $next_class = $this->ctrl->getNextClass($this);
61  switch($next_class)
62  {
63  case 'ilshoppagegui':
64  $this->prepareOutput();
65 
66  $ret = $this->forwardToPageObject();
67  if($ret != '')
68  {
69  $this->tpl->setContent($ret);
70  }
71  break;
72 
73  default:
74  switch($this->cmd)
75  {
76  case 'firstpage':
77  $this->clearFilter();
78 
79  if(!$this->genSet->get('show_general_filter')
80  && !$this->genSet->get('show_topics_filter')
81  && !$this->genSet->get('show_shop_explorer')
82  )
83  {
84  $cmd = 'performSearch';
85  }
86  else
87  {
89  {
90  $cmd = 'showSpecialContent';
91  }
92  else
93  {
94  $cmd = 'performSearch';
95  }
96  }
97  break;
98  case 'resetFilter':
99  $cmd = 'resetFilter';
100  break;
101  case 'setFilter':
102  $cmd = 'setFilter';
103  break;
104  default:
105  $cmd = 'performSearch';
106  break;
107  }
108 
109  if($this->cmd != 'firstpage' && (isset($_GET['ref_id']) || $this->cmd == 'showTree')) #&& $_GET['ref_id'] != ROOT_FOLDER_ID )
110  {
111  $obj_type = ilObject::_lookupType(ilObject::_lookupObjId($this->cur_ref_id));
112  $container = array("root", "cat", 'catr', "grp", "crs", 'crsr', 'rcrs');
113 
114  if(in_array($obj_type, $container))
115  {
116  $cmd = 'showContainerContent';
117  }
118  else
119  {
120  $cmd = 'performSearch';
121  }
122  }
123 
124  $this->prepareOutput();
125  $this->$cmd();
126  break;
127  }
128 
129  return true;
130  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ forwardToPageObject()

ilShopGUI::forwardToPageObject ( )

Definition at line 162 of file class.ilShopGUI.php.

References ilShopBaseGUI\$lng, ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

Referenced by executeCommand().

163  {
164  global $lng, $ilTabs;
165 
166  $ilTabs->clearTargets();
167  $ilTabs->setBackTarget($lng->txt('back'), $this->ctrl->getLinkTarget($this), '_top');
168 
169  // page object
170  include_once 'Services/Payment/classes/class.ilShopPage.php';
171  include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
172 
173  $lng->loadLanguageModule('content');
174 
175  include_once('./Services/Style/classes/class.ilObjStyleSheet.php');
176  $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
177 
178  if(!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID))
179  {
180  // doesn't exist -> create new one
181  $new_page_object = new ilShopPage();
182  $new_page_object->setParentId(0);
183  $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
184  $new_page_object->createFromXML();
185  }
186 
187  $this->ctrl->setReturnByClass('ilshoppagegui', 'edit');
188 
189  $page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
190 
191  return $this->ctrl->forwardCommand($page_gui);
192  }
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
Shop page object.
getContentStylePath($a_style_id)
get content style path
Shop page GUI class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageHTML()

ilShopGUI::getPageHTML ( )

Definition at line 141 of file class.ilShopGUI.php.

References ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

Referenced by showContainerContent(), showSpecialContent(), and showTopicsFilter().

142  {
143  // page object
144  include_once 'Services/Payment/classes/class.ilShopPage.php';
145  include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
146 
147  // if page does not exist, return nothing
148  if(!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID))
149  {
150  return '';
151  }
152 
153  include_once 'Services/Style/classes/class.ilObjStyleSheet.php';
154  $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
155 
156  // get page object
157  $page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
158 
159  return $page_gui->showPage();
160  }
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getContentStylePath($a_style_id)
get content style path
Shop page GUI class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSortDirection()

ilShopGUI::getSortDirection ( )

Definition at line 902 of file class.ilShopGUI.php.

References $sort_direction.

Referenced by performSearch(), showContainerContent(), showGeneralFilter(), and showSpecialContent().

903  {
904  return $this->sort_direction;
905  }
+ Here is the caller graph for this function:

◆ getSortField()

ilShopGUI::getSortField ( )

Definition at line 912 of file class.ilShopGUI.php.

References $sort_field.

Referenced by performSearch(), showContainerContent(), showGeneralFilter(), and showSpecialContent().

913  {
914  return $this->sort_field;
915  }
+ Here is the caller graph for this function:

◆ getSortingDirectionTopics()

ilShopGUI::getSortingDirectionTopics ( )

Definition at line 950 of file class.ilShopGUI.php.

References $sort_direction_topics.

Referenced by performSearch(), and showGeneralFilter().

951  {
953  }
+ Here is the caller graph for this function:

◆ getSortingTypeTopics()

ilShopGUI::getSortingTypeTopics ( )

Definition at line 931 of file class.ilShopGUI.php.

References $ilUser, $sort_type_topics, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by performSearch(), and showGeneralFilter().

932  {
933  global $ilUser;
934 
935  if(ANONYMOUS_USER_ID == $ilUser->getId() &&
936  $this->sort_type_topics == ilShopTopics::TOPICS_SORT_MANUALLY
937  )
938  {
939  $this->sort_type_topics = ilShopTopics::TOPICS_SORT_BY_TITLE;
940  }
941 
943  }
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ getString()

ilShopGUI::getString ( )

Definition at line 882 of file class.ilShopGUI.php.

References $string.

Referenced by performSearch().

883  {
884  return $this->string;
885  }
+ Here is the caller graph for this function:

◆ getTopicId()

ilShopGUI::getTopicId ( )

Definition at line 872 of file class.ilShopGUI.php.

References $topic_id.

Referenced by performSearch().

873  {
874  return $this->topic_id;
875  }
+ Here is the caller graph for this function:

◆ getType()

ilShopGUI::getType ( )

Definition at line 892 of file class.ilShopGUI.php.

References $type.

Referenced by performSearch().

893  {
894  return $this->type;
895  }
+ Here is the caller graph for this function:

◆ performSearch()

ilShopGUI::performSearch (   $oResult = null)

Definition at line 320 of file class.ilShopGUI.php.

References $_GET, $res, ilShopTopics\_getInstance(), ilObjectSearchFactory\_getShopMetaDataSearchInstance(), ilObjectSearchFactory\_getShopObjectSearchInstance(), ilShopBaseGUI\addPager(), getSortDirection(), getSortField(), getSortingDirectionTopics(), getSortingTypeTopics(), getString(), getTopicId(), getType(), QP_COMBINATION_AND, ilUtil\sendInfo(), SHOP_CONTENT, showShopContent(), and ilUtil\stripSlashes().

Referenced by resetFilter(), and setFilter().

321  {
322  if(!is_object($oResult))
323  {
324  $oResult = new ilShopSearchResult(SHOP_CONTENT);
325  if((bool)$this->oGeneralSettings->get('topics_allow_custom_sorting'))
326  {
327  ilShopTopics::_getInstance()->setIdFilter((int)$this->getTopicId());
328  ilShopTopics::_getInstance()->enableCustomSorting(true);
329  ilShopTopics::_getInstance()->setSortingType((int)$this->getSortingTypeTopics());
330  ilShopTopics::_getInstance()->setSortingDirection(strtoupper($this->getSortingDirectionTopics()));
331  ilShopTopics::_getInstance()->read();
332  }
333  else
334  {
335  ilShopTopics::_getInstance()->setIdFilter((int)$this->getTopicId());
336  ilShopTopics::_getInstance()->enableCustomSorting(false);
337  ilShopTopics::_getInstance()->setSortingType((int)$this->oGeneralSettings->get('topics_sorting_type'));
338  ilShopTopics::_getInstance()->setSortingDirection(strtoupper($this->oGeneralSettings->get('topics_sorting_direction')));
339  ilShopTopics::_getInstance()->read();
340  }
341 
342  $topics = ilShopTopics::_getInstance()->getTopics();
343 
344  $oResult->setTopics($topics);
345  $oResult->setResultPageNumber((int)$_GET['page_number']);
346  }
347 
348  // query parser
349  include_once 'Services/Search/classes/class.ilQueryParser.php';
350  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->getString()));
351  $query_parser->setMinWordLength(0);
352  $query_parser->setCombination(QP_COMBINATION_AND);
353  $query_parser->parse();
354  if(!$query_parser->validate())
355  {
356  ilUtil::sendInfo($query_parser->getMessage());
357  }
358 
359  // search
360  $types = array('crs', 'lm', 'sahs', 'htlm', 'file', 'tst', 'exc', 'glo');
361  if($this->getType() == '' || $this->getType() == 'title' ||
362  $query_parser->getQueryString() == ''
363  )
364  {
365  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
366  $object_search = ilObjectSearchFactory::_getShopObjectSearchInstance($query_parser);
367  $object_search->setFields(array('title'));
368  $object_search->setFilter($types);
369  $object_search->setCustomSearchResultObject($oResult);
370  $object_search->setFilterShopTopicId((int)$this->getTopicId());
371  $res = $object_search->performSearch();
372  }
373  else if($this->getType() == 'author')
374  {
375  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
376  $meta_search = ilObjectSearchFactory::_getShopMetaDataSearchInstance($query_parser);
377  $meta_search->setMode('contribute');
378  $meta_search->setFilter($types);
379  $meta_search->setFilterShopTopicId((int)$this->getTopicId());
380  $meta_search->setCustomSearchResultObject($oResult);
381  $res = $meta_search->performSearch();
382  }
383  else
384  {
385  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
386  $meta_search = ilObjectSearchFactory::_getShopMetaDataSearchInstance($query_parser);
387  $meta_search->setMode('title');
388  $meta_search->setFilter($types);
389  $meta_search->setCustomSearchResultObject($oResult);
390  $meta_search->setFilterShopTopicId((int)$this->getTopicId());
391  $res = $meta_search->performSearch();
392 
393  $meta_search = ilObjectSearchFactory::_getShopMetaDataSearchInstance($query_parser);
394  $meta_search->setMode('keyword');
395  $meta_search->setFilter($types);
396  $meta_search->setCustomSearchResultObject($oResult);
397  $meta_search->setFilterShopTopicId((int)$this->getTopicId());
398  $res->mergeEntries($meta_search->performSearch());
399  }
400 
401  $res->filter(ROOT_FOLDER_ID, true);
402  $res->save();
403 
404  if(!count($res->getResults()))
405  {
406  #ilUtil::sendInfo($this->lng->txt('payment_shop_not_objects_found'));
407  $this->tpl->setVariable('ERROR', $this->lng->txt('payment_shop_not_objects_found'));
408  }
409 
410  $this->showShopContent($res);
411 
412  include_once 'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
413  $search_result_presentation = new ilShopResultPresentationGUI($res);
414  $search_result_presentation->setSortField(strtolower(trim($this->getSortField())));
415  $search_result_presentation->setSortDirection(trim($this->getSortDirection()));
416 
417  $this->tpl->setVariable('RESULTS', $search_result_presentation->showResults());
418  $this->addPager($res, 'shop_content_maxpage');
419  return;
420  }
const SHOP_CONTENT
$_GET["client_id"]
searchResult stores all result of a search query.
addPager($result, $a_session_key)
showShopContent($oResult)
Class ilShopResultPresentationGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getSortingDirectionTopics()
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
static _getShopObjectSearchInstance($query_parser)
get reference of LikeShopObjectSearch.
const QP_COMBINATION_AND
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilShopGUI::prepareOutput ( )
protected

Definition at line 955 of file class.ilShopGUI.php.

Referenced by executeCommand().

956  {
957  global $ilTabs;
958 
959  parent::prepareOutput();
960  $ilTabs->setTabActive('content');
961  }
+ Here is the caller graph for this function:

◆ resetFilter()

ilShopGUI::resetFilter ( )

Definition at line 422 of file class.ilShopGUI.php.

References $_POST, $_SESSION, performSearch(), ilUtil\sendInfo(), setString(), setTopicId(), and setType().

Referenced by setFilter().

423  {
424  unset($_SESSION['content_filter']);
425  unset($_POST['sel_filter_type']);
426  unset($_POST['filter_text']);
427  unset($_POST['filter_topic_id']);
428  unset($_POST['order_field']);
429  unset($_POST['order_direction']);
430  unset($_POST['topics_sorting_type']);
431  unset($_POST['topics_sorting_direction']);
432  unset($_POST['updateView']);
433  unset($_POST['show_filter']);
434 
435  ilUtil::sendInfo($this->lng->txt('paya_filter_reseted'));
436  $this->setString('');
437  $this->setType('');
438  $this->setTopicId(0);
439 
440  $this->performSearch();
441  return;
442  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
setType($a_type)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setString($a_str)
performSearch($oResult=null)
setTopicId($a_topic_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFilter()

ilShopGUI::setFilter ( )

Definition at line 194 of file class.ilShopGUI.php.

References $_POST, $_SESSION, performSearch(), resetFilter(), setSortDirection(), setSortField(), setSortingDirectionTopics(), setSortingTypeTopics(), setString(), setTopicId(), and setType().

195  {
196  if(!$_POST['show_filter'] && $_POST['updateView'] == '1')
197  {
198  $this->resetFilter();
199  return;
200  }
201  else if($_POST['updateView'] == 1)
202  {
203  $_SESSION['content_filter']['updateView'] = $_POST['updateView'];
204  $_SESSION['content_filter']['show_filter'] = $_POST['show_filter'];
205  $_SESSION['content_filter']['sel_filter_type'] = $_POST['sel_filter_type'];
206  $_SESSION['content_filter']['filter_text'] = $_POST['filter_text'];
207  $_SESSION['content_filter']['filter_topic_id'] = $_POST['filter_topic_id'];
208 
209  $_SESSION['content_filter']['order_field'] = $_POST['order_field'];
210  $_SESSION['content_filter']['order_direction'] = $_POST['order_direction'];
211 
212  $_SESSION['content_filter']['topics_sorting_type'] = $_POST['topics_sorting_type'];
213  $_SESSION['content_filter']['topics_sorting_direction'] = $_POST['topics_sorting_direction'];
214  }
215 
216  $this->setString($_POST['filter_text']);
217  $this->setType($_POST['sel_filter_type']);
218  $this->setTopicId($_POST['filter_topic_id']);
219 
220  $this->setSortingTypeTopics($_POST['topics_sorting_type']);
221  $this->setSortingDirectionTopics($_POST['topics_sorting_direction']);
222  $this->setSortField($_POST['order_field']);
223  $this->setSortDirection('asc');
224 
225  $this->performSearch();
226  return;
227  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setSortingTypeTopics($a_field)
setSortingDirectionTopics($a_sort_direction)
$_POST['username']
Definition: cron.php:12
setType($a_type)
setString($a_str)
performSearch($oResult=null)
setSortField($a_field)
setTopicId($a_topic_id)
setSortDirection($a_sort_direction)
+ Here is the call graph for this function:

◆ setSortDirection()

ilShopGUI::setSortDirection (   $a_sort_direction)

Definition at line 897 of file class.ilShopGUI.php.

Referenced by __construct(), and setFilter().

898  {
899  $this->sort_direction = $a_sort_direction;
900  }
+ Here is the caller graph for this function:

◆ setSortField()

ilShopGUI::setSortField (   $a_field)

Definition at line 907 of file class.ilShopGUI.php.

Referenced by __construct(), and setFilter().

908  {
909  $this->sort_field = $a_field;
910  }
+ Here is the caller graph for this function:

◆ setSortingDirectionTopics()

ilShopGUI::setSortingDirectionTopics (   $a_sort_direction)

Definition at line 945 of file class.ilShopGUI.php.

References $_SESSION.

Referenced by __construct(), and setFilter().

946  {
947  $_SESSION['shop_content']['shop_topics_sorting_direction'] = $this->sort_direction_topics = $a_sort_direction;
948  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ setSortingTypeTopics()

ilShopGUI::setSortingTypeTopics (   $a_field)

Definition at line 917 of file class.ilShopGUI.php.

References $ilUser, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by __construct(), and setFilter().

918  {
919  global $ilUser;
920 
921  if(ANONYMOUS_USER_ID == $ilUser->getId() &&
923  )
924  {
926  }
927 
928  $this->sort_type_topics = $a_field;
929  }
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ setString()

ilShopGUI::setString (   $a_str)

Definition at line 877 of file class.ilShopGUI.php.

Referenced by __construct(), clearFilter(), resetFilter(), and setFilter().

878  {
879  $this->string = $a_str;
880  }
+ Here is the caller graph for this function:

◆ setTopicId()

ilShopGUI::setTopicId (   $a_topic_id)

Definition at line 867 of file class.ilShopGUI.php.

Referenced by __construct(), clearFilter(), resetFilter(), and setFilter().

868  {
869  $this->topic_id = $a_topic_id;
870  }
+ Here is the caller graph for this function:

◆ setType()

ilShopGUI::setType (   $a_type)

Definition at line 887 of file class.ilShopGUI.php.

Referenced by __construct(), clearFilter(), resetFilter(), and setFilter().

888  {
889  $this->type = $a_type;
890  }
+ Here is the caller graph for this function:

◆ showContainerContent()

ilShopGUI::showContainerContent ( )

Definition at line 554 of file class.ilShopGUI.php.

References $ilUser, $result, ilShopBaseGUI\$tpl, $type, ilPaymentObject\_getContainerObjects(), ilPaymentObject\_getObjectData(), ilPaymentObject\_isBuyable(), ilObject\_lookupDescription(), ilObject\_lookupObjId(), ilPaymentObject\_lookupPobjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), getPageHTML(), getSortDirection(), getSortField(), showGeneralFilter(), showShopExplorer(), and showTopicsFilter().

555  {
556  global $ilUser, $rbacreview, $ilToolbar, $tpl;
557 
558  if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
559  {
560  $ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
561  }
562 
563  include_once './Services/Payment/classes/class.ilPaymentObject.php';
564 
565  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
566  $this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
567 
568  $is_buyable = ilPaymentObject::_isBuyable($this->cur_ref_id);
569 
570  if($is_buyable)
571  {
573 
574  $obj_id = ilObject::_lookupObjId($this->cur_ref_id);
575  $title = ilObject::_lookupTitle($obj_id);
576  $description = ilObject::_lookupDescription($obj_id);
577  $type = ilObject::_lookupType($obj_id);
578 
579  $presentation_results[$pobjects['pt_topic_fk']][$type][] =
580  array(
581  'ref_id' => $pobjects['ref_id'],
582  'title' => $title,
583  'description' => $description,
584  'type' => $type,
585  'obj_id' => $obj_id,
586  'topic_id' => $pobjects['pt_topic_fk'],
587  'child' => $pobjects['child']
588  );
589  }
590  else
591  {
592  $pobjects = ilPaymentObject::_getContainerObjects($this->cur_ref_id);
593 
594  if(count($pobjects) >= 1)
595  {
596  foreach($pobjects as $result)
597  {
598  $obj_id = $result['obj_id'];
599  $title = $result['title'];
600  $description = $result['description'];
601  $type = $result['type'];
602 
603  $presentation_results[$result['pt_topic_fk']][$type][] =
604  array(
605  'ref_id' => $result['ref_id'],
606  'title' => $title,
607  'description' => $description,
608  'type' => $type,
609  'obj_id' => $obj_id,
610  'topic_id' => $result['pt_topic_fk'],
611  'child' => $result['child']
612  );
613  }
614  }
615  }
616 
617  include_once 'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
618  $search_result_presentation = new ilShopResultPresentationGUI($presentation_results);
619  $search_result_presentation->setSortField(strtolower(trim($this->getSortField())));
620  $search_result_presentation->setSortDirection(trim($this->getSortDirection()));
621 
622  $html = $search_result_presentation->showSpecials();
623 
624  $this->tpl->setVariable('RESULTS', $html);
625 
626  $show_general_filter = $this->oGeneralSettings->get('show_general_filter');
627  $show_topics_filter = $this->oGeneralSettings->get('show_topics_filter');
628  $show_shop_explorer = $this->oGeneralSettings->get('show_shop_explorer');
629 
630  if($show_general_filter)
631  {
632  $g_filter_html = $this->showGeneralFilter(count($search_result_presentation));
633  $this->tpl->setVariable('FORM', $g_filter_html);
634  }
635  if($show_topics_filter)
636  {
637  $this->showTopicsFilter(count($search_result_presentation));
638  }
639  if($show_shop_explorer)
640  {
641  $this->showShopExplorer();
642  }
643  }
$result
static _lookupPobjectId($a_ref_id)
static _getContainerObjects($a_ref_id)
static _getObjectData($a_id)
static _lookupTitle($a_id)
lookup object title
Class ilShopResultPresentationGUI.
static _isBuyable($a_ref_id, $a_subtype='')
showGeneralFilter($a_count_result=0)
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
showTopicsFilter($a_count_result=0)
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ showGeneralFilter()

ilShopGUI::showGeneralFilter (   $a_count_result = 0)

Definition at line 645 of file class.ilShopGUI.php.

References $_SESSION, $ilUser, ilShopTopics\_getInstance(), getSortDirection(), getSortField(), getSortingDirectionTopics(), getSortingTypeTopics(), ilTextInputGUI\setValue(), ilShopTopics\TOPICS_SORT_BY_CREATEDATE, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by showContainerContent(), showShopContent(), and showSpecialContent().

646  {
647  global $ilUser;
648 
649  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
650 
651  $filter_form = new ilPropertyFormGUI();
652  $filter_form->setFormAction($this->ctrl->getFormAction($this));
653  $filter_form->setTitle($this->lng->txt('pay_filter'));
654  $filter_form->setId('formular');
655  $filter_form->setTableWidth('100 %');
656 
657  $o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'), 'show_filter');
658  $o_hide_check->setValue(1);
659  $o_hide_check->setChecked($_SESSION['content_filter']['show_filter'] ? 1 : 0);
660 
661  $o_hidden = new ilHiddenInputGUI('updateView');
662  $o_hidden->setValue(1);
663  $o_hidden->setPostVar('updateView');
664  $o_hide_check->addSubItem($o_hidden);
665 
666  $o_filter = new ilSelectInputGUI();
667  $filter_option = array(
668  'title' => $this->lng->txt('title'),
669  'author' => $this->lng->txt('author'),
670  'metadata' => $this->lng->txt('meta_data')
671  );
672  $o_filter->setTitle($this->lng->txt('search_in'));
673  $o_filter->setOptions($filter_option);
674  $o_filter->setValue($_SESSION['content_filter']['sel_filter_type']);
675  $o_filter->setPostVar('sel_filter_type');
676  $o_hide_check->addSubItem($o_filter);
677  $o_filter_by = new ilTextInputGUI($this->lng->txt('filter_by'));
678  $o_filter_by->setValue($_SESSION['content_filter']['filter_text']);
679  $o_filter_by->setPostVar('filter_text');
680  $o_hide_check->addSubItem($o_filter_by);
681 
682  ilShopTopics::_getInstance()->setIdFilter(false);
683  ilShopTopics::_getInstance()->read();
684  $topic_option = array();
685  if(count(ilShopTopics::_getInstance()->getTopics()))
686  {
687  $topic_option[''] = $this->lng->txt('please_select');
688  foreach(ilShopTopics::_getInstance()->getTopics() as $oTopic)
689  {
690  $topic_option[$oTopic->getId()] = $oTopic->getTitle();
691  }
692  }
693  else
694  {
695  $topic_option[''] = $this->lng->txt('no_topics_yet');
696  }
697  $o_topic = new ilSelectInputGUI();
698  $o_topic->setTitle($this->lng->txt('topic'));
699  $o_topic->setOptions($topic_option);
700  $o_topic->setValue($_SESSION['content_filter']['filter_topic_id']);
701  $o_topic->setPostVar('filter_topic_id');
702  $o_hide_check->addSubItem($o_topic);
703 
704  #if(count($oResult->getResults()))
705  if($a_count_result)
706  {
707  $objects = (bool)$this->oGeneralSettings->get('objects_allow_custom_sorting');
708  if($objects)
709  {
710  // sorting form
711  $allow_objects_option = array(
712  'title' => $this->lng->txt('title'),
713  'author' => $this->lng->txt('author'),
714  'price' => $this->lng->txt('price_a')
715  );
716  $o_allow_objects = new ilSelectInputGUI();
717  $o_allow_objects->setTitle($this->lng->txt('sort_by'));
718  $o_allow_objects->setOptions($allow_objects_option);
719  $o_allow_objects->setValue($this->getSortField());
720  $o_allow_objects->setPostVar('order_field'); //objects_sorting_type
721  $o_hide_check->addSubItem($o_allow_objects);
722 
723  $direction_option = array(
724  'asc' => $this->lng->txt('sort_asc'),
725  'desc' => $this->lng->txt('sort_desc')
726  );
727 
728  $o_object_direction = new ilSelectInputGUI();
729 
730  $o_object_direction->setOptions($direction_option);
731  $o_object_direction->setValue($this->getSortDirection());
732  $o_object_direction->setPostVar('order_direction'); //objects_sorting_direction
733 
734  $o_hide_check->addSubItem($o_object_direction);
735  }
736 
737  $topics = (bool)$this->oGeneralSettings->get('topics_allow_custom_sorting');
738  if($topics)
739  {
740  // sorting form
741  $allow_topics_option = array(
742  ilShopTopics::TOPICS_SORT_BY_TITLE => $this->lng->txt('sort_topics_by_title'),
743  ilShopTopics::TOPICS_SORT_BY_CREATEDATE => $this->lng->txt('sort_topics_by_date')
744  );
745  if(ANONYMOUS_USER_ID != $ilUser->getId())
746  {
747  $allow_topics_option[ilShopTopics::TOPICS_SORT_MANUALLY] = $this->lng->txt('sort_topics_manually');
748  }
749 
750  $o_allow_topics = new ilSelectInputGUI();
751  $o_allow_topics->setTitle($this->lng->txt('sort_topics_by'));
752  $o_allow_topics->setOptions($allow_topics_option);
753 
754  $o_allow_topics->setValue($this->getSortingTypeTopics());
755  $o_allow_topics->setPostVar('topics_sorting_type');
756  $o_hide_check->addSubItem($o_allow_topics);
757 
758  $direction_option = array(
759  'asc' => $this->lng->txt('sort_asc'),
760  'desc' => $this->lng->txt('sort_desc')
761  );
762 
763  $o_topics_direction = new ilSelectInputGUI();
764  $o_topics_direction->setOptions($direction_option);
765  $o_topics_direction->setValue($this->getSortingDirectionTopics());
766  $o_topics_direction->setPostVar('topics_sorting_direction'); //objects_sorting_type
767 
768  $o_hide_check->addSubItem($o_topics_direction);
769  }
770  }
771 
772  $filter_form->addCommandButton('setFilter', $this->lng->txt('pay_update_view'));
773  $filter_form->addCommandButton('resetFilter', $this->lng->txt('pay_reset_filter'));
774  $filter_form->addItem($o_hide_check);
775 
776  return $filter_form->getHTML();
777  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
const TOPICS_SORT_BY_CREATEDATE
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a hidden form property in a property form.
getSortingDirectionTopics()
This class represents a text property in a property form.
global $ilUser
Definition: imgupload.php:15
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showShopContent()

ilShopGUI::showShopContent (   $oResult)

Definition at line 516 of file class.ilShopGUI.php.

References $ilUser, showGeneralFilter(), showShopExplorer(), and showTopicsFilter().

Referenced by performSearch().

517  {
518  global $ilUser, $rbacreview, $ilToolbar;
519 
520  if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
521  {
522  $ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
523  }
524 
525  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
526  if(!count($oResult->getResults()))
527  {
528  $this->tpl->setVariable('ERROR', $this->lng->txt('payment_shop_not_objects_found'));
529  #$this->tpl->setVariable('ERROR',ilUtil::sendInfo($this->lng->txt('payment_shop_not_objects_found')));
530  }
531 
532  $show_general_filter = $this->oGeneralSettings->get('show_general_filter');
533  $show_topics_filter = $this->oGeneralSettings->get('show_topics_filter');
534  $show_shop_explorer = $this->oGeneralSettings->get('show_shop_explorer');
535 
536  if($show_general_filter)
537  {
538  $g_filter_html = $this->showGeneralFilter(count($oResult->getResults()));
539  $this->tpl->setVariable('FORM', $g_filter_html);
540  }
541  if($show_topics_filter)
542  {
543  $this->showTopicsFilter(count($oResult->getResults()));
544  }
545  if($show_shop_explorer)
546  {
547  $this->showShopExplorer();
548  }
549  }
showGeneralFilter($a_count_result=0)
showTopicsFilter($a_count_result=0)
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showShopExplorer()

ilShopGUI::showShopExplorer ( )

Definition at line 229 of file class.ilShopGUI.php.

References $_GET, $ilCtrl, ilShopBaseGUI\$lng, $path, ilShopBaseGUI\$tpl, ilObject\_getIcon(), ilObject\_lookupObjId(), and exit.

Referenced by showContainerContent(), showShopContent(), and showSpecialContent().

230  {
231  global $ilCtrl, $tree, $lng;
232 
233  $ilCtrl->setParameter($this, "active_node", $_GET["active_node"]);
234  $shop_explorer_tpl = new ilTemplate('tpl.shop_explorer.html', true, true, 'Services/Payment');
235 
236  include_once ("./Services/Payment/classes/class.ilShopRepositoryExplorer.php");
237 
238  $active_node = ($_GET["active_node"] >= 1)
239  ? $_GET["active_node"]
240  : ($_GET["ref_id"] >= 1)
241  ? $_GET["ref_id"]
242  : 0;
243 
244  $top_node = 0;
245 
246  $exp = new ilShopRepositoryExplorer("ilias.php", $top_node);
247  $exp->setUseStandardFrame(false);
248  $exp->setExpandTarget("ilias.php?baseClass=ilshopcontroller&ref_id=1&cmd=showTree");
249 
250  $exp->setFrameUpdater("tree", "updater");
251  $exp->setTargetGet("ref_id");
252 
253  if($_GET["repexpand"] == "")
254  {
255  $expanded = $tree->readRootId();
256  }
257  else
258  {
259  $expanded = $_GET["repexpand"];
260  }
261 
262  $exp->setExpand($expanded);
263 
264  if($active_node > 0)
265  {
266  $path = $tree->getPathId($active_node);
267  if($top_node > 0)
268  {
269  $exp->setForceOpenPath($path);
270  $exp->setExpand($expanded);
271  }
272  else
273  {
274  $exp->setForceOpenPath($path + array($top_node));
275  }
276  $exp->highlightNode($active_node);
277  }
278 
279  // build html-output
280  if($top_node > 0)
281  {
282  $head_tpl = new ilTemplate("tpl.cont_tree_head.html", true, true,
283  "Services/Repository");
284  $path = ilObject::_getIcon(ROOT_FOLDER_ID, "tiny", "root");
285  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
286  $title = $nd["title"];
287  if($title == "ILIAS")
288  {
289  $title = $lng->txt("repository");
290  }
291  $head_tpl->setVariable("IMG_SRC", $path);
292  $head_tpl->setVariable("ALT_IMG", $lng->txt("icon") . " " . $title);
293  $head_tpl->setVariable("LINK_TXT", $title);
294  $head_tpl->setVariable("LINK_HREF", "ilias.php?baseClass=ilshopcontroller&ref_id=1");
295  $exp->setTreeLead($head_tpl->get());
296 
297  $exp->initItemCounter(1);
298  $exp->setOutput($tree->getParentId($top_node), 1,
299  ilObject::_lookupObjId($tree->getParentId($top_node)));
300  }
301  else
302  {
303  $exp->setOutput(0);
304  }
305  $output = $exp->getOutput(true);
306 
307  // asynchronous output
308  if($ilCtrl->isAsynch())
309  {
310  echo $output;
311  exit;
312  }
313  $shop_explorer_tpl->setVariable("EXPLORER", $output);
314  $ilCtrl->setParameter($this, "repexpand", $_GET["repexpand"]);
315 
316  global $tpl;
317  $tpl->setLeftContent($shop_explorer_tpl->get());
318  }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
exit
Definition: login.php:54
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSpecialContent()

ilShopGUI::showSpecialContent ( )

Definition at line 445 of file class.ilShopGUI.php.

References $ilUser, $result, $type, ilPaymentObject\_getSpecialObjects(), ilObject\_lookupDescription(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), getPageHTML(), getSortDirection(), getSortField(), showGeneralFilter(), showShopExplorer(), and showTopicsFilter().

446  {
447  global $ilUser, $rbacreview, $ilToolbar;
448 
449  if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
450  {
451  $ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
452  }
453 
454  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
455  $this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
456 
457  include_once './Services/Payment/classes/class.ilPaymentObject.php';
458  #$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
459 
461  if(count($pobjects))
462  {
463  foreach($pobjects as $result)
464  {
465  $obj_id = ilObject::_lookupObjId($result['ref_id']);
466  $title = ilObject::_lookupTitle($obj_id);
467  $description = ilObject::_lookupDescription($obj_id);
468  $type = ilObject::_lookupType($obj_id);
469 
470  $presentation_results[$result['pt_topic_fk']][$type][] =
471  array(
472  'ref_id' => $result['ref_id'],
473  'title' => $title,
474  'description' => $description,
475  'type' => $type,
476  'obj_id' => $obj_id,
477  'topic_id' => $result['pt_topic_fk'],
478  'child' => $result['child']
479  );
480  }
481  $this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
482  }
483  else
484  {
485  $this->tpl->setVariable('PAGE_CONTENT', $this->lng->txt('please_choose_category'));
486  }
487 
488  include_once 'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
489  $search_result_presentation = new ilShopResultPresentationGUI($presentation_results);
490  $search_result_presentation->setSortField(strtolower(trim($this->getSortField())));
491  $search_result_presentation->setSortDirection(trim($this->getSortDirection()));
492 
493  $html = $search_result_presentation->showSpecials();
494 
495  $this->tpl->setVariable('RESULTS', $html);
496 
497  $show_general_filter = $this->oGeneralSettings->get('show_general_filter');
498  $show_topics_filter = $this->oGeneralSettings->get('show_topics_filter');
499  $show_shop_explorer = $this->oGeneralSettings->get('show_shop_explorer');
500 
501  if($show_general_filter)
502  {
503  $g_filter_html = $this->showGeneralFilter(count($search_result_presentation));
504  $this->tpl->setVariable('FORM', $g_filter_html);
505  }
506  if($show_topics_filter)
507  {
508  $this->showTopicsFilter(count($search_result_presentation));
509  }
510  if($show_shop_explorer)
511  {
512  $this->showShopExplorer();
513  }
514  }
$result
static _lookupTitle($a_id)
lookup object title
Class ilShopResultPresentationGUI.
showGeneralFilter($a_count_result=0)
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
showTopicsFilter($a_count_result=0)
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ showTopicsFilter()

ilShopGUI::showTopicsFilter (   $a_count_result = 0)

Definition at line 779 of file class.ilShopGUI.php.

References $_POST, $ilUser, ilShopTopics\_getInstance(), getPageHTML(), ilShopTopics\TOPICS_SORT_BY_CREATEDATE, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by showContainerContent(), showShopContent(), and showSpecialContent().

780  {
781  global $ilUser;
782 
783  $this->tpl->setCurrentBlock('show_topics_filter');
784 
785  ilShopTopics::_getInstance()->setIdFilter(false);
786  ilShopTopics::_getInstance()->read();
787 
788  if(count(ilShopTopics::_getInstance()->getTopics()))
789  {
790  $this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
791  $this->tpl->setVariable('SORTING_FORM_ACTION', $this->ctrl->getFormAction($this, 'setFilter'));
792 
793  $this->tpl->setVariable('SET_FILTER_VAL', $this->lng->txt('pay_update_view'));
794 
795  $this->tpl->setCurrentBlock('topics_option');
796  $this->tpl->setVariable('SORT_TOPICS', $this->lng->txt('topic'));
797 
798  $this->tpl->setVariable('FILTER_TOPIC_ID', 'no_selection');
799  $this->tpl->setVariable('FILTER_TOPIC_TEXT', '------------');
800  if($_POST['cmd'] == 'firstpage')
801  $this->tpl->setVariable('FILTER_TOPIC_SELECTED', 'selected');
802  $this->tpl->parseCurrentBlock('topics_option');
803 
804  $this->tpl->setVariable('FILTER_TOPIC_ID', 'all');
805  $this->tpl->setVariable('FILTER_TOPIC_TEXT', $this->lng->txt('all'));
806  if($_POST['filter_topic_id'] == 'all')
807  $this->tpl->setVariable('FILTER_TOPIC_SELECTED', 'selected');
808  $this->tpl->parseCurrentBlock('topics_option');
809 
810  $oTopics = array();
811  $oTopics = ilShopTopics::_getInstance()->getTopics();
812  foreach($oTopics as $oTopic)
813  {
814  $this->tpl->setVariable('FILTER_TOPIC_ID', $oTopic->getId());
815  $this->tpl->setVariable('FILTER_TOPIC_TEXT', $oTopic->getTitle());
816  if($_POST['filter_topic_id'] == $oTopic->getId())
817  $this->tpl->setVariable('FILTER_TOPIC_SELECTED', 'selected');
818  $this->tpl->parseCurrentBlock('topics_option');
819  }
820  }
821 
822  if($a_count_result)
823  {
824  $objects = (bool)$this->oGeneralSettings->get('objects_allow_custom_sorting');
825  if($objects)
826  {
827  // sorting form
828  $allow_objects_option = array(
829  'title' => $this->lng->txt('title'),
830  'author' => $this->lng->txt('author'),
831  'price' => $this->lng->txt('price_a')
832  );
833  $this->tpl->setCurrentBlock('order_field');
834  $this->tpl->setVariable('SORT_BY_TEXT', $this->lng->txt('sort_by'));
835 
836  foreach($allow_objects_option as $key=> $value)
837  {
838  $this->tpl->setVariable('ORDER_FIELD_VALUE', $key);
839  $this->tpl->setVariable('ORDER_FIELD_TEXT', $value);
840  if($_POST['order_field'] == $key)
841  $this->tpl->setVariable('ORDER_FIELD_SELECTED', 'selected');
842  $this->tpl->parseCurrentBlock('order_field');
843  }
844  }
845 
846  $topics = (bool)$this->oGeneralSettings->get('topics_allow_custom_sorting');
847 
848  if($topics)
849  {
850  // sorting form
851  $allow_topics_option = array(
852  ilShopTopics::TOPICS_SORT_BY_TITLE => $this->lng->txt('sort_topics_by_title'),
853  ilShopTopics::TOPICS_SORT_BY_CREATEDATE => $this->lng->txt('sort_topics_by_date')
854  );
855  if(ANONYMOUS_USER_ID != $ilUser->getId())
856  {
857  $allow_topics_option[ilShopTopics::TOPICS_SORT_MANUALLY] = $this->lng->txt('sort_topics_manually');
858  }
859 // $direction_option = array(
860 // 'asc' => $this->lng->txt('sort_asc'),
861 // 'desc' => $this->lng->txt('sort_desc')
862 // );
863  }
864  }
865  }
const TOPICS_SORT_BY_CREATEDATE
$_POST['username']
Definition: cron.php:12
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $cur_ref_id

ilShopGUI::$cur_ref_id = null

Definition at line 32 of file class.ilShopGUI.php.

◆ $genSet

ilShopGUI::$genSet = null

Definition at line 30 of file class.ilShopGUI.php.

◆ $sort_direction

ilShopGUI::$sort_direction = ''
private

Definition at line 24 of file class.ilShopGUI.php.

Referenced by getSortDirection().

◆ $sort_direction_topics

ilShopGUI::$sort_direction_topics = ''
private

Definition at line 22 of file class.ilShopGUI.php.

Referenced by getSortingDirectionTopics().

◆ $sort_field

ilShopGUI::$sort_field = ''
private

Definition at line 23 of file class.ilShopGUI.php.

Referenced by getSortField().

◆ $sort_type_topics

ilShopGUI::$sort_type_topics = ''
private

Definition at line 21 of file class.ilShopGUI.php.

Referenced by getSortingTypeTopics().

◆ $string

ilShopGUI::$string = ''
private

Definition at line 25 of file class.ilShopGUI.php.

Referenced by getString().

◆ $topic_id

ilShopGUI::$topic_id = 0
private

Definition at line 27 of file class.ilShopGUI.php.

Referenced by getTopicId().

◆ $type

ilShopGUI::$type = ''
private

Definition at line 26 of file class.ilShopGUI.php.

Referenced by getType(), showContainerContent(), and showSpecialContent().

◆ SHOP_PAGE_EDITOR_PAGE_ID

const ilShopGUI::SHOP_PAGE_EDITOR_PAGE_ID = 99999999

Definition at line 19 of file class.ilShopGUI.php.


The documentation for this class was generated from the following file: