ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilShopController Class Reference
+ Collaboration diagram for ilShopController:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 redirect ()
 

Protected Attributes

 $ctrl = null
 
 $ilErr = null
 
 $lng = null
 
 $tpl = null
 

Private Member Functions

 buildTabs ()
 

Detailed Description

Definition at line 41 of file class.ilShopController.php.

Constructor & Destructor Documentation

◆ __construct()

ilShopController::__construct ( )

Definition at line 48 of file class.ilShopController.php.

References $ilCtrl, $ilErr, $lng, and $tpl.

49  {
50  global $ilCtrl, $ilErr, $lng, $tpl;
51 
52  $this->ilErr = $ilErr;
53  $this->ctrl = $ilCtrl;
54  $this->lng = $lng;
55  $this->tpl = $tpl;
56  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ buildTabs()

ilShopController::buildTabs ( )
private

Definition at line 175 of file class.ilShopController.php.

References $ilUser, ilPaymentSettings\_getInstance(), and ilPaymentTrustees\_hasAccess().

Referenced by executeCommand().

176  {
177  global $ilTabs, $ilUser;
178 
179 // $shop_obj = new ilPaymentShoppingCart($ilUser);
180 
182  $allSet = $obj->getAll();
183 
184  $ilTabs->addTarget('content', $this->ctrl->getLinkTargetByClass('ilshopgui','firstpage'), '', '', '');
185 
186  if (!(bool)$allSet['hide_advanced_search']) {
187  $ilTabs->addTarget('advanced_search', $this->ctrl->getLinkTargetByClass('ilshopadvancedsearchgui'), '', '', '');
188  }
189  if (!(bool)$allSet['hide_shop_info'])
190  {
191  $ilTabs->addTarget('shop_info',$this->ctrl->getLinkTargetByClass('ilshopinfogui') ,'' , '', '');
192  }
193  if (!(bool)$allSet['hide_news'])
194  {
195  $ilTabs->addTarget('payment_news',$this->ctrl->getLinkTargetByClass('ilshopnewsgui'),'' , '', '');
196  }
197  if(ANONYMOUS_USER_ID != $ilUser->getId())
198  {
199  if((bool)ilPaymentSettings::_getInstance()->get('topics_allow_custom_sorting'))
200  {
201  $ilTabs->addTarget('pay_personal_settings', $this->ctrl->getLinkTargetByClass('ilshoppersonalsettingsgui'), '', '', '');
202  }
203 
204  // Only show if not empty
205  $ilTabs->addTarget('paya_buyed_objects', $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui'), '', '', '');
206 
207  // Only show if user is vendor
208  if(ilPaymentVendors::_isVendor($ilUser->getId()) ||
209  ilPaymentTrustees::_hasAccess($ilUser->getId()))
210  {
211  $ilTabs->addTarget('paya_header', $this->ctrl->getLinkTargetByClass('ilpaymentadmingui'), '', '', '');
212  }
213  }
214 
215  // Only show cart if not empty
216  $ilTabs->addTarget('paya_shopping_cart', $this->ctrl->getLinkTargetByClass('ilshopshoppingcartgui'), '', '', '');
217 
218  $ilTabs->addTarget('terms_conditions',$this->ctrl->getLinkTargetByClass(array('iltermsconditionsgui'), ''));
219  }
global $ilUser
Definition: imgupload.php:15
static _hasAccess($a_usr_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilShopController::executeCommand ( )

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

References $_GET, $cmd, $ilUser, ilPaymentSettings\_getInstance(), buildTabs(), and redirect().

59  {
60  global $ilUser;
61 
62  if(!IS_PAYMENT_ENABLED)
63  {
64  $this->ilErr->raiseError($this->lng->txt('permission_denied'), $this->ilErr->MESSAGE);
65  }
66 
67  $this->buildTabs();
68 
69  $next_class = $this->ctrl->getNextClass();
70  $cmd = $this->ctrl->getCmd();
71  $cmd_class = $this->ctrl->getCmdClass();
72 
73  if(!$next_class && $cmd_class)
74  {
75  $next_class = $cmd_class;
76  }
77 
79  $allSet = $obj->getAll();
80 
81  if(($ilUser->getId() == ANONYMOUS_USER_ID) && $next_class == 'ilshopboughtobjectsgui')
82  {
83  $next_class = 'ilshopshoppingcartgui';
84  }
85 
86  switch($next_class)
87  {
88  case 'ilpurchasebillgui':
89  include_once './Services/Payment/classes/class.ilPurchaseBillGUI.php';
90  $pt = new ilPurchaseBillGUI($ilUser);
91  $this->ctrl->forwardCommand($pt);
92  break;
93 
94  case 'ilpurchasebmfgui':
95  include_once './Services/Payment/classes/class.ilPurchaseBMFGUI.php';
96  $pt = new ilPurchaseBMFGUI($ilUser);
97  $this->ctrl->forwardCommand($pt);
98  break;
99 
100  case 'ilshopboughtobjectsgui':
101  include_once './Services/Payment/classes/class.ilShopBoughtObjectsGUI.php';
102  $this->ctrl->forwardCommand(new ilShopBoughtObjectsGUI($ilUser));
103  break;
104 
105  case 'ilshopshoppingcartgui':
106  include_once './Services/Payment/classes/class.ilShopShoppingCartGUI.php';
107  $this->ctrl->forwardCommand(new ilShopShoppingCartGUI($ilUser));
108  break;
109 
110  case 'ilshopadvancedsearchgui':
111  if ((bool) $allSet['hide_advanced_search'])
112  {
113  $this->ilErr->raiseError($this->lng->txt('permission_denied'), $this->ilErr->MESSAGE);
114  }
115  include_once './Services/Payment/classes/class.ilShopAdvancedSearchGUI.php';
116  $this->ctrl->forwardCommand(new ilShopAdvancedSearchGUI());
117  break;
118 
119  case 'ilshoppersonalsettingsgui':
120  include_once './Services/Payment/classes/class.ilShopPersonalSettingsGUI.php';
121  $this->ctrl->forwardCommand(new ilShopPersonalSettingsGUI());
122  break;
123 
124  case 'ilpaymentadmingui':
125  include_once './Services/Payment/classes/class.ilPaymentAdminGUI.php';
126  $this->ctrl->forwardCommand(new ilPaymentAdminGUI($ilUser));
127  break;
128 
129  case 'ilshopinfogui':
130  if ((bool) $allSet['hide_shop_info'])
131  {
132  $this->ilErr->raiseError($this->lng->txt('permission_denied'), $this->ilErr->MESSAGE);
133  }
134  include_once './Services/Payment/classes/class.ilShopInfoGUI.php';
135  $this->ctrl->forwardCommand(new ilShopInfoGUI());
136  break;
137 
138  case 'ilshopnewsgui':
139  if ((bool) $allSet['hide_news'])
140  {
141  $this->ilErr->raiseError($this->lng->txt('permission_denied'), $this->ilErr->MESSAGE);
142  }
143  include_once './Services/Payment/classes/class.ilShopNewsGUI.php';
144  $this->ctrl->forwardCommand(new ilShopNewsGUI());
145  break;
146 
147  case 'iltermsconditionsgui':
148 
149  include_once './Services/Payment/classes/class.ilTermsConditionsGUI.php';
150  $this->ctrl->forwardCommand(new ilTermsConditionsGUI());
151  break;
152 
153  case 'ilshoppurchasegui':
154  include_once './Services/Payment/classes/class.ilShopPurchaseGUI.php';
155  $this->ctrl->forwardCommand(new ilShopPurchaseGUI($_GET['ref_id']));
156  break;
157 
158  case 'ilshopgui':
159  default:
160  if($cmd == 'redirect')
161  {
162  $this->redirect();
163  }
164 
165  include_once './Services/Payment/classes/class.ilShopGUI.php';
166  $this->ctrl->forwardCommand(new ilShopGUI());
167  break;
168  }
169 
170  $this->tpl->show();
171 
172  return true;
173  }
Class ilTermsConditionsGUI.
Class ilShopShoppingCartGUI.
Class ilShopNewsGUI.
$_GET["client_id"]
Class ilShopBoughtObjectsGUI.
Class ilShopPurchaseGUI.
$cmd
Definition: sahs_server.php:35
Class ilShopGUI.
global $ilUser
Definition: imgupload.php:15
Class ilShopAdvancedSearchGUI.
Class ilShopInfoGUI.
Class ilShopPersonalSettingsGUI.
+ Here is the call graph for this function:

◆ redirect()

ilShopController::redirect ( )

Definition at line 221 of file class.ilShopController.php.

References $_GET, $ilCtrl, and ilUtil\stripSlashes().

Referenced by executeCommand().

222  {
223  global $ilCtrl;
224 
225  switch(strtolower(ilUtil::stripSlashes($_GET['redirect_class'])))
226  {
227  case 'ilshopshoppingcartgui':
228  $ilCtrl->redirectByClass('ilshopshoppingcartgui','','',false, false);
229  break;
230  case 'ilshopadvancedsearchgui':
231  $ilCtrl->redirectByClass('ilshopadvancedsearchgui','','',false, false);
232  break;
233  case 'ilshopboughtobjectsgui':
234  $ilCtrl->redirectByClass('ilshopboughtobjectsgui','','',false, false);
235  break;
236 
237  default:
238  break;
239  }
240  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilShopController::$ctrl = null
protected

Definition at line 43 of file class.ilShopController.php.

◆ $ilErr

ilShopController::$ilErr = null
protected

Definition at line 44 of file class.ilShopController.php.

Referenced by __construct().

◆ $lng

ilShopController::$lng = null
protected

Definition at line 45 of file class.ilShopController.php.

Referenced by __construct().

◆ $tpl

ilShopController::$tpl = null
protected

Definition at line 46 of file class.ilShopController.php.

Referenced by __construct().


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