@@ -1,189 +1,189 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -$app->group( $config( 'routes/admin', '/admin' ), function() use ( $config ) { |
|
4 | +$app->group($config('routes/admin', '/admin'), function() use ($config) { |
|
5 | 5 | |
6 | - $this->map(['GET', 'POST'], '', function( $request, $response, $args ) use ( $config ) { |
|
7 | - return $response->withHeader( 'Location', $config( 'routes/jqadm', '/admin/default/jqadm' ) . '/search/dashboard' ); |
|
8 | - })->setName( 'aimeos_shop_admin' ); |
|
6 | + $this->map(['GET', 'POST'], '', function($request, $response, $args) use ($config) { |
|
7 | + return $response->withHeader('Location', $config('routes/jqadm', '/admin/default/jqadm').'/search/dashboard'); |
|
8 | + })->setName('aimeos_shop_admin'); |
|
9 | 9 | |
10 | 10 | }); |
11 | 11 | |
12 | 12 | |
13 | -$app->group( $config( 'routes/jqadm', '/admin/{site}/jqadm' ), function() use ( $config ) { |
|
13 | +$app->group($config('routes/jqadm', '/admin/{site}/jqadm'), function() use ($config) { |
|
14 | 14 | |
15 | - $this->map(['GET'], '/file/{type}', function( $request, $response, $args ) { |
|
16 | - return \Aimeos\Slim\Controller\Jqadm::fileAction( $this, $request, $response, $args ); |
|
17 | - })->setName( 'aimeos_shop_jqadm_file' ); |
|
15 | + $this->map(['GET'], '/file/{type}', function($request, $response, $args) { |
|
16 | + return \Aimeos\Slim\Controller\Jqadm::fileAction($this, $request, $response, $args); |
|
17 | + })->setName('aimeos_shop_jqadm_file'); |
|
18 | 18 | |
19 | - $this->map(['GET', 'POST'], '/copy/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
20 | - return \Aimeos\Slim\Controller\Jqadm::copyAction( $this, $request, $response, $args ); |
|
21 | - })->setName( 'aimeos_shop_jqadm_copy' ); |
|
19 | + $this->map(['GET', 'POST'], '/copy/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
20 | + return \Aimeos\Slim\Controller\Jqadm::copyAction($this, $request, $response, $args); |
|
21 | + })->setName('aimeos_shop_jqadm_copy'); |
|
22 | 22 | |
23 | - $this->map(['GET', 'POST'], '/create/{resource:[a-z\/]+}', function( $request, $response, $args ) { |
|
24 | - return \Aimeos\Slim\Controller\Jqadm::createAction( $this, $request, $response, $args ); |
|
25 | - })->setName( 'aimeos_shop_jqadm_create' ); |
|
23 | + $this->map(['GET', 'POST'], '/create/{resource:[a-z\/]+}', function($request, $response, $args) { |
|
24 | + return \Aimeos\Slim\Controller\Jqadm::createAction($this, $request, $response, $args); |
|
25 | + })->setName('aimeos_shop_jqadm_create'); |
|
26 | 26 | |
27 | - $this->map(['GET', 'POST'], '/delete/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
28 | - return \Aimeos\Slim\Controller\Jqadm::deleteAction( $this, $request, $response, $args ); |
|
29 | - })->setName( 'aimeos_shop_jqadm_delete' ); |
|
27 | + $this->map(['GET', 'POST'], '/delete/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
28 | + return \Aimeos\Slim\Controller\Jqadm::deleteAction($this, $request, $response, $args); |
|
29 | + })->setName('aimeos_shop_jqadm_delete'); |
|
30 | 30 | |
31 | - $this->map(['GET', 'POST'], '/export/{resource:[a-z\/]+}', function( $request, $response, $args ) { |
|
32 | - return \Aimeos\Slim\Controller\Jqadm::exportAction( $this, $request, $response, $args ); |
|
33 | - })->setName( 'aimeos_shop_jqadm_export' ); |
|
31 | + $this->map(['GET', 'POST'], '/export/{resource:[a-z\/]+}', function($request, $response, $args) { |
|
32 | + return \Aimeos\Slim\Controller\Jqadm::exportAction($this, $request, $response, $args); |
|
33 | + })->setName('aimeos_shop_jqadm_export'); |
|
34 | 34 | |
35 | - $this->map(['GET'], '/get/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
36 | - return \Aimeos\Slim\Controller\Jqadm::getAction( $this, $request, $response, $args ); |
|
37 | - })->setName( 'aimeos_shop_jqadm_get' ); |
|
35 | + $this->map(['GET'], '/get/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
36 | + return \Aimeos\Slim\Controller\Jqadm::getAction($this, $request, $response, $args); |
|
37 | + })->setName('aimeos_shop_jqadm_get'); |
|
38 | 38 | |
39 | - $this->map(['POST'], '/save/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
40 | - return \Aimeos\Slim\Controller\Jqadm::saveAction( $this, $request, $response, $args ); |
|
41 | - })->setName( 'aimeos_shop_jqadm_save' ); |
|
39 | + $this->map(['POST'], '/save/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
40 | + return \Aimeos\Slim\Controller\Jqadm::saveAction($this, $request, $response, $args); |
|
41 | + })->setName('aimeos_shop_jqadm_save'); |
|
42 | 42 | |
43 | - $this->map(['GET', 'POST'], '/search/{resource:[a-z\/]+}', function( $request, $response, $args ) { |
|
44 | - return \Aimeos\Slim\Controller\Jqadm::searchAction( $this, $request, $response, $args ); |
|
45 | - })->setName( 'aimeos_shop_jqadm_search' ); |
|
43 | + $this->map(['GET', 'POST'], '/search/{resource:[a-z\/]+}', function($request, $response, $args) { |
|
44 | + return \Aimeos\Slim\Controller\Jqadm::searchAction($this, $request, $response, $args); |
|
45 | + })->setName('aimeos_shop_jqadm_search'); |
|
46 | 46 | |
47 | 47 | }); |
48 | 48 | |
49 | 49 | |
50 | -$app->group( $config( 'routes/jsonadm', '/admin/{site}/jsonadm' ), function() use ( $config ) { |
|
50 | +$app->group($config('routes/jsonadm', '/admin/{site}/jsonadm'), function() use ($config) { |
|
51 | 51 | |
52 | - $this->map(['DELETE'], '/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
53 | - return \Aimeos\Slim\Controller\Jsonadm::deleteAction( $this, $request, $response, $args ); |
|
54 | - })->setName( 'aimeos_shop_jsonadm_delete' ); |
|
52 | + $this->map(['DELETE'], '/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
53 | + return \Aimeos\Slim\Controller\Jsonadm::deleteAction($this, $request, $response, $args); |
|
54 | + })->setName('aimeos_shop_jsonadm_delete'); |
|
55 | 55 | |
56 | - $this->map(['GET'], '/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
57 | - return \Aimeos\Slim\Controller\Jsonadm::getAction( $this, $request, $response, $args ); |
|
58 | - })->setName( 'aimeos_shop_jsonadm_get' ); |
|
56 | + $this->map(['GET'], '/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
57 | + return \Aimeos\Slim\Controller\Jsonadm::getAction($this, $request, $response, $args); |
|
58 | + })->setName('aimeos_shop_jsonadm_get'); |
|
59 | 59 | |
60 | - $this->map(['PATCH'], '/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
61 | - return \Aimeos\Slim\Controller\Jsonadm::patchAction( $this, $request, $response, $args ); |
|
62 | - })->setName( 'aimeos_shop_jsonadm_patch' ); |
|
60 | + $this->map(['PATCH'], '/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
61 | + return \Aimeos\Slim\Controller\Jsonadm::patchAction($this, $request, $response, $args); |
|
62 | + })->setName('aimeos_shop_jsonadm_patch'); |
|
63 | 63 | |
64 | - $this->map(['POST'], '/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
65 | - return \Aimeos\Slim\Controller\Jsonadm::postAction( $this, $request, $response, $args ); |
|
66 | - })->setName( 'aimeos_shop_jsonadm_post' ); |
|
64 | + $this->map(['POST'], '/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
65 | + return \Aimeos\Slim\Controller\Jsonadm::postAction($this, $request, $response, $args); |
|
66 | + })->setName('aimeos_shop_jsonadm_post'); |
|
67 | 67 | |
68 | - $this->map(['PUT'], '/{resource:[a-z\/]+}[/{id}]', function( $request, $response, $args ) { |
|
69 | - return \Aimeos\Slim\Controller\Jsonadm::putAction( $this, $request, $response, $args ); |
|
70 | - })->setName( 'aimeos_shop_jsonadm_put' ); |
|
68 | + $this->map(['PUT'], '/{resource:[a-z\/]+}[/{id}]', function($request, $response, $args) { |
|
69 | + return \Aimeos\Slim\Controller\Jsonadm::putAction($this, $request, $response, $args); |
|
70 | + })->setName('aimeos_shop_jsonadm_put'); |
|
71 | 71 | |
72 | - $this->map(['OPTIONS'], '/[{resource}]', function( $request, $response, $args ) { |
|
73 | - return \Aimeos\Slim\Controller\Jsonadm::optionsAction( $this, $request, $response, $args ); |
|
74 | - })->setName( 'aimeos_shop_jsonadm_options' ); |
|
72 | + $this->map(['OPTIONS'], '/[{resource}]', function($request, $response, $args) { |
|
73 | + return \Aimeos\Slim\Controller\Jsonadm::optionsAction($this, $request, $response, $args); |
|
74 | + })->setName('aimeos_shop_jsonadm_options'); |
|
75 | 75 | |
76 | 76 | }); |
77 | 77 | |
78 | 78 | |
79 | -$app->group( $config( 'routes/jsonapi', '/jsonapi' ), function() use ( $config ) { |
|
79 | +$app->group($config('routes/jsonapi', '/jsonapi'), function() use ($config) { |
|
80 | 80 | |
81 | - $this->map(['DELETE'], '/{resource}', function( $request, $response, $args ) { |
|
82 | - return \Aimeos\Slim\Controller\Jsonapi::deleteAction( $this, $request, $response, $args ); |
|
83 | - })->setName( 'aimeos_shop_jsonapi_delete' ); |
|
81 | + $this->map(['DELETE'], '/{resource}', function($request, $response, $args) { |
|
82 | + return \Aimeos\Slim\Controller\Jsonapi::deleteAction($this, $request, $response, $args); |
|
83 | + })->setName('aimeos_shop_jsonapi_delete'); |
|
84 | 84 | |
85 | - $this->map(['GET'], '/{resource}', function( $request, $response, $args ) { |
|
86 | - return \Aimeos\Slim\Controller\Jsonapi::getAction( $this, $request, $response, $args ); |
|
87 | - })->setName( 'aimeos_shop_jsonapi_get' ); |
|
85 | + $this->map(['GET'], '/{resource}', function($request, $response, $args) { |
|
86 | + return \Aimeos\Slim\Controller\Jsonapi::getAction($this, $request, $response, $args); |
|
87 | + })->setName('aimeos_shop_jsonapi_get'); |
|
88 | 88 | |
89 | - $this->map(['PATCH'], '/{resource}', function( $request, $response, $args ) { |
|
90 | - return \Aimeos\Slim\Controller\Jsonapi::patchAction( $this, $request, $response, $args ); |
|
91 | - })->setName( 'aimeos_shop_jsonapi_patch' ); |
|
89 | + $this->map(['PATCH'], '/{resource}', function($request, $response, $args) { |
|
90 | + return \Aimeos\Slim\Controller\Jsonapi::patchAction($this, $request, $response, $args); |
|
91 | + })->setName('aimeos_shop_jsonapi_patch'); |
|
92 | 92 | |
93 | - $this->map(['POST'], '/{resource}', function( $request, $response, $args ) { |
|
94 | - return \Aimeos\Slim\Controller\Jsonapi::postAction( $this, $request, $response, $args ); |
|
95 | - })->setName( 'aimeos_shop_jsonapi_post' ); |
|
93 | + $this->map(['POST'], '/{resource}', function($request, $response, $args) { |
|
94 | + return \Aimeos\Slim\Controller\Jsonapi::postAction($this, $request, $response, $args); |
|
95 | + })->setName('aimeos_shop_jsonapi_post'); |
|
96 | 96 | |
97 | - $this->map(['PUT'], '/{resource}', function( $request, $response, $args ) { |
|
98 | - return \Aimeos\Slim\Controller\Jsonapi::putAction( $this, $request, $response, $args ); |
|
99 | - })->setName( 'aimeos_shop_jsonapi_put' ); |
|
97 | + $this->map(['PUT'], '/{resource}', function($request, $response, $args) { |
|
98 | + return \Aimeos\Slim\Controller\Jsonapi::putAction($this, $request, $response, $args); |
|
99 | + })->setName('aimeos_shop_jsonapi_put'); |
|
100 | 100 | |
101 | - $this->map(['OPTIONS'], '/[{resource}]', function( $request, $response, $args ) { |
|
102 | - return \Aimeos\Slim\Controller\Jsonapi::optionsAction( $this, $request, $response, $args ); |
|
103 | - })->setName( 'aimeos_shop_jsonapi_options' ); |
|
101 | + $this->map(['OPTIONS'], '/[{resource}]', function($request, $response, $args) { |
|
102 | + return \Aimeos\Slim\Controller\Jsonapi::optionsAction($this, $request, $response, $args); |
|
103 | + })->setName('aimeos_shop_jsonapi_options'); |
|
104 | 104 | |
105 | 105 | }); |
106 | 106 | |
107 | 107 | |
108 | -$app->group( $config( 'routes/account', '' ), function() { |
|
108 | +$app->group($config('routes/account', ''), function() { |
|
109 | 109 | |
110 | - $this->map(['GET', 'POST'], '/myaccount', function( $request, $response, $args ) { |
|
111 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
112 | - })->setName( 'aimeos_shop_account' ); |
|
110 | + $this->map(['GET', 'POST'], '/myaccount', function($request, $response, $args) { |
|
111 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
112 | + })->setName('aimeos_shop_account'); |
|
113 | 113 | |
114 | - $this->map(['GET', 'POST'], '/myaccount/favorite[/{fav_action}/{fav_id:[0-9]+}[/{d_name}]]', function( $request, $response, $args ) { |
|
115 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
116 | - })->setName( 'aimeos_shop_account_favorite' ); |
|
114 | + $this->map(['GET', 'POST'], '/myaccount/favorite[/{fav_action}/{fav_id:[0-9]+}[/{d_name}]]', function($request, $response, $args) { |
|
115 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
116 | + })->setName('aimeos_shop_account_favorite'); |
|
117 | 117 | |
118 | - $this->map(['GET', 'POST'], '/myaccount/watch[/{wat_action}/{wat_id:[0-9]+}[/{d_name}]]', function( $request, $response, $args ) { |
|
119 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
120 | - })->setName( 'aimeos_shop_account_watch' ); |
|
118 | + $this->map(['GET', 'POST'], '/myaccount/watch[/{wat_action}/{wat_id:[0-9]+}[/{d_name}]]', function($request, $response, $args) { |
|
119 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
120 | + })->setName('aimeos_shop_account_watch'); |
|
121 | 121 | |
122 | - $this->map(['GET', 'POST'], '/myaccount/download/{dl_id}', function( $request, $response, $args ) { |
|
123 | - return \Aimeos\Slim\Controller\Account::downloadAction( $this, $request, $response, $args ); |
|
124 | - })->setName( 'aimeos_shop_account_download' ); |
|
122 | + $this->map(['GET', 'POST'], '/myaccount/download/{dl_id}', function($request, $response, $args) { |
|
123 | + return \Aimeos\Slim\Controller\Account::downloadAction($this, $request, $response, $args); |
|
124 | + })->setName('aimeos_shop_account_download'); |
|
125 | 125 | |
126 | 126 | }); |
127 | 127 | |
128 | 128 | |
129 | -$app->group( $config( 'routes/default', '' ), function() { |
|
129 | +$app->group($config('routes/default', ''), function() { |
|
130 | 130 | |
131 | - $this->map(['GET', 'POST'], '/count', function( $request, $response, $args ) { |
|
132 | - return \Aimeos\Slim\Controller\Catalog::countAction( $this, $request, $response, $args ); |
|
133 | - })->setName( 'aimeos_shop_count' ); |
|
131 | + $this->map(['GET', 'POST'], '/count', function($request, $response, $args) { |
|
132 | + return \Aimeos\Slim\Controller\Catalog::countAction($this, $request, $response, $args); |
|
133 | + })->setName('aimeos_shop_count'); |
|
134 | 134 | |
135 | - $this->map(['GET', 'POST'], '/d/{d_name}/{d_prodid}[/{d_pos:[0-9]+}]', function( $request, $response, $args ) { |
|
136 | - return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args ); |
|
137 | - })->setName( 'aimeos_shop_detail' ); |
|
135 | + $this->map(['GET', 'POST'], '/d/{d_name}/{d_prodid}[/{d_pos:[0-9]+}]', function($request, $response, $args) { |
|
136 | + return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args); |
|
137 | + })->setName('aimeos_shop_detail'); |
|
138 | 138 | |
139 | - $this->map(['GET', 'POST'], '/d/pin[/{pin_action}/{pin_id}[/{d_name}]]', function( $request, $response, $args ) { |
|
140 | - return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args ); |
|
141 | - })->setName( 'aimeos_shop_session_pinned' ); |
|
139 | + $this->map(['GET', 'POST'], '/d/pin[/{pin_action}/{pin_id}[/{d_name}]]', function($request, $response, $args) { |
|
140 | + return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args); |
|
141 | + })->setName('aimeos_shop_session_pinned'); |
|
142 | 142 | |
143 | - $this->map(['GET', 'POST'], '/list', function( $request, $response, $args ) { |
|
144 | - return \Aimeos\Slim\Controller\Catalog::listAction( $this, $request, $response, $args ); |
|
145 | - })->setName( 'aimeos_shop_list' ); |
|
143 | + $this->map(['GET', 'POST'], '/list', function($request, $response, $args) { |
|
144 | + return \Aimeos\Slim\Controller\Catalog::listAction($this, $request, $response, $args); |
|
145 | + })->setName('aimeos_shop_list'); |
|
146 | 146 | |
147 | - $this->map(['GET', 'POST'], '/suggest', function( $request, $response, $args ) { |
|
148 | - return \Aimeos\Slim\Controller\Catalog::suggestAction( $this, $request, $response, $args ); |
|
149 | - })->setName( 'aimeos_shop_suggest' ); |
|
147 | + $this->map(['GET', 'POST'], '/suggest', function($request, $response, $args) { |
|
148 | + return \Aimeos\Slim\Controller\Catalog::suggestAction($this, $request, $response, $args); |
|
149 | + })->setName('aimeos_shop_suggest'); |
|
150 | 150 | |
151 | - $this->map(['GET', 'POST'], '/stock', function( $request, $response, $args ) { |
|
152 | - return \Aimeos\Slim\Controller\Catalog::stockAction( $this, $request, $response, $args ); |
|
153 | - })->setName( 'aimeos_shop_stock' ); |
|
151 | + $this->map(['GET', 'POST'], '/stock', function($request, $response, $args) { |
|
152 | + return \Aimeos\Slim\Controller\Catalog::stockAction($this, $request, $response, $args); |
|
153 | + })->setName('aimeos_shop_stock'); |
|
154 | 154 | |
155 | - $this->map(['GET', 'POST'], '/c/{f_name}/{f_catid}', function( $request, $response, $args ) { |
|
156 | - return \Aimeos\Slim\Controller\Catalog::treeAction( $this, $request, $response, $args ); |
|
157 | - })->setName( 'aimeos_shop_tree' ); |
|
155 | + $this->map(['GET', 'POST'], '/c/{f_name}/{f_catid}', function($request, $response, $args) { |
|
156 | + return \Aimeos\Slim\Controller\Catalog::treeAction($this, $request, $response, $args); |
|
157 | + })->setName('aimeos_shop_tree'); |
|
158 | 158 | |
159 | - $this->map(['GET', 'POST'], '/basket', function( $request, $response, $args ) { |
|
160 | - return \Aimeos\Slim\Controller\Basket::indexAction( $this, $request, $response, $args ); |
|
161 | - })->setName( 'aimeos_shop_basket' ); |
|
159 | + $this->map(['GET', 'POST'], '/basket', function($request, $response, $args) { |
|
160 | + return \Aimeos\Slim\Controller\Basket::indexAction($this, $request, $response, $args); |
|
161 | + })->setName('aimeos_shop_basket'); |
|
162 | 162 | |
163 | - $this->map(['GET', 'POST'], '/checkout[/{c_step}]', function( $request, $response, $args ) { |
|
164 | - return \Aimeos\Slim\Controller\Checkout::indexAction( $this, $request, $response, $args ); |
|
165 | - })->setName( 'aimeos_shop_checkout' ); |
|
163 | + $this->map(['GET', 'POST'], '/checkout[/{c_step}]', function($request, $response, $args) { |
|
164 | + return \Aimeos\Slim\Controller\Checkout::indexAction($this, $request, $response, $args); |
|
165 | + })->setName('aimeos_shop_checkout'); |
|
166 | 166 | |
167 | - $this->map(['GET', 'POST'], '/confirm[/{code}]', function( $request, $response, $args ) { |
|
168 | - return \Aimeos\Slim\Controller\Checkout::confirmAction( $this, $request, $response, $args ); |
|
169 | - })->setName( 'aimeos_shop_confirm' ); |
|
167 | + $this->map(['GET', 'POST'], '/confirm[/{code}]', function($request, $response, $args) { |
|
168 | + return \Aimeos\Slim\Controller\Checkout::confirmAction($this, $request, $response, $args); |
|
169 | + })->setName('aimeos_shop_confirm'); |
|
170 | 170 | |
171 | 171 | }); |
172 | 172 | |
173 | 173 | |
174 | -$app->group( $config( 'routes/update', '' ), function() { |
|
174 | +$app->group($config('routes/update', ''), function() { |
|
175 | 175 | |
176 | - $this->map(['GET', 'POST'], '/update', function( $request, $response, $args ) { |
|
177 | - return \Aimeos\Slim\Controller\Checkout::updateAction( $this, $request, $response, $args ); |
|
178 | - })->setName( 'aimeos_shop_update' ); |
|
176 | + $this->map(['GET', 'POST'], '/update', function($request, $response, $args) { |
|
177 | + return \Aimeos\Slim\Controller\Checkout::updateAction($this, $request, $response, $args); |
|
178 | + })->setName('aimeos_shop_update'); |
|
179 | 179 | |
180 | 180 | }); |
181 | 181 | |
182 | 182 | |
183 | -$app->map(['GET', 'POST'], '/terms', function( $request, $response, $args ) { |
|
183 | +$app->map(['GET', 'POST'], '/terms', function($request, $response, $args) { |
|
184 | 184 | return 'terms'; |
185 | -})->setName( 'aimeos_shop_terms' ); |
|
185 | +})->setName('aimeos_shop_terms'); |
|
186 | 186 | |
187 | -$app->map(['GET', 'POST'], '/privacy', function( $request, $response, $args ) { |
|
187 | +$app->map(['GET', 'POST'], '/privacy', function($request, $response, $args) { |
|
188 | 188 | return 'privacy'; |
189 | -})->setName( 'aimeos_shop_privacy' ); |
|
189 | +})->setName('aimeos_shop_privacy'); |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | * @param array $args Associative list of route parameters |
32 | 32 | * @return ResponseInterface $response Modified response object with generated output |
33 | 33 | */ |
34 | - public static function countAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
34 | + public static function countAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
35 | 35 | { |
36 | - $contents = $container->get( 'shop' )->get( 'catalog-count', $request, $response, $args ); |
|
37 | - $response = $container->get( 'view' )->render( $response, 'Catalog/count.html.twig', $contents ); |
|
36 | + $contents = $container->get('shop')->get('catalog-count', $request, $response, $args); |
|
37 | + $response = $container->get('view')->render($response, 'Catalog/count.html.twig', $contents); |
|
38 | 38 | |
39 | - return $response->withHeader( 'Content-Type', 'application/javascript' ) |
|
40 | - ->withHeader( 'Cache-Control', 'max-age=300' ); |
|
39 | + return $response->withHeader('Content-Type', 'application/javascript') |
|
40 | + ->withHeader('Cache-Control', 'max-age=300'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | * @param array $args Associative list of route parameters |
51 | 51 | * @return ResponseInterface $response Modified response object with generated output |
52 | 52 | */ |
53 | - public static function detailAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
53 | + public static function detailAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
54 | 54 | { |
55 | - $contents = $container->get( 'shop' )->get( 'catalog-detail', $request, $response, $args ); |
|
56 | - return $container->get( 'view' )->render( $response, 'Catalog/detail.html.twig', $contents ); |
|
55 | + $contents = $container->get('shop')->get('catalog-detail', $request, $response, $args); |
|
56 | + return $container->get('view')->render($response, 'Catalog/detail.html.twig', $contents); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | * @param array $args Associative list of route parameters |
67 | 67 | * @return ResponseInterface $response Modified response object with generated output |
68 | 68 | */ |
69 | - public static function listAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
69 | + public static function listAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
70 | 70 | { |
71 | - $contents = $container->get( 'shop' )->get( 'catalog-list', $request, $response, $args ); |
|
72 | - return $container->get( 'view' )->render( $response, 'Catalog/list.html.twig', $contents ); |
|
71 | + $contents = $container->get('shop')->get('catalog-list', $request, $response, $args); |
|
72 | + return $container->get('view')->render($response, 'Catalog/list.html.twig', $contents); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | * @param array $args Associative list of route parameters |
83 | 83 | * @return ResponseInterface $response Modified response object with generated output |
84 | 84 | */ |
85 | - public static function stockAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
85 | + public static function stockAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
86 | 86 | { |
87 | - $contents = $container->get( 'shop' )->get( 'catalog-stock', $request, $response, $args ); |
|
88 | - $response = $container->get( 'view' )->render( $response, 'Catalog/stock.html.twig', $contents ); |
|
87 | + $contents = $container->get('shop')->get('catalog-stock', $request, $response, $args); |
|
88 | + $response = $container->get('view')->render($response, 'Catalog/stock.html.twig', $contents); |
|
89 | 89 | |
90 | - return $response->withHeader( 'Cache-Control', 'max-age=30' ) |
|
91 | - ->withHeader( 'Content-Type', 'application/javascript' ); |
|
90 | + return $response->withHeader('Cache-Control', 'max-age=30') |
|
91 | + ->withHeader('Content-Type', 'application/javascript'); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | * @param array $args Associative list of route parameters |
102 | 102 | * @return ResponseInterface $response Modified response object with generated output |
103 | 103 | */ |
104 | - public static function suggestAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
104 | + public static function suggestAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
105 | 105 | { |
106 | - $contents = $container->get( 'shop' )->get( 'catalog-suggest', $request, $response, $args ); |
|
107 | - $response = $container->get( 'view' )->render( $response, 'Catalog/suggest.html.twig', $contents ); |
|
106 | + $contents = $container->get('shop')->get('catalog-suggest', $request, $response, $args); |
|
107 | + $response = $container->get('view')->render($response, 'Catalog/suggest.html.twig', $contents); |
|
108 | 108 | |
109 | - return $response->withHeader( 'Content-Type', 'application/json' ); |
|
109 | + return $response->withHeader('Content-Type', 'application/json'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | * @param array $args Associative list of route parameters |
120 | 120 | * @return ResponseInterface $response Modified response object with generated output |
121 | 121 | */ |
122 | - public static function treeAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
122 | + public static function treeAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
123 | 123 | { |
124 | - $contents = $container->get( 'shop' )->get( 'catalog-tree', $request, $response, $args ); |
|
125 | - return $container->get( 'view' )->render( $response, 'Catalog/tree.html.twig', $contents ); |
|
124 | + $contents = $container->get('shop')->get('catalog-tree', $request, $response, $args); |
|
125 | + return $container->get('view')->render($response, 'Catalog/tree.html.twig', $contents); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | \ No newline at end of file |
@@ -32,36 +32,36 @@ discard block |
||
32 | 32 | * @param array $args Associative list of route parameters |
33 | 33 | * @return ResponseInterface Modified response object with generated output |
34 | 34 | */ |
35 | - public static function fileAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
35 | + public static function fileAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
36 | 36 | { |
37 | 37 | $contents = ''; |
38 | 38 | $files = array(); |
39 | - $aimeos = $container->get( 'aimeos' ); |
|
40 | - $type = ( isset( $args['type'] ) ? $args['type'] : 'js' ); |
|
39 | + $aimeos = $container->get('aimeos'); |
|
40 | + $type = (isset($args['type']) ? $args['type'] : 'js'); |
|
41 | 41 | |
42 | - foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths ) |
|
42 | + foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths) |
|
43 | 43 | { |
44 | - foreach( $paths as $path ) |
|
44 | + foreach ($paths as $path) |
|
45 | 45 | { |
46 | - $jsbAbsPath = $base . '/' . $path; |
|
47 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
48 | - $files = array_merge( $files, $jsb2->getFiles( $type ) ); |
|
46 | + $jsbAbsPath = $base.'/'.$path; |
|
47 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
48 | + $files = array_merge($files, $jsb2->getFiles($type)); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - foreach( $files as $file ) |
|
52 | + foreach ($files as $file) |
|
53 | 53 | { |
54 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
54 | + if (($content = file_get_contents($file)) !== false) { |
|
55 | 55 | $contents .= $content; |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | - $response->getBody()->write( $contents ); |
|
59 | + $response->getBody()->write($contents); |
|
60 | 60 | |
61 | - if( $type === 'js' ) { |
|
62 | - $response = $response->withHeader( 'Content-Type', 'application/javascript' ); |
|
63 | - } elseif( $type === 'css' ) { |
|
64 | - $response = $response->withHeader( 'Content-Type', 'text/css' ); |
|
61 | + if ($type === 'js') { |
|
62 | + $response = $response->withHeader('Content-Type', 'application/javascript'); |
|
63 | + } elseif ($type === 'css') { |
|
64 | + $response = $response->withHeader('Content-Type', 'text/css'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $response; |
@@ -77,15 +77,15 @@ discard block |
||
77 | 77 | * @param array $args Associative list of route parameters |
78 | 78 | * @return ResponseInterface Modified response object with generated output |
79 | 79 | */ |
80 | - public static function copyAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
80 | + public static function copyAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
81 | 81 | { |
82 | - $cntl = self::createAdmin( $container, $request, $response, $args ); |
|
82 | + $cntl = self::createAdmin($container, $request, $response, $args); |
|
83 | 83 | |
84 | - if( ( $html = $cntl->copy() ) == '' ) { |
|
84 | + if (($html = $cntl->copy()) == '') { |
|
85 | 85 | return $cntl->getView()->response(); |
86 | 86 | } |
87 | 87 | |
88 | - return self::getHtml( $container, $response, $html ); |
|
88 | + return self::getHtml($container, $response, $html); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | * @param array $args Associative list of route parameters |
99 | 99 | * @return ResponseInterface Modified response object with generated output |
100 | 100 | */ |
101 | - public static function createAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
101 | + public static function createAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
102 | 102 | { |
103 | - $cntl = self::createAdmin( $container, $request, $response, $args ); |
|
103 | + $cntl = self::createAdmin($container, $request, $response, $args); |
|
104 | 104 | |
105 | - if( ( $html = $cntl->create() ) == '' ) { |
|
105 | + if (($html = $cntl->create()) == '') { |
|
106 | 106 | return $cntl->getView()->response(); |
107 | 107 | } |
108 | 108 | |
109 | - return self::getHtml( $container, $response, $html ); |
|
109 | + return self::getHtml($container, $response, $html); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
@@ -119,15 +119,15 @@ discard block |
||
119 | 119 | * @param array $args Associative list of route parameters |
120 | 120 | * @return ResponseInterface Modified response object with generated output |
121 | 121 | */ |
122 | - public static function deleteAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
122 | + public static function deleteAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
123 | 123 | { |
124 | - $cntl = self::createAdmin( $container, $request, $response, $args ); |
|
124 | + $cntl = self::createAdmin($container, $request, $response, $args); |
|
125 | 125 | |
126 | - if( ( $html = $cntl->delete() ) == '' ) { |
|
126 | + if (($html = $cntl->delete()) == '') { |
|
127 | 127 | return $cntl->getView()->response(); |
128 | 128 | } |
129 | 129 | |
130 | - return self::getHtml( $container, $response, $html ); |
|
130 | + return self::getHtml($container, $response, $html); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
@@ -140,15 +140,15 @@ discard block |
||
140 | 140 | * @param array $args Associative list of route parameters |
141 | 141 | * @return ResponseInterface Modified response object with generated output |
142 | 142 | */ |
143 | - public static function exportAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
143 | + public static function exportAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
144 | 144 | { |
145 | - $cntl = self::createAdmin( $container, $request, $response, $args ); |
|
145 | + $cntl = self::createAdmin($container, $request, $response, $args); |
|
146 | 146 | |
147 | - if( ( $html = $cntl->export() ) == '' ) { |
|
147 | + if (($html = $cntl->export()) == '') { |
|
148 | 148 | return $cntl->getView()->response(); |
149 | 149 | } |
150 | 150 | |
151 | - return self::getHtml( $container, $response, $html ); |
|
151 | + return self::getHtml($container, $response, $html); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | * @param array $args Associative list of route parameters |
162 | 162 | * @return ResponseInterface Modified response object with generated output |
163 | 163 | */ |
164 | - public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
164 | + public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
165 | 165 | { |
166 | - $cntl = self::createAdmin( $container, $request, $response, $args ); |
|
166 | + $cntl = self::createAdmin($container, $request, $response, $args); |
|
167 | 167 | |
168 | - if( ( $html = $cntl->get() ) == '' ) { |
|
168 | + if (($html = $cntl->get()) == '') { |
|
169 | 169 | return $cntl->getView()->response(); |
170 | 170 | } |
171 | 171 | |
172 | - return self::getHtml( $container, $response, $html ); |
|
172 | + return self::getHtml($container, $response, $html); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | |
@@ -182,15 +182,15 @@ discard block |
||
182 | 182 | * @param array $args Associative list of route parameters |
183 | 183 | * @return ResponseInterface Modified response object with generated output |
184 | 184 | */ |
185 | - public static function saveAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
185 | + public static function saveAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
186 | 186 | { |
187 | - $cntl = self::createAdmin( $container, $request, $response, $args ); |
|
187 | + $cntl = self::createAdmin($container, $request, $response, $args); |
|
188 | 188 | |
189 | - if( ( $html = $cntl->save() ) == '' ) { |
|
189 | + if (($html = $cntl->save()) == '') { |
|
190 | 190 | return $cntl->getView()->response(); |
191 | 191 | } |
192 | 192 | |
193 | - return self::getHtml( $container, $response, $html ); |
|
193 | + return self::getHtml($container, $response, $html); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -203,15 +203,15 @@ discard block |
||
203 | 203 | * @param array $args Associative list of route parameters |
204 | 204 | * @return ResponseInterface Modified response object with generated output |
205 | 205 | */ |
206 | - public static function searchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
206 | + public static function searchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
207 | 207 | { |
208 | - $cntl = self::createAdmin( $container, $request, $response, $args ); |
|
208 | + $cntl = self::createAdmin($container, $request, $response, $args); |
|
209 | 209 | |
210 | - if( ( $html = $cntl->search() ) == '' ) { |
|
210 | + if (($html = $cntl->search()) == '') { |
|
211 | 211 | return $cntl->getView()->response(); |
212 | 212 | } |
213 | 213 | |
214 | - return self::getHtml( $container, $response, $html ); |
|
214 | + return self::getHtml($container, $response, $html); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -224,29 +224,29 @@ discard block |
||
224 | 224 | * @param array $args Associative list of route parameters |
225 | 225 | * @return \Aimeos\Admin\JQAdm\Iface JQAdm client |
226 | 226 | */ |
227 | - protected static function createAdmin( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
227 | + protected static function createAdmin(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
228 | 228 | { |
229 | - $aimeos = $container->get( 'aimeos' ); |
|
230 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
229 | + $aimeos = $container->get('aimeos'); |
|
230 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
231 | 231 | $params = $args + (array) $request->getParsedBody() + (array) $request->getQueryParams(); |
232 | 232 | |
233 | - $resource = ( isset( $params['resource'] ) ? $params['resource'] : null ); |
|
234 | - $site = ( isset( $params['site'] ) ? $params['site'] : 'default' ); |
|
235 | - $lang = ( isset( $params['lang'] ) ? $params['lang'] : 'en' ); |
|
233 | + $resource = (isset($params['resource']) ? $params['resource'] : null); |
|
234 | + $site = (isset($params['site']) ? $params['site'] : 'default'); |
|
235 | + $lang = (isset($params['lang']) ? $params['lang'] : 'en'); |
|
236 | 236 | |
237 | - $context = $container->get( 'aimeos.context' )->get( false, $args, 'backend' ); |
|
238 | - $context->setI18n( $container->get( 'aimeos.i18n' )->get( array( $lang, 'en' ) ) ); |
|
239 | - $context->setLocale( $container->get( 'aimeos.locale' )->getBackend( $context, $site ) ); |
|
237 | + $context = $container->get('aimeos.context')->get(false, $args, 'backend'); |
|
238 | + $context->setI18n($container->get('aimeos.i18n')->get(array($lang, 'en'))); |
|
239 | + $context->setLocale($container->get('aimeos.locale')->getBackend($context, $site)); |
|
240 | 240 | |
241 | - $view = $container->get( 'aimeos.view' )->create( $context, $request, $response, $args, $templatePaths, $lang ); |
|
241 | + $view = $container->get('aimeos.view')->create($context, $request, $response, $args, $templatePaths, $lang); |
|
242 | 242 | |
243 | 243 | $view->aimeosType = 'Slim'; |
244 | 244 | $view->aimeosVersion = \Aimeos\Slim\Bootstrap::getVersion(); |
245 | - $view->aimeosExtensions = implode( ',', $aimeos->getExtensions() ); |
|
245 | + $view->aimeosExtensions = implode(',', $aimeos->getExtensions()); |
|
246 | 246 | |
247 | - $context->setView( $view ); |
|
247 | + $context->setView($view); |
|
248 | 248 | |
249 | - return \Aimeos\Admin\JQAdm::create( $context, $aimeos, $resource ); |
|
249 | + return \Aimeos\Admin\JQAdm::create($context, $aimeos, $resource); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | * @param string $content Content from admin client |
259 | 259 | * @return ResponseInterface Modified response object with generated output |
260 | 260 | */ |
261 | - protected static function getHtml( ContainerInterface $container, ResponseInterface $response, $content ) |
|
261 | + protected static function getHtml(ContainerInterface $container, ResponseInterface $response, $content) |
|
262 | 262 | { |
263 | - return $container->get( 'view' )->render( $response, 'Jqadm/index.html.twig', array( 'content' => $content ) ); |
|
263 | + return $container->get('view')->render($response, 'Jqadm/index.html.twig', array('content' => $content)); |
|
264 | 264 | } |
265 | 265 | } |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | * @param array $args Associative list of route parameters |
32 | 32 | * @return ResponseInterface $response Modified response object with generated output |
33 | 33 | */ |
34 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
34 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
35 | 35 | { |
36 | - $contents = $container->get( 'shop' )->get( 'account-index', $request, $response, $args ); |
|
37 | - return $container->get( 'view' )->render( $response, 'Account/index.html.twig', $contents ); |
|
36 | + $contents = $container->get('shop')->get('account-index', $request, $response, $args); |
|
37 | + return $container->get('view')->render($response, 'Account/index.html.twig', $contents); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -47,16 +47,16 @@ discard block |
||
47 | 47 | * @param array $args Associative list of route parameters |
48 | 48 | * @return ResponseInterface $response Modified response object with generated output |
49 | 49 | */ |
50 | - public static function downloadAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
50 | + public static function downloadAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
51 | 51 | { |
52 | - $context = $container->get( 'aimeos.context' )->get( true, $args ); |
|
52 | + $context = $container->get('aimeos.context')->get(true, $args); |
|
53 | 53 | $langid = $context->getLocale()->getLanguageId(); |
54 | 54 | |
55 | - $view = $container->get( 'aimeos.view' )->create( $context, $request, $response, $args, array(), $langid ); |
|
56 | - $context->setView( $view ); |
|
55 | + $view = $container->get('aimeos.view')->create($context, $request, $response, $args, array(), $langid); |
|
56 | + $context->setView($view); |
|
57 | 57 | |
58 | - $client = \Aimeos\Client\Html::create( $context, 'account/download' ); |
|
59 | - $client->setView( $view ); |
|
58 | + $client = \Aimeos\Client\Html::create($context, 'account/download'); |
|
59 | + $client->setView($view); |
|
60 | 60 | $client->process(); |
61 | 61 | |
62 | 62 | return $view->response(); |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param array $args Associative list of route parameters |
33 | 33 | * @return ResponseInterface $response Modified response object with generated output |
34 | 34 | */ |
35 | - public static function deleteAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
35 | + public static function deleteAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
36 | 36 | { |
37 | - return self::createClient( $container, $request, $response, $args )->delete( $request, $response ); |
|
37 | + return self::createClient($container, $request, $response, $args)->delete($request, $response); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * @param array $args Associative list of route parameters |
48 | 48 | * @return ResponseInterface $response Modified response object with generated output |
49 | 49 | */ |
50 | - public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
50 | + public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
51 | 51 | { |
52 | - return self::createClient( $container, $request, $response, $args )->get( $request, $response ); |
|
52 | + return self::createClient($container, $request, $response, $args)->get($request, $response); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | * @param array $args Associative list of route parameters |
63 | 63 | * @return ResponseInterface $response Modified response object with generated output |
64 | 64 | */ |
65 | - public static function patchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
65 | + public static function patchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
66 | 66 | { |
67 | - return self::createClient( $container, $request, $response, $args )->patch( $request, $response ); |
|
67 | + return self::createClient($container, $request, $response, $args)->patch($request, $response); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | * @param array $args Associative list of route parameters |
78 | 78 | * @return ResponseInterface $response Modified response object with generated output |
79 | 79 | */ |
80 | - public static function postAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
80 | + public static function postAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
81 | 81 | { |
82 | - return self::createClient( $container, $request, $response, $args )->post( $request, $response ); |
|
82 | + return self::createClient($container, $request, $response, $args)->post($request, $response); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | * @param array $args Associative list of route parameters |
93 | 93 | * @return ResponseInterface $response Modified response object with generated output |
94 | 94 | */ |
95 | - public static function putAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
95 | + public static function putAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
96 | 96 | { |
97 | - return self::createClient( $container, $request, $response, $args )->put( $request, $response ); |
|
97 | + return self::createClient($container, $request, $response, $args)->put($request, $response); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | * @param array $args Associative list of route parameters |
108 | 108 | * @return ResponseInterface $response Modified response object with generated output |
109 | 109 | */ |
110 | - public static function optionsAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
110 | + public static function optionsAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
111 | 111 | { |
112 | - return self::createClient( $container, $request, $response, $args )->options( $request, $response ); |
|
112 | + return self::createClient($container, $request, $response, $args)->options($request, $response); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -122,19 +122,19 @@ discard block |
||
122 | 122 | * @param array $args Associative list of route parameters |
123 | 123 | * @return \Aimeos\Client\JsonApi\Iface JSON client controller |
124 | 124 | */ |
125 | - protected static function createClient( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
125 | + protected static function createClient(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
126 | 126 | { |
127 | 127 | $params = $request->getQueryParams(); |
128 | - $resource = ( isset( $args['resource'] ) ? $args['resource'] : ( isset( $params['resource'] ) ? $params['resource'] : null ) ); |
|
129 | - $related = ( isset( $args['related'] ) ? $args['related'] : ( isset( $params['related'] ) ? $params['related'] : null ) ); |
|
130 | - $tmplPaths = $container->get( 'aimeos' )->getCustomPaths( 'client/jsonapi/templates' ); |
|
128 | + $resource = (isset($args['resource']) ? $args['resource'] : (isset($params['resource']) ? $params['resource'] : null)); |
|
129 | + $related = (isset($args['related']) ? $args['related'] : (isset($params['related']) ? $params['related'] : null)); |
|
130 | + $tmplPaths = $container->get('aimeos')->getCustomPaths('client/jsonapi/templates'); |
|
131 | 131 | |
132 | - $context = $container->get( 'aimeos.context' )->get( true, $args ); |
|
132 | + $context = $container->get('aimeos.context')->get(true, $args); |
|
133 | 133 | $langid = $context->getLocale()->getLanguageId(); |
134 | 134 | |
135 | - $view = $container->get( 'aimeos.view' )->create( $context, $request, $response, $args, $tmplPaths, $langid ); |
|
136 | - $context->setView( $view ); |
|
135 | + $view = $container->get('aimeos.view')->create($context, $request, $response, $args, $tmplPaths, $langid); |
|
136 | + $context->setView($view); |
|
137 | 137 | |
138 | - return \Aimeos\Client\JsonApi::create( $context, $resource . '/' . $related ); |
|
138 | + return \Aimeos\Client\JsonApi::create($context, $resource.'/'.$related); |
|
139 | 139 | } |
140 | 140 | } |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param array $args Associative list of route parameters |
33 | 33 | * @return ResponseInterface $response Modified response object with generated output |
34 | 34 | */ |
35 | - public static function deleteAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
35 | + public static function deleteAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
36 | 36 | { |
37 | - return self::createAdmin( $container, $request, $response, $args )->delete( $request, $response ); |
|
37 | + return self::createAdmin($container, $request, $response, $args)->delete($request, $response); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * @param array $args Associative list of route parameters |
48 | 48 | * @return ResponseInterface $response Modified response object with generated output |
49 | 49 | */ |
50 | - public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
50 | + public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
51 | 51 | { |
52 | - return self::createAdmin( $container, $request, $response, $args )->get( $request, $response ); |
|
52 | + return self::createAdmin($container, $request, $response, $args)->get($request, $response); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | * @param array $args Associative list of route parameters |
63 | 63 | * @return ResponseInterface $response Modified response object with generated output |
64 | 64 | */ |
65 | - public static function patchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
65 | + public static function patchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
66 | 66 | { |
67 | - return self::createAdmin( $container, $request, $response, $args )->patch( $request, $response ); |
|
67 | + return self::createAdmin($container, $request, $response, $args)->patch($request, $response); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | * @param array $args Associative list of route parameters |
78 | 78 | * @return ResponseInterface $response Modified response object with generated output |
79 | 79 | */ |
80 | - public static function postAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
80 | + public static function postAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
81 | 81 | { |
82 | - return self::createAdmin( $container, $request, $response, $args )->post( $request, $response ); |
|
82 | + return self::createAdmin($container, $request, $response, $args)->post($request, $response); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | * @param array $args Associative list of route parameters |
93 | 93 | * @return ResponseInterface $response Modified response object with generated output |
94 | 94 | */ |
95 | - public static function putAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
95 | + public static function putAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
96 | 96 | { |
97 | - return self::createAdmin( $container, $request, $response, $args )->put( $request, $response ); |
|
97 | + return self::createAdmin($container, $request, $response, $args)->put($request, $response); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | * @param array $args Associative list of route parameters |
108 | 108 | * @return ResponseInterface $response Modified response object with generated output |
109 | 109 | */ |
110 | - public static function optionsAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
110 | + public static function optionsAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
111 | 111 | { |
112 | - return self::createAdmin( $container, $request, $response, $args )->options( $request, $response ); |
|
112 | + return self::createAdmin($container, $request, $response, $args)->options($request, $response); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -122,22 +122,22 @@ discard block |
||
122 | 122 | * @param array $args Associative list of route parameters |
123 | 123 | * @return \Aimeos\Admin\JsonAdm\Iface JSON admin client |
124 | 124 | */ |
125 | - protected static function createAdmin( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
125 | + protected static function createAdmin(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
126 | 126 | { |
127 | - $resource = ( isset( $args['resource'] ) ? $args['resource'] : null ); |
|
128 | - $site = ( isset( $args['site'] ) ? $args['site'] : 'default' ); |
|
129 | - $lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' ); |
|
127 | + $resource = (isset($args['resource']) ? $args['resource'] : null); |
|
128 | + $site = (isset($args['site']) ? $args['site'] : 'default'); |
|
129 | + $lang = (isset($args['lang']) ? $args['lang'] : 'en'); |
|
130 | 130 | |
131 | - $aimeos = $container->get( 'aimeos' ); |
|
132 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' ); |
|
131 | + $aimeos = $container->get('aimeos'); |
|
132 | + $templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates'); |
|
133 | 133 | |
134 | - $context = $container->get( 'aimeos.context' )->get( false, $args, 'backend' ); |
|
135 | - $context->setI18n( $container->get( 'aimeos.i18n' )->get( array( $lang, 'en' ) ) ); |
|
136 | - $context->setLocale( $container->get( 'aimeos.locale' )->getBackend( $context, $site ) ); |
|
134 | + $context = $container->get('aimeos.context')->get(false, $args, 'backend'); |
|
135 | + $context->setI18n($container->get('aimeos.i18n')->get(array($lang, 'en'))); |
|
136 | + $context->setLocale($container->get('aimeos.locale')->getBackend($context, $site)); |
|
137 | 137 | |
138 | - $view = $container->get( 'aimeos.view' )->create( $context, $request, $response, $args, $templatePaths, $lang ); |
|
139 | - $context->setView( $view ); |
|
138 | + $view = $container->get('aimeos.view')->create($context, $request, $response, $args, $templatePaths, $lang); |
|
139 | + $context->setView($view); |
|
140 | 140 | |
141 | - return \Aimeos\Admin\JsonAdm::create( $context, $aimeos, $resource ); |
|
141 | + return \Aimeos\Admin\JsonAdm::create($context, $aimeos, $resource); |
|
142 | 142 | } |
143 | 143 | } |
@@ -31,11 +31,11 @@ |
||
31 | 31 | * @param array $args Associative list of route parameters |
32 | 32 | * @return ResponseInterface $response Modified response object with generated output |
33 | 33 | */ |
34 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
34 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
35 | 35 | { |
36 | - $contents = $container->get( 'shop' )->get( 'basket-index', $request, $response, $args ); |
|
37 | - $response = $container->get( 'view' )->render( $response, 'Basket/index.html.twig', $contents ); |
|
36 | + $contents = $container->get('shop')->get('basket-index', $request, $response, $args); |
|
37 | + $response = $container->get('view')->render($response, 'Basket/index.html.twig', $contents); |
|
38 | 38 | |
39 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
39 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | * @param array $args Associative list of route parameters |
32 | 32 | * @return ResponseInterface $response Modified response object with generated output |
33 | 33 | */ |
34 | - public static function confirmAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
34 | + public static function confirmAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
35 | 35 | { |
36 | - $contents = $container->get( 'shop' )->get( 'checkout-confirm', $request, $response, $args ); |
|
37 | - $response = $container->get( 'view' )->render( $response, 'Checkout/confirm.html.twig', $contents ); |
|
36 | + $contents = $container->get('shop')->get('checkout-confirm', $request, $response, $args); |
|
37 | + $response = $container->get('view')->render($response, 'Checkout/confirm.html.twig', $contents); |
|
38 | 38 | |
39 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
39 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | * @param array $args Associative list of route parameters |
50 | 50 | * @return ResponseInterface $response Modified response object with generated output |
51 | 51 | */ |
52 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
52 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
53 | 53 | { |
54 | - $contents = $container->get( 'shop' )->get( 'checkout-index', $request, $response, $args ); |
|
55 | - $response = $container->get( 'view' )->render( $response, 'Checkout/index.html.twig', $contents ); |
|
54 | + $contents = $container->get('shop')->get('checkout-index', $request, $response, $args); |
|
55 | + $response = $container->get('view')->render($response, 'Checkout/index.html.twig', $contents); |
|
56 | 56 | |
57 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
57 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | * @param array $args Associative list of route parameters |
68 | 68 | * @return ResponseInterface $response Modified response object with generated output |
69 | 69 | */ |
70 | - public static function updateAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
70 | + public static function updateAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
71 | 71 | { |
72 | - $contents = $container->get( 'shop' )->get( 'checkout-update', $request, $response, $args ); |
|
73 | - $response = $container->get( 'view' )->render( $response, 'Checkout/update.html.twig', $contents ); |
|
72 | + $contents = $container->get('shop')->get('checkout-update', $request, $response, $args); |
|
73 | + $response = $container->get('view')->render($response, 'Checkout/update.html.twig', $contents); |
|
74 | 74 | |
75 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
75 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | \ No newline at end of file |