dbXapp 2.0
RAD, CMS, Module und Runtime-IDE fuer dbXapp
Loading...
Searching...
No Matches
dbxShop.class.php
Go to the documentation of this file.
1<?php
2namespace dbx\dbxShop;
3
4class dbxShop {
5
6 private function service() {
7 return dbx()->get_include_obj('dbxShopService', 'dbxShop');
8 }
9
10 private function alert(string $type, string $message): string {
11 $type = in_array($type, array('success', 'warning', 'danger', 'info'), true) ? $type : 'info';
12 return dbx()->get_system_obj('dbxTPL')->get_tpl('dbx|alert-' . $type, array(
13 'msg' => $message,
14 ));
15 }
16
17 public function run() {
18 $run = dbx()->get_modul_var('dbx_run1', 'catalog', 'parameter');
19
20 switch ($run) {
21 case '':
22 case 'start':
23 case 'catalog':
24 return $this->service()->catalog();
25
26 case 'product':
27 case 'detail':
28 return $this->service()->product();
29
30 case 'cart':
31 return $this->service()->cart();
32
33 case 'checkout':
34 return $this->service()->checkout();
35
36 case 'paypal_start':
37 return $this->service()->paypalStart();
38
39 case 'paypal_return':
40 return $this->service()->paypalReturn();
41
42 case 'paypal_cancel':
43 return $this->service()->paypalCancel();
44
45 case 'amazon_pay_return':
46 return $this->service()->amazonPayReturn();
47
48 case 'amazon_pay_cancel':
49 return $this->service()->amazonPayCancel();
50
51 case 'order':
52 case 'orders':
53 return $this->service()->orders();
54
55 case 'invoice_pdf':
56 return $this->service()->invoicePdf();
57
58 case 'channel_webhook':
59 return $this->service()->channelWebhook();
60
61 case 'legal':
62 case 'terms':
63 return $this->service()->legal();
64
65 case 'return':
66 case 'returns':
67 case 'withdrawal':
68 return $this->service()->withdrawal();
69
70 default:
71 return $this->alert('warning', 'Shop-Aufruf (' . htmlspecialchars((string) $run, ENT_QUOTES, 'UTF-8') . ') ist noch nicht definiert.');
72 }
73 }
74}
75?>
DBX schema administration.