@@ -59,16 +59,14 @@ discard block |
||
59 | 59 | $status = 200; |
60 | 60 | $type = $view->param( 'id', 'default' ); |
61 | 61 | $view->item = $this->controller->setType( $type )->clear()->get(); |
62 | - } |
|
63 | - catch( \Aimeos\MShop\Exception $e ) |
|
62 | + } catch( \Aimeos\MShop\Exception $e ) |
|
64 | 63 | { |
65 | 64 | $status = 404; |
66 | 65 | $view->errors = array( array( |
67 | 66 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
68 | 67 | 'detail' => $e->getTraceAsString(), |
69 | 68 | ) ); |
70 | - } |
|
71 | - catch( \Exception $e ) |
|
69 | + } catch( \Exception $e ) |
|
72 | 70 | { |
73 | 71 | $status = 500; |
74 | 72 | $view->errors = array( array( |
@@ -99,24 +97,21 @@ discard block |
||
99 | 97 | try |
100 | 98 | { |
101 | 99 | $view->item = $this->controller->load( $id, $this->getParts( $view ) ); |
102 | - } |
|
103 | - catch( \Aimeos\MShop\Exception $e ) |
|
100 | + } catch( \Aimeos\MShop\Exception $e ) |
|
104 | 101 | { |
105 | 102 | $view->item = $this->controller->setType( $id )->get(); |
106 | 103 | $allow = true; |
107 | 104 | } |
108 | 105 | |
109 | 106 | $status = 200; |
110 | - } |
|
111 | - catch( \Aimeos\MShop\Exception $e ) |
|
107 | + } catch( \Aimeos\MShop\Exception $e ) |
|
112 | 108 | { |
113 | 109 | $status = 404; |
114 | 110 | $view->errors = array( array( |
115 | 111 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
116 | 112 | 'detail' => $e->getTraceAsString(), |
117 | 113 | ) ); |
118 | - } |
|
119 | - catch( \Exception $e ) |
|
114 | + } catch( \Exception $e ) |
|
120 | 115 | { |
121 | 116 | $status = 500; |
122 | 117 | $view->errors = array( array( |
@@ -153,16 +148,14 @@ discard block |
||
153 | 148 | |
154 | 149 | $view->item = $basket; |
155 | 150 | $status = 200; |
156 | - } |
|
157 | - catch( \Aimeos\MShop\Exception $e ) |
|
151 | + } catch( \Aimeos\MShop\Exception $e ) |
|
158 | 152 | { |
159 | 153 | $status = 404; |
160 | 154 | $view->errors = array( array( |
161 | 155 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
162 | 156 | 'detail' => $e->getTraceAsString(), |
163 | 157 | ) ); |
164 | - } |
|
165 | - catch( \Exception $e ) |
|
158 | + } catch( \Exception $e ) |
|
166 | 159 | { |
167 | 160 | $status = 500; |
168 | 161 | $view->errors = array( array( |
@@ -193,16 +186,14 @@ discard block |
||
193 | 186 | |
194 | 187 | $view->item = $item; |
195 | 188 | $status = 200; |
196 | - } |
|
197 | - catch( \Aimeos\MShop\Exception $e ) |
|
189 | + } catch( \Aimeos\MShop\Exception $e ) |
|
198 | 190 | { |
199 | 191 | $status = 404; |
200 | 192 | $view->errors = array( array( |
201 | 193 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
202 | 194 | 'detail' => $e->getTraceAsString(), |
203 | 195 | ) ); |
204 | - } |
|
205 | - catch( \Exception $e ) |
|
196 | + } catch( \Exception $e ) |
|
206 | 197 | { |
207 | 198 | $status = 500; |
208 | 199 | $view->errors = array( array( |
@@ -101,8 +101,7 @@ |
||
101 | 101 | foreach( $items as $item ) { |
102 | 102 | $data[] = $entryFcn( $item ); |
103 | 103 | } |
104 | - } |
|
105 | - else |
|
104 | + } else |
|
106 | 105 | { |
107 | 106 | $data = $entryFcn( $items ); |
108 | 107 | } |
@@ -244,8 +244,7 @@ |
||
244 | 244 | $data[] = $entryFcn( $item ); |
245 | 245 | $included = array_merge( $included, $refFcn( $item ) ); |
246 | 246 | } |
247 | - } |
|
248 | - else |
|
247 | + } else |
|
249 | 248 | { |
250 | 249 | $data = $entryFcn( $items ); |
251 | 250 | $included = $refFcn( $items ); |
@@ -145,8 +145,7 @@ |
||
145 | 145 | $data[] = $entryFcn( $attrItem ); |
146 | 146 | $included = array_merge( $included, $refFcn( $attrItem ) ); |
147 | 147 | } |
148 | - } |
|
149 | - else |
|
148 | + } else |
|
150 | 149 | { |
151 | 150 | $data = $entryFcn( $items ); |
152 | 151 | $included = $refFcn( $items ); |
@@ -101,8 +101,7 @@ |
||
101 | 101 | $decorators = $config->get( 'client/jsonapi/' . $dpath . 'decorators/local', [] ); |
102 | 102 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $view, $templatePaths, $path ); |
103 | 103 | } |
104 | - } |
|
105 | - else |
|
104 | + } else |
|
106 | 105 | { |
107 | 106 | $classprefix = '\\Aimeos\\Client\\JsonApi\\Common\\Decorator\\'; |
108 | 107 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $view, $templatePaths, $path ); |
@@ -272,10 +272,13 @@ |
||
272 | 272 | "href": "<?php echo $this->url( $target, $cntl, $action, ['resource' => 'basket', 'id' => $params['id'], 'related' => 'coupon'], [], $config ); ?>", |
273 | 273 | "allow": ["POST"] |
274 | 274 | } |
275 | - <?php else : ?> |
|
275 | + <?php else { |
|
276 | + : ?> |
|
276 | 277 | , |
277 | 278 | "order": { |
278 | - "href": "<?php echo $this->url( $target, $cntl, $action, ['resource' => 'order'], [], $config ); ?>", |
|
279 | + "href": "<?php echo $this->url( $target, $cntl, $action, ['resource' => 'order'], [], $config ); |
|
280 | +} |
|
281 | +?>", |
|
279 | 282 | "allow": ["POST"] |
280 | 283 | } |
281 | 284 | <?php endif; ?> |