@@ -99,14 +99,12 @@ discard block |
||
99 | 99 | $view->tabindex = ++$idx + 1; |
100 | 100 | $view->itemBody .= $client->copy(); |
101 | 101 | } |
102 | - } |
|
103 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + } catch( \Aimeos\MShop\Exception $e ) |
|
104 | 103 | { |
105 | 104 | $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
106 | 105 | $view->errors = $view->get( 'errors', [] ) + $error; |
107 | 106 | $this->logException( $e ); |
108 | - } |
|
109 | - catch( \Exception $e ) |
|
107 | + } catch( \Exception $e ) |
|
110 | 108 | { |
111 | 109 | $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
112 | 110 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -148,14 +146,12 @@ discard block |
||
148 | 146 | $view->tabindex = ++$idx + 1; |
149 | 147 | $view->itemBody .= $client->create(); |
150 | 148 | } |
151 | - } |
|
152 | - catch( \Aimeos\MShop\Exception $e ) |
|
149 | + } catch( \Aimeos\MShop\Exception $e ) |
|
153 | 150 | { |
154 | 151 | $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
155 | 152 | $view->errors = $view->get( 'errors', [] ) + $error; |
156 | 153 | $this->logException( $e ); |
157 | - } |
|
158 | - catch( \Exception $e ) |
|
154 | + } catch( \Exception $e ) |
|
159 | 155 | { |
160 | 156 | $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
161 | 157 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -194,14 +190,12 @@ discard block |
||
194 | 190 | |
195 | 191 | $msg = $context->getI18n()->dt( 'admin', 'Your export will be available in a few minutes for download' ); |
196 | 192 | $view->info = $view->get( 'info', [] ) + ['order-item' => $msg]; |
197 | - } |
|
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
193 | + } catch( \Aimeos\MShop\Exception $e ) |
|
199 | 194 | { |
200 | 195 | $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
201 | 196 | $view->errors = $view->get( 'errors', [] ) + $error; |
202 | 197 | $this->logException( $e ); |
203 | - } |
|
204 | - catch( \Exception $e ) |
|
198 | + } catch( \Exception $e ) |
|
205 | 199 | { |
206 | 200 | $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
207 | 201 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -240,14 +234,12 @@ discard block |
||
240 | 234 | $view->tabindex = ++$idx + 1; |
241 | 235 | $view->itemBody .= $client->get(); |
242 | 236 | } |
243 | - } |
|
244 | - catch( \Aimeos\MShop\Exception $e ) |
|
237 | + } catch( \Aimeos\MShop\Exception $e ) |
|
245 | 238 | { |
246 | 239 | $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
247 | 240 | $view->errors = $view->get( 'errors', [] ) + $error; |
248 | 241 | $this->logException( $e ); |
249 | - } |
|
250 | - catch( \Exception $e ) |
|
242 | + } catch( \Exception $e ) |
|
251 | 243 | { |
252 | 244 | $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
253 | 245 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -284,18 +276,15 @@ discard block |
||
284 | 276 | |
285 | 277 | $this->nextAction( $view, $view->param( 'next' ), 'order', $view->item->getId(), 'save' ); |
286 | 278 | return; |
287 | - } |
|
288 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
279 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
289 | 280 | { |
290 | 281 | // fall through to create |
291 | - } |
|
292 | - catch( \Aimeos\MShop\Exception $e ) |
|
282 | + } catch( \Aimeos\MShop\Exception $e ) |
|
293 | 283 | { |
294 | 284 | $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
295 | 285 | $view->errors = $view->get( 'errors', [] ) + $error; |
296 | 286 | $this->logException( $e ); |
297 | - } |
|
298 | - catch( \Exception $e ) |
|
287 | + } catch( \Exception $e ) |
|
299 | 288 | { |
300 | 289 | $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
301 | 290 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -338,14 +327,12 @@ discard block |
||
338 | 327 | foreach( $this->getSubClients() as $client ) { |
339 | 328 | $view->itemBody .= $client->search(); |
340 | 329 | } |
341 | - } |
|
342 | - catch( \Aimeos\MShop\Exception $e ) |
|
330 | + } catch( \Aimeos\MShop\Exception $e ) |
|
343 | 331 | { |
344 | 332 | $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
345 | 333 | $view->errors = $view->get( 'errors', [] ) + $error; |
346 | 334 | $this->logException( $e ); |
347 | - } |
|
348 | - catch( \Exception $e ) |
|
335 | + } catch( \Exception $e ) |
|
349 | 336 | { |
350 | 337 | $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
351 | 338 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -556,8 +543,7 @@ discard block |
||
556 | 543 | { |
557 | 544 | $attrItem = $attrItems[$array['order.base.service.attribute.id']]; |
558 | 545 | unset( $attrItems[$array['order.base.service.attribute.id']] ); |
559 | - } |
|
560 | - else |
|
546 | + } else |
|
561 | 547 | { |
562 | 548 | $attrItem = $attrManager->createItem(); |
563 | 549 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Order; |
12 | 12 | |
13 | -sprintf( 'order' ); // for translation |
|
13 | +sprintf('order'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'order/base' ); |
|
43 | - $view->item = $manager->load( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'order/base'); |
|
43 | + $view->item = $manager->load($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'order/base' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'order/base')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['order.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -128,34 +128,34 @@ discard block |
||
128 | 128 | |
129 | 129 | try |
130 | 130 | { |
131 | - $params = $this->storeSearchParams( $view->param(), 'order' ); |
|
131 | + $params = $this->storeSearchParams($view->param(), 'order'); |
|
132 | 132 | $msg = ['sitecode' => $context->getLocale()->getSite()->getCode()]; |
133 | 133 | |
134 | - if( isset( $params['filter'] ) ) { |
|
135 | - $msg['filter'] = $this->getCriteriaConditions( $params['filter'] ); |
|
134 | + if (isset($params['filter'])) { |
|
135 | + $msg['filter'] = $this->getCriteriaConditions($params['filter']); |
|
136 | 136 | } |
137 | 137 | |
138 | - if( isset( $params['sort'] ) ) { |
|
139 | - $msg['sort'] = $this->getCriteriaSortations( $params['sort'] ); |
|
138 | + if (isset($params['sort'])) { |
|
139 | + $msg['sort'] = $this->getCriteriaSortations($params['sort']); |
|
140 | 140 | } |
141 | 141 | |
142 | - $mq = $context->getMessageQueueManager()->get( 'mq-admin' )->getQueue( 'order-export' ); |
|
143 | - $mq->add( json_encode( $msg ) ); |
|
142 | + $mq = $context->getMessageQueueManager()->get('mq-admin')->getQueue('order-export'); |
|
143 | + $mq->add(json_encode($msg)); |
|
144 | 144 | |
145 | - $msg = $context->getI18n()->dt( 'admin', 'Your export will be available in a few minutes for download' ); |
|
146 | - $view->info = $view->get( 'info', [] ) + ['order-item' => $msg]; |
|
145 | + $msg = $context->getI18n()->dt('admin', 'Your export will be available in a few minutes for download'); |
|
146 | + $view->info = $view->get('info', []) + ['order-item' => $msg]; |
|
147 | 147 | } |
148 | - catch( \Aimeos\MShop\Exception $e ) |
|
148 | + catch (\Aimeos\MShop\Exception $e) |
|
149 | 149 | { |
150 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
151 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
152 | - $this->logException( $e ); |
|
150 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
151 | + $view->errors = $view->get('errors', []) + $error; |
|
152 | + $this->logException($e); |
|
153 | 153 | } |
154 | - catch( \Exception $e ) |
|
154 | + catch (\Exception $e) |
|
155 | 155 | { |
156 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
157 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
158 | - $this->logException( $e ); |
|
156 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
157 | + $view->errors = $view->get('errors', []) + $error; |
|
158 | + $this->logException($e); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return $this->search(); |
@@ -174,38 +174,38 @@ discard block |
||
174 | 174 | |
175 | 175 | try |
176 | 176 | { |
177 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
178 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
177 | + if (($id = $view->param('id')) === null) { |
|
178 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
179 | 179 | } |
180 | 180 | |
181 | - $manager = \Aimeos\MShop::create( $context, 'order/base' ); |
|
181 | + $manager = \Aimeos\MShop::create($context, 'order/base'); |
|
182 | 182 | $refs = ['order/base/address', 'order/base/coupon', 'order/base/product', 'order/base/service']; |
183 | 183 | |
184 | - $view->item = $manager->getItem( $id, $refs ); |
|
184 | + $view->item = $manager->getItem($id, $refs); |
|
185 | 185 | $view->itemSubparts = $this->getSubClientNames(); |
186 | - $view->itemData = $this->toArray( $view->item ); |
|
186 | + $view->itemData = $this->toArray($view->item); |
|
187 | 187 | $view->itemBody = ''; |
188 | 188 | |
189 | - foreach( $this->getSubClients() as $idx => $client ) |
|
189 | + foreach ($this->getSubClients() as $idx => $client) |
|
190 | 190 | { |
191 | 191 | $view->tabindex = ++$idx + 1; |
192 | 192 | $view->itemBody .= $client->get(); |
193 | 193 | } |
194 | 194 | } |
195 | - catch( \Aimeos\MShop\Exception $e ) |
|
195 | + catch (\Aimeos\MShop\Exception $e) |
|
196 | 196 | { |
197 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
198 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
199 | - $this->logException( $e ); |
|
197 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
198 | + $view->errors = $view->get('errors', []) + $error; |
|
199 | + $this->logException($e); |
|
200 | 200 | } |
201 | - catch( \Exception $e ) |
|
201 | + catch (\Exception $e) |
|
202 | 202 | { |
203 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
204 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
205 | - $this->logException( $e ); |
|
203 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
204 | + $view->errors = $view->get('errors', []) + $error; |
|
205 | + $this->logException($e); |
|
206 | 206 | } |
207 | 207 | |
208 | - return $this->render( $view ); |
|
208 | + return $this->render($view); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | |
@@ -219,40 +219,40 @@ discard block |
||
219 | 219 | $view = $this->getView(); |
220 | 220 | $context = $this->getContext(); |
221 | 221 | |
222 | - $manager = \Aimeos\MShop::create( $context, 'order/base' ); |
|
222 | + $manager = \Aimeos\MShop::create($context, 'order/base'); |
|
223 | 223 | $manager->begin(); |
224 | 224 | |
225 | 225 | try |
226 | 226 | { |
227 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
228 | - $view->item = $item->getId() ? $item : $manager->store( clone $item ); |
|
227 | + $item = $this->fromArray($view->param('item', [])); |
|
228 | + $view->item = $item->getId() ? $item : $manager->store(clone $item); |
|
229 | 229 | $view->itemBody = ''; |
230 | 230 | |
231 | - foreach( $this->getSubClients() as $client ) { |
|
231 | + foreach ($this->getSubClients() as $client) { |
|
232 | 232 | $view->itemBody .= $client->save(); |
233 | 233 | } |
234 | 234 | |
235 | - $manager->store( clone $view->item ); |
|
235 | + $manager->store(clone $view->item); |
|
236 | 236 | $manager->commit(); |
237 | 237 | |
238 | - $this->nextAction( $view, $view->param( 'next' ), 'order', $view->item->getId(), 'save' ); |
|
238 | + $this->nextAction($view, $view->param('next'), 'order', $view->item->getId(), 'save'); |
|
239 | 239 | return; |
240 | 240 | } |
241 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
241 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
242 | 242 | { |
243 | 243 | // fall through to create |
244 | 244 | } |
245 | - catch( \Aimeos\MShop\Exception $e ) |
|
245 | + catch (\Aimeos\MShop\Exception $e) |
|
246 | 246 | { |
247 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
248 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
249 | - $this->logException( $e ); |
|
247 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
248 | + $view->errors = $view->get('errors', []) + $error; |
|
249 | + $this->logException($e); |
|
250 | 250 | } |
251 | - catch( \Exception $e ) |
|
251 | + catch (\Exception $e) |
|
252 | 252 | { |
253 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
254 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
255 | - $this->logException( $e ); |
|
253 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
254 | + $view->errors = $view->get('errors', []) + $error; |
|
255 | + $this->logException($e); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | $manager->rollback(); |
@@ -274,35 +274,35 @@ discard block |
||
274 | 274 | try |
275 | 275 | { |
276 | 276 | $total = 0; |
277 | - $params = $this->storeSearchParams( $view->param(), 'order' ); |
|
278 | - $manager = \Aimeos\MShop::create( $context, 'order' ); |
|
277 | + $params = $this->storeSearchParams($view->param(), 'order'); |
|
278 | + $manager = \Aimeos\MShop::create($context, 'order'); |
|
279 | 279 | |
280 | 280 | $search = $manager->createSearch(); |
281 | - $search->setSortations( [$search->sort( '-', 'order.id' )] ); |
|
282 | - $search = $this->initCriteria( $search, $params ); |
|
281 | + $search->setSortations([$search->sort('-', 'order.id')]); |
|
282 | + $search = $this->initCriteria($search, $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->baseItems = $this->getOrderBaseItems( $view->items ); |
|
286 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->baseItems = $this->getOrderBaseItems($view->items); |
|
286 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
287 | 287 | $view->filterOperators = $search->getOperators(); |
288 | 288 | $view->total = $total; |
289 | 289 | $view->itemBody = ''; |
290 | 290 | |
291 | - foreach( $this->getSubClients() as $client ) { |
|
291 | + foreach ($this->getSubClients() as $client) { |
|
292 | 292 | $view->itemBody .= $client->search(); |
293 | 293 | } |
294 | 294 | } |
295 | - catch( \Aimeos\MShop\Exception $e ) |
|
295 | + catch (\Aimeos\MShop\Exception $e) |
|
296 | 296 | { |
297 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
298 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
299 | - $this->logException( $e ); |
|
297 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
298 | + $view->errors = $view->get('errors', []) + $error; |
|
299 | + $this->logException($e); |
|
300 | 300 | } |
301 | - catch( \Exception $e ) |
|
301 | + catch (\Exception $e) |
|
302 | 302 | { |
303 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
304 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
305 | - $this->logException( $e ); |
|
303 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
304 | + $view->errors = $view->get('errors', []) + $error; |
|
305 | + $this->logException($e); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** admin/jqadm/order/template-list |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $tplconf = 'admin/jqadm/order/template-list'; |
328 | 328 | $default = 'order/list-standard'; |
329 | 329 | |
330 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
330 | + return $view->render($view->config($tplconf, $default)); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @param string|null $name Name of the sub-client (Default if null) |
339 | 339 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
340 | 340 | */ |
341 | - public function getSubClient( $type, $name = null ) |
|
341 | + public function getSubClient($type, $name = null) |
|
342 | 342 | { |
343 | 343 | /** admin/jqadm/order/decorators/excludes |
344 | 344 | * Excludes decorators added by the "common" option from the order JQAdm client |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * @see admin/jqadm/order/decorators/excludes |
414 | 414 | * @see admin/jqadm/order/decorators/global |
415 | 415 | */ |
416 | - return $this->createSubClient( 'order/' . $type, $name ); |
|
416 | + return $this->createSubClient('order/' . $type, $name); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | |
@@ -423,19 +423,19 @@ discard block |
||
423 | 423 | * @param \Aimeos\MShop\Order\Item\Iface[] $orderItems List of order items |
424 | 424 | * @param \Aimeos\MShop\Order\Item\Base\Iface[] List of order base items |
425 | 425 | */ |
426 | - protected function getOrderBaseItems( array $orderItems ) |
|
426 | + protected function getOrderBaseItems(array $orderItems) |
|
427 | 427 | { |
428 | 428 | $baseIds = []; |
429 | - foreach( $orderItems as $item ) { |
|
429 | + foreach ($orderItems as $item) { |
|
430 | 430 | $baseIds[] = $item->getBaseId(); |
431 | 431 | } |
432 | 432 | |
433 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order/base' ); |
|
433 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order/base'); |
|
434 | 434 | |
435 | - $search = $manager->createSearch()->setSlice( 0, count( $baseIds ) ); |
|
436 | - $search->setConditions( $search->compare( '==', 'order.base.id', $baseIds ) ); |
|
435 | + $search = $manager->createSearch()->setSlice(0, count($baseIds)); |
|
436 | + $search->setConditions($search->compare('==', 'order.base.id', $baseIds)); |
|
437 | 437 | |
438 | - return $manager->searchItems( $search, ['order/base/address', 'order/base/service'] ); |
|
438 | + return $manager->searchItems($search, ['order/base/address', 'order/base/service']); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | * @since 2016.01 |
480 | 480 | * @category Developer |
481 | 481 | */ |
482 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/order/standard/subparts', [] ); |
|
482 | + return $this->getContext()->getConfig()->get('admin/jqadm/order/standard/subparts', []); |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | |
@@ -489,72 +489,72 @@ discard block |
||
489 | 489 | * @param string[] Data array |
490 | 490 | * @return \Aimeos\MShop\Order\Item\Iface New order item object |
491 | 491 | */ |
492 | - protected function fromArray( array $data ) |
|
492 | + protected function fromArray(array $data) |
|
493 | 493 | { |
494 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order/base' ); |
|
495 | - $attrManager = \Aimeos\MShop::create( $this->getContext(), 'order/base/service/attribute' ); |
|
494 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order/base'); |
|
495 | + $attrManager = \Aimeos\MShop::create($this->getContext(), 'order/base/service/attribute'); |
|
496 | 496 | |
497 | - if( isset( $data['order.base.id'] ) ) { |
|
498 | - $basket = $manager->load( $data['order.base.id'] ); |
|
497 | + if (isset($data['order.base.id'])) { |
|
498 | + $basket = $manager->load($data['order.base.id']); |
|
499 | 499 | } else { |
500 | 500 | $basket = $manager->createItem(); |
501 | 501 | } |
502 | 502 | |
503 | - $basket->fromArray( $data ); |
|
503 | + $basket->fromArray($data); |
|
504 | 504 | |
505 | - foreach( $basket->getProducts() as $pos => $product ) |
|
505 | + foreach ($basket->getProducts() as $pos => $product) |
|
506 | 506 | { |
507 | - if( isset( $data['product'][$pos]['order.base.product.status'] ) ) { |
|
508 | - $product->setStatus( $data['product'][$pos]['order.base.product.status'] ); |
|
507 | + if (isset($data['product'][$pos]['order.base.product.status'])) { |
|
508 | + $product->setStatus($data['product'][$pos]['order.base.product.status']); |
|
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
512 | - foreach( $basket->getAddresses() as $type => $address ) |
|
512 | + foreach ($basket->getAddresses() as $type => $address) |
|
513 | 513 | { |
514 | - if( isset( $data['address'][$type] ) ) { |
|
514 | + if (isset($data['address'][$type])) { |
|
515 | 515 | $list = (array) $data['address'][$type]; |
516 | - $basket->setAddress( $address->fromArray( $list ), $type ); |
|
516 | + $basket->setAddress($address->fromArray($list), $type); |
|
517 | 517 | } else { |
518 | - $basket->deleteAddress( $type ); |
|
518 | + $basket->deleteAddress($type); |
|
519 | 519 | } |
520 | 520 | } |
521 | 521 | |
522 | - foreach( $basket->getServices() as $type => $services ) |
|
522 | + foreach ($basket->getServices() as $type => $services) |
|
523 | 523 | { |
524 | - foreach( $services as $serviceId => $service ) |
|
524 | + foreach ($services as $serviceId => $service) |
|
525 | 525 | { |
526 | 526 | $list = []; |
527 | 527 | $attrItems = $service->getAttributeItems(); |
528 | 528 | |
529 | - if( isset( $data['service'][$type][$serviceId] ) ) |
|
529 | + if (isset($data['service'][$type][$serviceId])) |
|
530 | 530 | { |
531 | - foreach( (array) $data['service'][$type][$serviceId] as $key => $pair ) |
|
531 | + foreach ((array) $data['service'][$type][$serviceId] as $key => $pair) |
|
532 | 532 | { |
533 | - foreach( $pair as $pos => $value ) { |
|
533 | + foreach ($pair as $pos => $value) { |
|
534 | 534 | $list[$pos][$key] = $value; |
535 | 535 | } |
536 | 536 | } |
537 | 537 | |
538 | - foreach( $list as $array ) |
|
538 | + foreach ($list as $array) |
|
539 | 539 | { |
540 | - if( isset( $attrItems[$array['order.base.service.attribute.id']] ) ) |
|
540 | + if (isset($attrItems[$array['order.base.service.attribute.id']])) |
|
541 | 541 | { |
542 | 542 | $attrItem = $attrItems[$array['order.base.service.attribute.id']]; |
543 | - unset( $attrItems[$array['order.base.service.attribute.id']] ); |
|
543 | + unset($attrItems[$array['order.base.service.attribute.id']]); |
|
544 | 544 | } |
545 | 545 | else |
546 | 546 | { |
547 | 547 | $attrItem = $attrManager->createItem(); |
548 | 548 | } |
549 | 549 | |
550 | - $attrItem->fromArray( $array ); |
|
551 | - $attrItem->setParentId( $service->getId() ); |
|
550 | + $attrItem->fromArray($array); |
|
551 | + $attrItem->setParentId($service->getId()); |
|
552 | 552 | |
553 | - $item = $attrManager->saveItem( $attrItem ); |
|
553 | + $item = $attrManager->saveItem($attrItem); |
|
554 | 554 | } |
555 | 555 | } |
556 | 556 | |
557 | - $attrManager->deleteItems( array_keys( $attrItems ) ); |
|
557 | + $attrManager->deleteItems(array_keys($attrItems)); |
|
558 | 558 | } |
559 | 559 | } |
560 | 560 | |
@@ -568,53 +568,53 @@ discard block |
||
568 | 568 | * @param \Aimeos\MShop\Order\Item\Base\Iface $item Order base item object |
569 | 569 | * @return string[] Multi-dimensional associative list of item data |
570 | 570 | */ |
571 | - protected function toArray( \Aimeos\MShop\Order\Item\Base\Iface $item, $copy = false ) |
|
571 | + protected function toArray(\Aimeos\MShop\Order\Item\Base\Iface $item, $copy = false) |
|
572 | 572 | { |
573 | 573 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
574 | - $data = $item->toArray( true ); |
|
574 | + $data = $item->toArray(true); |
|
575 | 575 | |
576 | - if( $item->getCustomerId() != '' ) |
|
576 | + if ($item->getCustomerId() != '') |
|
577 | 577 | { |
578 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer' ); |
|
578 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer'); |
|
579 | 579 | |
580 | 580 | try { |
581 | - $data += $manager->getItem( $item->getCustomerId() )->toArray(); |
|
582 | - } catch( \Exception $e ) {}; |
|
581 | + $data += $manager->getItem($item->getCustomerId())->toArray(); |
|
582 | + } catch (\Exception $e) {}; |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | |
586 | - if( $copy === true ) |
|
586 | + if ($copy === true) |
|
587 | 587 | { |
588 | 588 | $data['order.base.siteid'] = $siteId; |
589 | 589 | $data['order.base.id'] = ''; |
590 | 590 | } |
591 | 591 | |
592 | - foreach( $item->getAddresses() as $type => $addrItem ) |
|
592 | + foreach ($item->getAddresses() as $type => $addrItem) |
|
593 | 593 | { |
594 | - $list = $addrItem->toArray( true ); |
|
594 | + $list = $addrItem->toArray(true); |
|
595 | 595 | |
596 | - foreach( $list as $key => $value ) { |
|
596 | + foreach ($list as $key => $value) { |
|
597 | 597 | $data['address'][$type][$key] = $value; |
598 | 598 | } |
599 | 599 | |
600 | - if( $copy === true ) |
|
600 | + if ($copy === true) |
|
601 | 601 | { |
602 | 602 | $data['address'][$type]['order.base.address.siteid'] = $siteId; |
603 | 603 | $data['address'][$type]['order.base.address.id'] = ''; |
604 | 604 | } |
605 | 605 | } |
606 | 606 | |
607 | - if( $copy !== true ) |
|
607 | + if ($copy !== true) |
|
608 | 608 | { |
609 | - foreach( $item->getServices() as $type => $services ) |
|
609 | + foreach ($item->getServices() as $type => $services) |
|
610 | 610 | { |
611 | - foreach( $services as $serviceItem ) |
|
611 | + foreach ($services as $serviceItem) |
|
612 | 612 | { |
613 | 613 | $serviceId = $serviceItem->getServiceId(); |
614 | 614 | |
615 | - foreach( $serviceItem->getAttributeItems() as $attrItem ) |
|
615 | + foreach ($serviceItem->getAttributeItems() as $attrItem) |
|
616 | 616 | { |
617 | - foreach( $attrItem->toArray( true ) as $key => $value ) { |
|
617 | + foreach ($attrItem->toArray(true) as $key => $value) { |
|
618 | 618 | $data['service'][$type][$serviceId][$key][] = $value; |
619 | 619 | } |
620 | 620 | } |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | } |
623 | 623 | } |
624 | 624 | |
625 | - foreach( $item->getProducts() as $pos => $productItem ) { |
|
625 | + foreach ($item->getProducts() as $pos => $productItem) { |
|
626 | 626 | $data['product'][$pos]['order.base.product.status'] = $productItem->getStatus(); |
627 | 627 | } |
628 | 628 | |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
637 | 637 | * @return string HTML output |
638 | 638 | */ |
639 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
639 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
640 | 640 | { |
641 | 641 | /** admin/jqadm/order/template-item |
642 | 642 | * Relative path to the HTML body template for the order item. |
@@ -660,6 +660,6 @@ discard block |
||
660 | 660 | $tplconf = 'admin/jqadm/order/template-item'; |
661 | 661 | $default = 'order/item-standard'; |
662 | 662 | |
663 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
663 | + return $view->render($view->config($tplconf, $default)); |
|
664 | 664 | } |
665 | 665 | } |
@@ -102,14 +102,12 @@ discard block |
||
102 | 102 | $view->tabindex = ++$idx + 1; |
103 | 103 | $view->itemBody .= $client->copy(); |
104 | 104 | } |
105 | - } |
|
106 | - catch( \Aimeos\MShop\Exception $e ) |
|
105 | + } catch( \Aimeos\MShop\Exception $e ) |
|
107 | 106 | { |
108 | 107 | $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
109 | 108 | $view->errors = $view->get( 'errors', [] ) + $error; |
110 | 109 | $this->logException( $e ); |
111 | - } |
|
112 | - catch( \Exception $e ) |
|
110 | + } catch( \Exception $e ) |
|
113 | 111 | { |
114 | 112 | $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
115 | 113 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -153,14 +151,12 @@ discard block |
||
153 | 151 | $view->tabindex = ++$idx + 1; |
154 | 152 | $view->itemBody .= $client->create(); |
155 | 153 | } |
156 | - } |
|
157 | - catch( \Aimeos\MShop\Exception $e ) |
|
154 | + } catch( \Aimeos\MShop\Exception $e ) |
|
158 | 155 | { |
159 | 156 | $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
160 | 157 | $view->errors = $view->get( 'errors', [] ) + $error; |
161 | 158 | $this->logException( $e ); |
162 | - } |
|
163 | - catch( \Exception $e ) |
|
159 | + } catch( \Exception $e ) |
|
164 | 160 | { |
165 | 161 | $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
166 | 162 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -201,14 +197,12 @@ discard block |
||
201 | 197 | |
202 | 198 | $this->nextAction( $view, 'search', 'coupon', null, 'delete' ); |
203 | 199 | return; |
204 | - } |
|
205 | - catch( \Aimeos\MShop\Exception $e ) |
|
200 | + } catch( \Aimeos\MShop\Exception $e ) |
|
206 | 201 | { |
207 | 202 | $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
208 | 203 | $view->errors = $view->get( 'errors', [] ) + $error; |
209 | 204 | $this->logException( $e ); |
210 | - } |
|
211 | - catch( \Exception $e ) |
|
205 | + } catch( \Exception $e ) |
|
212 | 206 | { |
213 | 207 | $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
214 | 208 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -252,14 +246,12 @@ discard block |
||
252 | 246 | $view->tabindex = ++$idx + 1; |
253 | 247 | $view->itemBody .= $client->get(); |
254 | 248 | } |
255 | - } |
|
256 | - catch( \Aimeos\MShop\Exception $e ) |
|
249 | + } catch( \Aimeos\MShop\Exception $e ) |
|
257 | 250 | { |
258 | 251 | $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
259 | 252 | $view->errors = $view->get( 'errors', [] ) + $error; |
260 | 253 | $this->logException( $e ); |
261 | - } |
|
262 | - catch( \Exception $e ) |
|
254 | + } catch( \Exception $e ) |
|
263 | 255 | { |
264 | 256 | $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
265 | 257 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -296,18 +288,15 @@ discard block |
||
296 | 288 | |
297 | 289 | $this->nextAction( $view, $view->param( 'next' ), 'coupon', $view->item->getId(), 'save' ); |
298 | 290 | return; |
299 | - } |
|
300 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
291 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
301 | 292 | { |
302 | 293 | // fall through to create |
303 | - } |
|
304 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + } catch( \Aimeos\MShop\Exception $e ) |
|
305 | 295 | { |
306 | 296 | $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
307 | 297 | $view->errors = $view->get( 'errors', [] ) + $error; |
308 | 298 | $this->logException( $e ); |
309 | - } |
|
310 | - catch( \Exception $e ) |
|
299 | + } catch( \Exception $e ) |
|
311 | 300 | { |
312 | 301 | $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
313 | 302 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -346,14 +335,12 @@ discard block |
||
346 | 335 | foreach( $this->getSubClients() as $client ) { |
347 | 336 | $view->itemBody .= $client->search(); |
348 | 337 | } |
349 | - } |
|
350 | - catch( \Aimeos\MShop\Exception $e ) |
|
338 | + } catch( \Aimeos\MShop\Exception $e ) |
|
351 | 339 | { |
352 | 340 | $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
353 | 341 | $view->errors = $view->get( 'errors', [] ) + $error; |
354 | 342 | $this->logException( $e ); |
355 | - } |
|
356 | - catch( \Exception $e ) |
|
343 | + } catch( \Exception $e ) |
|
357 | 344 | { |
358 | 345 | $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
359 | 346 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Coupon; |
12 | 12 | |
13 | -sprintf( 'coupon' ); // for translation |
|
13 | +sprintf('coupon'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,40 +35,40 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'coupon' ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'coupon'); |
|
43 | 43 | |
44 | - $view->item = $manager->getItem( $id ); |
|
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
44 | + $view->item = $manager->getItem($id); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemProviders = $this->getProviderNames(); |
48 | 48 | $view->itemDecorators = $this->getDecoratorNames(); |
49 | - $view->itemAttributes = $this->getConfigAttributes( $view->item ); |
|
49 | + $view->itemAttributes = $this->getConfigAttributes($view->item); |
|
50 | 50 | $view->itemBody = ''; |
51 | 51 | |
52 | - foreach( $this->getSubClients() as $idx => $client ) |
|
52 | + foreach ($this->getSubClients() as $idx => $client) |
|
53 | 53 | { |
54 | 54 | $view->tabindex = ++$idx + 1; |
55 | 55 | $view->itemBody .= $client->copy(); |
56 | 56 | } |
57 | 57 | } |
58 | - catch( \Aimeos\MShop\Exception $e ) |
|
58 | + catch (\Aimeos\MShop\Exception $e) |
|
59 | 59 | { |
60 | - $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
61 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
62 | - $this->logException( $e ); |
|
60 | + $error = array('coupon-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
61 | + $view->errors = $view->get('errors', []) + $error; |
|
62 | + $this->logException($e); |
|
63 | 63 | } |
64 | - catch( \Exception $e ) |
|
64 | + catch (\Exception $e) |
|
65 | 65 | { |
66 | - $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
67 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
68 | - $this->logException( $e ); |
|
66 | + $error = array('coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
67 | + $view->errors = $view->get('errors', []) + $error; |
|
68 | + $this->logException($e); |
|
69 | 69 | } |
70 | 70 | |
71 | - return $this->render( $view ); |
|
71 | + return $this->render($view); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | |
85 | 85 | try |
86 | 86 | { |
87 | - $data = $view->param( 'item', [] ); |
|
87 | + $data = $view->param('item', []); |
|
88 | 88 | |
89 | - if( !isset( $view->item ) ) { |
|
90 | - $view->item = \Aimeos\MShop::create( $context, 'coupon' )->createItem(); |
|
89 | + if (!isset($view->item)) { |
|
90 | + $view->item = \Aimeos\MShop::create($context, 'coupon')->createItem(); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $data['coupon.siteid'] = $view->item->getSiteId(); |
@@ -98,26 +98,26 @@ discard block |
||
98 | 98 | $view->itemData = $data; |
99 | 99 | $view->itemBody = ''; |
100 | 100 | |
101 | - foreach( $this->getSubClients() as $idx => $client ) |
|
101 | + foreach ($this->getSubClients() as $idx => $client) |
|
102 | 102 | { |
103 | 103 | $view->tabindex = ++$idx + 1; |
104 | 104 | $view->itemBody .= $client->create(); |
105 | 105 | } |
106 | 106 | } |
107 | - catch( \Aimeos\MShop\Exception $e ) |
|
107 | + catch (\Aimeos\MShop\Exception $e) |
|
108 | 108 | { |
109 | - $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
110 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
111 | - $this->logException( $e ); |
|
109 | + $error = array('coupon-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
110 | + $view->errors = $view->get('errors', []) + $error; |
|
111 | + $this->logException($e); |
|
112 | 112 | } |
113 | - catch( \Exception $e ) |
|
113 | + catch (\Exception $e) |
|
114 | 114 | { |
115 | - $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
116 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
117 | - $this->logException( $e ); |
|
115 | + $error = array('coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
116 | + $view->errors = $view->get('errors', []) + $error; |
|
117 | + $this->logException($e); |
|
118 | 118 | } |
119 | 119 | |
120 | - return $this->render( $view ); |
|
120 | + return $this->render($view); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -131,38 +131,38 @@ discard block |
||
131 | 131 | $view = $this->getView(); |
132 | 132 | $context = $this->getContext(); |
133 | 133 | |
134 | - $manager = \Aimeos\MShop::create( $context, 'coupon' ); |
|
134 | + $manager = \Aimeos\MShop::create($context, 'coupon'); |
|
135 | 135 | $manager->begin(); |
136 | 136 | |
137 | 137 | try |
138 | 138 | { |
139 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
140 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
139 | + if (($id = $view->param('id')) === null) { |
|
140 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
141 | 141 | } |
142 | 142 | |
143 | - $view->item = $manager->getItem( $id ); |
|
143 | + $view->item = $manager->getItem($id); |
|
144 | 144 | |
145 | - foreach( $this->getSubClients() as $client ) { |
|
145 | + foreach ($this->getSubClients() as $client) { |
|
146 | 146 | $client->delete(); |
147 | 147 | } |
148 | 148 | |
149 | - $manager->deleteItem( $id ); |
|
149 | + $manager->deleteItem($id); |
|
150 | 150 | $manager->commit(); |
151 | 151 | |
152 | - $this->nextAction( $view, 'search', 'coupon', null, 'delete' ); |
|
152 | + $this->nextAction($view, 'search', 'coupon', null, 'delete'); |
|
153 | 153 | return; |
154 | 154 | } |
155 | - catch( \Aimeos\MShop\Exception $e ) |
|
155 | + catch (\Aimeos\MShop\Exception $e) |
|
156 | 156 | { |
157 | - $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
158 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
159 | - $this->logException( $e ); |
|
157 | + $error = array('coupon-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
158 | + $view->errors = $view->get('errors', []) + $error; |
|
159 | + $this->logException($e); |
|
160 | 160 | } |
161 | - catch( \Exception $e ) |
|
161 | + catch (\Exception $e) |
|
162 | 162 | { |
163 | - $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
164 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
165 | - $this->logException( $e ); |
|
163 | + $error = array('coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
164 | + $view->errors = $view->get('errors', []) + $error; |
|
165 | + $this->logException($e); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | $manager->rollback(); |
@@ -183,40 +183,40 @@ discard block |
||
183 | 183 | |
184 | 184 | try |
185 | 185 | { |
186 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
187 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
186 | + if (($id = $view->param('id')) === null) { |
|
187 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
188 | 188 | } |
189 | 189 | |
190 | - $manager = \Aimeos\MShop::create( $context, 'coupon' ); |
|
190 | + $manager = \Aimeos\MShop::create($context, 'coupon'); |
|
191 | 191 | |
192 | - $view->item = $manager->getItem( $id ); |
|
193 | - $view->itemData = $this->toArray( $view->item ); |
|
192 | + $view->item = $manager->getItem($id); |
|
193 | + $view->itemData = $this->toArray($view->item); |
|
194 | 194 | $view->itemSubparts = $this->getSubClientNames(); |
195 | 195 | $view->itemDecorators = $this->getDecoratorNames(); |
196 | 196 | $view->itemProviders = $this->getProviderNames(); |
197 | - $view->itemAttributes = $this->getConfigAttributes( $view->item ); |
|
197 | + $view->itemAttributes = $this->getConfigAttributes($view->item); |
|
198 | 198 | $view->itemBody = ''; |
199 | 199 | |
200 | - foreach( $this->getSubClients() as $idx => $client ) |
|
200 | + foreach ($this->getSubClients() as $idx => $client) |
|
201 | 201 | { |
202 | 202 | $view->tabindex = ++$idx + 1; |
203 | 203 | $view->itemBody .= $client->get(); |
204 | 204 | } |
205 | 205 | } |
206 | - catch( \Aimeos\MShop\Exception $e ) |
|
206 | + catch (\Aimeos\MShop\Exception $e) |
|
207 | 207 | { |
208 | - $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
209 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
210 | - $this->logException( $e ); |
|
208 | + $error = array('coupon-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
209 | + $view->errors = $view->get('errors', []) + $error; |
|
210 | + $this->logException($e); |
|
211 | 211 | } |
212 | - catch( \Exception $e ) |
|
212 | + catch (\Exception $e) |
|
213 | 213 | { |
214 | - $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
215 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
216 | - $this->logException( $e ); |
|
214 | + $error = array('coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
215 | + $view->errors = $view->get('errors', []) + $error; |
|
216 | + $this->logException($e); |
|
217 | 217 | } |
218 | 218 | |
219 | - return $this->render( $view ); |
|
219 | + return $this->render($view); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -230,40 +230,40 @@ discard block |
||
230 | 230 | $view = $this->getView(); |
231 | 231 | $context = $this->getContext(); |
232 | 232 | |
233 | - $manager = \Aimeos\MShop::create( $context, 'coupon' ); |
|
233 | + $manager = \Aimeos\MShop::create($context, 'coupon'); |
|
234 | 234 | $manager->begin(); |
235 | 235 | |
236 | 236 | try |
237 | 237 | { |
238 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
239 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
238 | + $item = $this->fromArray($view->param('item', [])); |
|
239 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
240 | 240 | $view->itemBody = ''; |
241 | 241 | |
242 | - foreach( $this->getSubClients() as $client ) { |
|
242 | + foreach ($this->getSubClients() as $client) { |
|
243 | 243 | $view->itemBody .= $client->save(); |
244 | 244 | } |
245 | 245 | |
246 | - $manager->saveItem( clone $view->item ); |
|
246 | + $manager->saveItem(clone $view->item); |
|
247 | 247 | $manager->commit(); |
248 | 248 | |
249 | - $this->nextAction( $view, $view->param( 'next' ), 'coupon', $view->item->getId(), 'save' ); |
|
249 | + $this->nextAction($view, $view->param('next'), 'coupon', $view->item->getId(), 'save'); |
|
250 | 250 | return; |
251 | 251 | } |
252 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
252 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
253 | 253 | { |
254 | 254 | // fall through to create |
255 | 255 | } |
256 | - catch( \Aimeos\MShop\Exception $e ) |
|
256 | + catch (\Aimeos\MShop\Exception $e) |
|
257 | 257 | { |
258 | - $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
259 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
260 | - $this->logException( $e ); |
|
258 | + $error = array('coupon-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
259 | + $view->errors = $view->get('errors', []) + $error; |
|
260 | + $this->logException($e); |
|
261 | 261 | } |
262 | - catch( \Exception $e ) |
|
262 | + catch (\Exception $e) |
|
263 | 263 | { |
264 | - $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
265 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
266 | - $this->logException( $e ); |
|
264 | + $error = array('coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
265 | + $view->errors = $view->get('errors', []) + $error; |
|
266 | + $this->logException($e); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | $manager->rollback(); |
@@ -285,31 +285,31 @@ discard block |
||
285 | 285 | try |
286 | 286 | { |
287 | 287 | $total = 0; |
288 | - $params = $this->storeSearchParams( $view->param(), 'coupon' ); |
|
289 | - $manager = \Aimeos\MShop::create( $context, 'coupon' ); |
|
290 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
288 | + $params = $this->storeSearchParams($view->param(), 'coupon'); |
|
289 | + $manager = \Aimeos\MShop::create($context, 'coupon'); |
|
290 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
291 | 291 | |
292 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
293 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
292 | + $view->items = $manager->searchItems($search, [], $total); |
|
293 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
294 | 294 | $view->filterOperators = $search->getOperators(); |
295 | 295 | $view->total = $total; |
296 | 296 | $view->itemBody = ''; |
297 | 297 | |
298 | - foreach( $this->getSubClients() as $client ) { |
|
298 | + foreach ($this->getSubClients() as $client) { |
|
299 | 299 | $view->itemBody .= $client->search(); |
300 | 300 | } |
301 | 301 | } |
302 | - catch( \Aimeos\MShop\Exception $e ) |
|
302 | + catch (\Aimeos\MShop\Exception $e) |
|
303 | 303 | { |
304 | - $error = array( 'coupon-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
305 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
306 | - $this->logException( $e ); |
|
304 | + $error = array('coupon-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
305 | + $view->errors = $view->get('errors', []) + $error; |
|
306 | + $this->logException($e); |
|
307 | 307 | } |
308 | - catch( \Exception $e ) |
|
308 | + catch (\Exception $e) |
|
309 | 309 | { |
310 | - $error = array( 'coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
311 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
312 | - $this->logException( $e ); |
|
310 | + $error = array('coupon-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
311 | + $view->errors = $view->get('errors', []) + $error; |
|
312 | + $this->logException($e); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** admin/jqadm/coupon/template-list |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $tplconf = 'admin/jqadm/coupon/template-list'; |
335 | 335 | $default = 'coupon/list-standard'; |
336 | 336 | |
337 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
337 | + return $view->render($view->config($tplconf, $default)); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | * @param string|null $name Name of the sub-client (Default if null) |
346 | 346 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
347 | 347 | */ |
348 | - public function getSubClient( $type, $name = null ) |
|
348 | + public function getSubClient($type, $name = null) |
|
349 | 349 | { |
350 | 350 | /** admin/jqadm/coupon/decorators/excludes |
351 | 351 | * Excludes decorators added by the "common" option from the coupon JQAdm client |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | * @see admin/jqadm/coupon/decorators/excludes |
421 | 421 | * @see admin/jqadm/coupon/decorators/global |
422 | 422 | */ |
423 | - return $this->createSubClient( 'coupon/' . $type, $name ); |
|
423 | + return $this->createSubClient('coupon/' . $type, $name); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | |
@@ -430,13 +430,13 @@ discard block |
||
430 | 430 | * @param \Aimeos\MShop\Coupon\Item\Iface $item Coupon item incl. provider/decorator property |
431 | 431 | * @return \Aimeos\MW\Common\Critera\Attribute\Iface[] List of configuration attributes |
432 | 432 | */ |
433 | - public function getConfigAttributes( \Aimeos\MShop\Coupon\Item\Iface $item ) |
|
433 | + public function getConfigAttributes(\Aimeos\MShop\Coupon\Item\Iface $item) |
|
434 | 434 | { |
435 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'coupon' ); |
|
435 | + $manager = \Aimeos\MShop::create($this->getContext(), 'coupon'); |
|
436 | 436 | |
437 | 437 | try { |
438 | - return $manager->getProvider( $item, '' )->getConfigBE(); |
|
439 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
438 | + return $manager->getProvider($item, '')->getConfigBE(); |
|
439 | + } catch (\Aimeos\MShop\Exception $e) { |
|
440 | 440 | return []; |
441 | 441 | } |
442 | 442 | } |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | * @since 2017.07 |
483 | 483 | * @category Developer |
484 | 484 | */ |
485 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/coupon/standard/subparts', [] ); |
|
485 | + return $this->getContext()->getConfig()->get('admin/jqadm/coupon/standard/subparts', []); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | protected function getDecoratorNames() |
495 | 495 | { |
496 | 496 | $ds = DIRECTORY_SEPARATOR; |
497 | - return $this->getClassNames( 'MShop' . $ds . 'Coupon' . $ds . 'Provider' . $ds . 'Decorator' ); |
|
497 | + return $this->getClassNames('MShop' . $ds . 'Coupon' . $ds . 'Provider' . $ds . 'Decorator'); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | protected function getProviderNames() |
507 | 507 | { |
508 | 508 | $ds = DIRECTORY_SEPARATOR; |
509 | - return $this->getClassNames( 'MShop' . $ds . 'Coupon' . $ds . 'Provider' ); |
|
509 | + return $this->getClassNames('MShop' . $ds . 'Coupon' . $ds . 'Provider'); |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | |
@@ -516,17 +516,17 @@ discard block |
||
516 | 516 | * @param string[] Data array |
517 | 517 | * @return \Aimeos\MShop\Coupon\Item\Iface New coupon item object |
518 | 518 | */ |
519 | - protected function fromArray( array $data ) |
|
519 | + protected function fromArray(array $data) |
|
520 | 520 | { |
521 | 521 | $conf = []; |
522 | 522 | |
523 | - if( isset( $data['config']['key'] ) ) |
|
523 | + if (isset($data['config']['key'])) |
|
524 | 524 | { |
525 | - foreach( (array) $data['config']['key'] as $idx => $key ) |
|
525 | + foreach ((array) $data['config']['key'] as $idx => $key) |
|
526 | 526 | { |
527 | - if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) |
|
527 | + if (trim($key) !== '' && isset($data['config']['val'][$idx])) |
|
528 | 528 | { |
529 | - if( ( $val = json_decode( $data['config']['val'][$idx] ) ) === null ) { |
|
529 | + if (($val = json_decode($data['config']['val'][$idx])) === null) { |
|
530 | 530 | $conf[$key] = $data['config']['val'][$idx]; |
531 | 531 | } else { |
532 | 532 | $conf[$key] = $val; |
@@ -535,16 +535,16 @@ discard block |
||
535 | 535 | } |
536 | 536 | } |
537 | 537 | |
538 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'coupon' ); |
|
538 | + $manager = \Aimeos\MShop::create($this->getContext(), 'coupon'); |
|
539 | 539 | |
540 | - if( isset( $data['coupon.id'] ) && $data['coupon.id'] != '' ) { |
|
541 | - $item = $manager->getItem( $data['coupon.id'] ); |
|
540 | + if (isset($data['coupon.id']) && $data['coupon.id'] != '') { |
|
541 | + $item = $manager->getItem($data['coupon.id']); |
|
542 | 542 | } else { |
543 | 543 | $item = $manager->createItem(); |
544 | 544 | } |
545 | 545 | |
546 | - $item->fromArray( $data ); |
|
547 | - $item->setConfig( $conf ); |
|
546 | + $item->fromArray($data); |
|
547 | + $item->setConfig($conf); |
|
548 | 548 | |
549 | 549 | return $item; |
550 | 550 | } |
@@ -556,21 +556,21 @@ discard block |
||
556 | 556 | * @param \Aimeos\MShop\Coupon\Item\Iface $item Coupon item object |
557 | 557 | * @return string[] Multi-dimensional associative list of item data |
558 | 558 | */ |
559 | - protected function toArray( \Aimeos\MShop\Coupon\Item\Iface $item, $copy = false ) |
|
559 | + protected function toArray(\Aimeos\MShop\Coupon\Item\Iface $item, $copy = false) |
|
560 | 560 | { |
561 | 561 | $config = $item->getConfig(); |
562 | - $data = $item->toArray( true ); |
|
562 | + $data = $item->toArray(true); |
|
563 | 563 | $data['config'] = []; |
564 | 564 | |
565 | - if( $copy === true ) |
|
565 | + if ($copy === true) |
|
566 | 566 | { |
567 | 567 | $data['coupon.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
568 | 568 | $data['coupon.id'] = ''; |
569 | 569 | } |
570 | 570 | |
571 | - ksort( $config ); |
|
571 | + ksort($config); |
|
572 | 572 | |
573 | - foreach( $config as $key => $value ) |
|
573 | + foreach ($config as $key => $value) |
|
574 | 574 | { |
575 | 575 | $data['config']['key'][] = $key; |
576 | 576 | $data['config']['val'][] = $value; |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
587 | 587 | * @return string HTML output |
588 | 588 | */ |
589 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
589 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
590 | 590 | { |
591 | 591 | /** admin/jqadm/coupon/template-item |
592 | 592 | * Relative path to the HTML body template for the coupon item. |
@@ -610,6 +610,6 @@ discard block |
||
610 | 610 | $tplconf = 'admin/jqadm/coupon/template-item'; |
611 | 611 | $default = 'coupon/item-standard'; |
612 | 612 | |
613 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
613 | + return $view->render($view->config($tplconf, $default)); |
|
614 | 614 | } |
615 | 615 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/text/lists', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/text/lists', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Text\Lists; |
12 | 12 | |
13 | -sprintf( 'type/text/lists' ); // for translation |
|
13 | +sprintf('type/text/lists'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'text/lists/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'text/lists/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-text-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'text/lists/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'text/lists/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['text.lists.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-text-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'text/lists/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'text/lists/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/text/lists', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/text/lists', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-text-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'text/lists/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'text/lists/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-text-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'text/lists/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'text/lists/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/text/lists', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/text/lists', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-text-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/text/lists' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'text/lists/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/text/lists'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'text/lists/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-text-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-text-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-text-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/type/text/lists/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/text/lists/template-list'; |
327 | 327 | $default = 'type/text/lists/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $liststype, $name = null ) |
|
340 | + public function getSubClient($liststype, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/text/lists/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the list type JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/type/text/lists/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/text/lists/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/text/lists' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/text/lists' . $liststype, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2017.10 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/text/lists/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/text/lists/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Common\Item\Type\Iface New list type item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'text/lists/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'text/lists/type'); |
|
473 | 473 | |
474 | - if( isset( $data['text.lists.type.id'] ) && $data['text.lists.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['text.lists.type.id'] ); |
|
474 | + if (isset($data['text.lists.type.id']) && $data['text.lists.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['text.lists.type.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['text.lists.type.code'] = $data['text.lists.type.code'] . '_copy'; |
499 | 499 | $data['text.lists.type.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/type/text/lists/template-item |
515 | 515 | * Relative path to the HTML body template for the list type item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/type/text/lists/template-item'; |
534 | 534 | $default = 'type/text/lists/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/text', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/text', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,13 +316,11 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | - } |
|
336 | - catch( \Exception $e ) |
|
323 | + } catch( \Exception $e ) |
|
337 | 324 | { |
338 | 325 | $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
339 | 326 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Text; |
12 | 12 | |
13 | -sprintf( 'type/text' ); // for translation |
|
13 | +sprintf('type/text'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'text/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'text/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-text-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'text/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'text/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['text.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-text-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'text/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'text/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/text', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/text', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-text-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'text/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'text/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-text-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'text/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'text/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/text', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/text', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-text-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,29 +277,29 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/text' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'text/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/text'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'text/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-text-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
296 | + $error = array('type-text-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | 298 | } |
299 | - catch( \Exception $e ) |
|
299 | + catch (\Exception $e) |
|
300 | 300 | { |
301 | - $error = array( 'type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
302 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
301 | + $error = array('type-text-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
302 | + $view->errors = $view->get('errors', []) + $error; |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | /** admin/jqadm/type/text/template-list |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $tplconf = 'admin/jqadm/type/text/template-list'; |
325 | 325 | $default = 'type/text/list-standard'; |
326 | 326 | |
327 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
327 | + return $view->render($view->config($tplconf, $default)); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | * @param string|null $name Name of the sub-client (Default if null) |
336 | 336 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
337 | 337 | */ |
338 | - public function getSubClient( $type, $name = null ) |
|
338 | + public function getSubClient($type, $name = null) |
|
339 | 339 | { |
340 | 340 | /** admin/jqadm/type/text/decorators/excludes |
341 | 341 | * Excludes decorators added by the "common" option from the type JQAdm client |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | * @see admin/jqadm/type/text/decorators/excludes |
411 | 411 | * @see admin/jqadm/type/text/decorators/global |
412 | 412 | */ |
413 | - return $this->createSubClient( 'type/text' . $type, $name ); |
|
413 | + return $this->createSubClient('type/text' . $type, $name); |
|
414 | 414 | } |
415 | 415 | |
416 | 416 | |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | * @since 2017.10 |
455 | 455 | * @category Developer |
456 | 456 | */ |
457 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/text/standard/subparts', [] ); |
|
457 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/text/standard/subparts', []); |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | |
@@ -465,17 +465,17 @@ discard block |
||
465 | 465 | * @param string[] Data array |
466 | 466 | * @return \Aimeos\MShop\Common\Item\Type\Iface New type item object |
467 | 467 | */ |
468 | - protected function fromArray( array $data ) |
|
468 | + protected function fromArray(array $data) |
|
469 | 469 | { |
470 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'text/type' ); |
|
470 | + $manager = \Aimeos\MShop::create($this->getContext(), 'text/type'); |
|
471 | 471 | |
472 | - if( isset( $data['text.type.id'] ) && $data['text.type.id'] != '' ) { |
|
473 | - $item = $manager->getItem( $data['text.type.id'] ); |
|
472 | + if (isset($data['text.type.id']) && $data['text.type.id'] != '') { |
|
473 | + $item = $manager->getItem($data['text.type.id']); |
|
474 | 474 | } else { |
475 | 475 | $item = $manager->createItem(); |
476 | 476 | } |
477 | 477 | |
478 | - $item->fromArray( $data ); |
|
478 | + $item->fromArray($data); |
|
479 | 479 | |
480 | 480 | return $item; |
481 | 481 | } |
@@ -487,11 +487,11 @@ discard block |
||
487 | 487 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
488 | 488 | * @return string[] Multi-dimensional associative list of item data |
489 | 489 | */ |
490 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
490 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
491 | 491 | { |
492 | - $data = $item->toArray( true ); |
|
492 | + $data = $item->toArray(true); |
|
493 | 493 | |
494 | - if( $copy === true ) |
|
494 | + if ($copy === true) |
|
495 | 495 | { |
496 | 496 | $data['text.type.code'] = $data['text.type.code'] . '_copy'; |
497 | 497 | $data['text.type.id'] = ''; |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
508 | 508 | * @return string HTML output |
509 | 509 | */ |
510 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
510 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
511 | 511 | { |
512 | 512 | /** admin/jqadm/type/text/template-item |
513 | 513 | * Relative path to the HTML body template for the type item. |
@@ -531,6 +531,6 @@ discard block |
||
531 | 531 | $tplconf = 'admin/jqadm/type/text/template-item'; |
532 | 532 | $default = 'type/text/item-standard'; |
533 | 533 | |
534 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
534 | + return $view->render($view->config($tplconf, $default)); |
|
535 | 535 | } |
536 | 536 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/plugin', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/plugin', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Plugin; |
12 | 12 | |
13 | -sprintf( 'type/plugin' ); // for translation |
|
13 | +sprintf('type/plugin'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'plugin/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'plugin/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'plugin/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'plugin/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['plugin.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'plugin/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'plugin/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/plugin', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/plugin', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'plugin/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'plugin/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'plugin/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'plugin/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/plugin', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/plugin', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/plugin' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'plugin/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/plugin'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'plugin/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/type/plugin/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/plugin/template-list'; |
327 | 327 | $default = 'type/plugin/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $type, $name = null ) |
|
340 | + public function getSubClient($type, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/plugin/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the type JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/type/plugin/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/plugin/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/plugin' . $type, $name ); |
|
415 | + return $this->createSubClient('type/plugin' . $type, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2017.10 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/plugin/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/plugin/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Common\Item\Type\Iface New type item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'plugin/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'plugin/type'); |
|
473 | 473 | |
474 | - if( isset( $data['plugin.type.id'] ) && $data['plugin.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['plugin.type.id'] ); |
|
474 | + if (isset($data['plugin.type.id']) && $data['plugin.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['plugin.type.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['plugin.type.code'] = $data['plugin.type.code'] . '_copy'; |
499 | 499 | $data['plugin.type.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/type/plugin/template-item |
515 | 515 | * Relative path to the HTML body template for the type item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/type/plugin/template-item'; |
534 | 534 | $default = 'type/plugin/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/service/lists', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/service/lists', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Service\Lists; |
12 | 12 | |
13 | -sprintf( 'type/service/lists' ); // for translation |
|
13 | +sprintf('type/service/lists'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'service/lists/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'service/lists/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-service-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'service/lists/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'service/lists/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['service.lists.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-service-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'service/lists/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'service/lists/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/service/lists', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/service/lists', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-service-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'service/lists/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'service/lists/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-service-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'service/lists/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'service/lists/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/service/lists', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/service/lists', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-service-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/service/lists' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'service/lists/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/service/lists'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'service/lists/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-service-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-service-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-service-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/type/service/lists/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/service/lists/template-list'; |
327 | 327 | $default = 'type/service/lists/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $liststype, $name = null ) |
|
340 | + public function getSubClient($liststype, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/service/lists/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the list type JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/type/service/lists/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/service/lists/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/service/lists' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/service/lists' . $liststype, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2017.10 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/service/lists/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/service/lists/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Common\Item\Type\Iface New list type item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'service/lists/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'service/lists/type'); |
|
473 | 473 | |
474 | - if( isset( $data['service.lists.type.id'] ) && $data['service.lists.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['service.lists.type.id'] ); |
|
474 | + if (isset($data['service.lists.type.id']) && $data['service.lists.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['service.lists.type.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['service.lists.type.code'] = $data['service.lists.type.code'] . '_copy'; |
499 | 499 | $data['service.lists.type.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/type/service/lists/template-item |
515 | 515 | * Relative path to the HTML body template for the list type item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/type/service/lists/template-item'; |
534 | 534 | $default = 'type/service/lists/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/service', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/service', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Service; |
12 | 12 | |
13 | -sprintf( 'type/service' ); // for translation |
|
13 | +sprintf('type/service'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -38,37 +38,37 @@ discard block |
||
38 | 38 | |
39 | 39 | try |
40 | 40 | { |
41 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
42 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
41 | + if (($id = $view->param('id')) === null) { |
|
42 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
43 | 43 | } |
44 | 44 | |
45 | - $manager = \Aimeos\MShop::create( $context, 'service/type' ); |
|
46 | - $view->item = $manager->getItem( $id ); |
|
45 | + $manager = \Aimeos\MShop::create($context, 'service/type'); |
|
46 | + $view->item = $manager->getItem($id); |
|
47 | 47 | |
48 | - $view->itemData = $this->toArray( $view->item, true ); |
|
48 | + $view->itemData = $this->toArray($view->item, true); |
|
49 | 49 | $view->itemSubparts = $this->getSubClientNames(); |
50 | 50 | $view->itemBody = ''; |
51 | 51 | |
52 | - foreach( $this->getSubClients() as $idx => $client ) |
|
52 | + foreach ($this->getSubClients() as $idx => $client) |
|
53 | 53 | { |
54 | 54 | $view->tabindex = ++$idx + 1; |
55 | 55 | $view->itemBody .= $client->copy(); |
56 | 56 | } |
57 | 57 | } |
58 | - catch( \Aimeos\MShop\Exception $e ) |
|
58 | + catch (\Aimeos\MShop\Exception $e) |
|
59 | 59 | { |
60 | - $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
61 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
62 | - $this->logException( $e ); |
|
60 | + $error = array('type-service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
61 | + $view->errors = $view->get('errors', []) + $error; |
|
62 | + $this->logException($e); |
|
63 | 63 | } |
64 | - catch( \Exception $e ) |
|
64 | + catch (\Exception $e) |
|
65 | 65 | { |
66 | - $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
67 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
68 | - $this->logException( $e ); |
|
66 | + $error = array('type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
67 | + $view->errors = $view->get('errors', []) + $error; |
|
68 | + $this->logException($e); |
|
69 | 69 | } |
70 | 70 | |
71 | - return $this->render( $view ); |
|
71 | + return $this->render($view); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | |
85 | 85 | try |
86 | 86 | { |
87 | - $data = $view->param( 'item', [] ); |
|
87 | + $data = $view->param('item', []); |
|
88 | 88 | |
89 | - if( !isset( $view->item ) ) { |
|
90 | - $view->item = \Aimeos\MShop::create( $context, 'service/type' )->createItem(); |
|
89 | + if (!isset($view->item)) { |
|
90 | + $view->item = \Aimeos\MShop::create($context, 'service/type')->createItem(); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $data['service.type.siteid'] = $view->item->getSiteId(); |
@@ -96,26 +96,26 @@ discard block |
||
96 | 96 | $view->itemData = $data; |
97 | 97 | $view->itemBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $idx => $client ) |
|
99 | + foreach ($this->getSubClients() as $idx => $client) |
|
100 | 100 | { |
101 | 101 | $view->tabindex = ++$idx + 1; |
102 | 102 | $view->itemBody .= $client->create(); |
103 | 103 | } |
104 | 104 | } |
105 | - catch( \Aimeos\MShop\Exception $e ) |
|
105 | + catch (\Aimeos\MShop\Exception $e) |
|
106 | 106 | { |
107 | - $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
108 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
109 | - $this->logException( $e ); |
|
107 | + $error = array('type-service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
108 | + $view->errors = $view->get('errors', []) + $error; |
|
109 | + $this->logException($e); |
|
110 | 110 | } |
111 | - catch( \Exception $e ) |
|
111 | + catch (\Exception $e) |
|
112 | 112 | { |
113 | - $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
114 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
115 | - $this->logException( $e ); |
|
113 | + $error = array('type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
114 | + $view->errors = $view->get('errors', []) + $error; |
|
115 | + $this->logException($e); |
|
116 | 116 | } |
117 | 117 | |
118 | - return $this->render( $view ); |
|
118 | + return $this->render($view); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -129,38 +129,38 @@ discard block |
||
129 | 129 | $view = $this->getView(); |
130 | 130 | $context = $this->getContext(); |
131 | 131 | |
132 | - $manager = \Aimeos\MShop::create( $context, 'service/type' ); |
|
132 | + $manager = \Aimeos\MShop::create($context, 'service/type'); |
|
133 | 133 | $manager->begin(); |
134 | 134 | |
135 | 135 | try |
136 | 136 | { |
137 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
138 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
137 | + if (($id = $view->param('id')) === null) { |
|
138 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
139 | 139 | } |
140 | 140 | |
141 | - $view->item = $manager->getItem( $id ); |
|
141 | + $view->item = $manager->getItem($id); |
|
142 | 142 | |
143 | - foreach( $this->getSubClients() as $client ) { |
|
143 | + foreach ($this->getSubClients() as $client) { |
|
144 | 144 | $client->delete(); |
145 | 145 | } |
146 | 146 | |
147 | - $manager->deleteItem( $id ); |
|
147 | + $manager->deleteItem($id); |
|
148 | 148 | $manager->commit(); |
149 | 149 | |
150 | - $this->nextAction( $view, 'search', 'type/service', null, 'delete' ); |
|
150 | + $this->nextAction($view, 'search', 'type/service', null, 'delete'); |
|
151 | 151 | return; |
152 | 152 | } |
153 | - catch( \Aimeos\MShop\Exception $e ) |
|
153 | + catch (\Aimeos\MShop\Exception $e) |
|
154 | 154 | { |
155 | - $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
156 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
157 | - $this->logException( $e ); |
|
155 | + $error = array('type-service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
156 | + $view->errors = $view->get('errors', []) + $error; |
|
157 | + $this->logException($e); |
|
158 | 158 | } |
159 | - catch( \Exception $e ) |
|
159 | + catch (\Exception $e) |
|
160 | 160 | { |
161 | - $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
162 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
163 | - $this->logException( $e ); |
|
161 | + $error = array('type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
162 | + $view->errors = $view->get('errors', []) + $error; |
|
163 | + $this->logException($e); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | $manager->rollback(); |
@@ -181,37 +181,37 @@ discard block |
||
181 | 181 | |
182 | 182 | try |
183 | 183 | { |
184 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
185 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
184 | + if (($id = $view->param('id')) === null) { |
|
185 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
186 | 186 | } |
187 | 187 | |
188 | - $manager = \Aimeos\MShop::create( $context, 'service/type' ); |
|
188 | + $manager = \Aimeos\MShop::create($context, 'service/type'); |
|
189 | 189 | |
190 | - $view->item = $manager->getItem( $id ); |
|
190 | + $view->item = $manager->getItem($id); |
|
191 | 191 | $view->itemSubparts = $this->getSubClientNames(); |
192 | - $view->itemData = $this->toArray( $view->item ); |
|
192 | + $view->itemData = $this->toArray($view->item); |
|
193 | 193 | $view->itemBody = ''; |
194 | 194 | |
195 | - foreach( $this->getSubClients() as $idx => $client ) |
|
195 | + foreach ($this->getSubClients() as $idx => $client) |
|
196 | 196 | { |
197 | 197 | $view->tabindex = ++$idx + 1; |
198 | 198 | $view->itemBody .= $client->get(); |
199 | 199 | } |
200 | 200 | } |
201 | - catch( \Aimeos\MShop\Exception $e ) |
|
201 | + catch (\Aimeos\MShop\Exception $e) |
|
202 | 202 | { |
203 | - $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
204 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
205 | - $this->logException( $e ); |
|
203 | + $error = array('type-service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
204 | + $view->errors = $view->get('errors', []) + $error; |
|
205 | + $this->logException($e); |
|
206 | 206 | } |
207 | - catch( \Exception $e ) |
|
207 | + catch (\Exception $e) |
|
208 | 208 | { |
209 | - $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
210 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
211 | - $this->logException( $e ); |
|
209 | + $error = array('type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
210 | + $view->errors = $view->get('errors', []) + $error; |
|
211 | + $this->logException($e); |
|
212 | 212 | } |
213 | 213 | |
214 | - return $this->render( $view ); |
|
214 | + return $this->render($view); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -225,40 +225,40 @@ discard block |
||
225 | 225 | $view = $this->getView(); |
226 | 226 | $context = $this->getContext(); |
227 | 227 | |
228 | - $manager = \Aimeos\MShop::create( $context, 'service/type' ); |
|
228 | + $manager = \Aimeos\MShop::create($context, 'service/type'); |
|
229 | 229 | $manager->begin(); |
230 | 230 | |
231 | 231 | try |
232 | 232 | { |
233 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
234 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
233 | + $item = $this->fromArray($view->param('item', [])); |
|
234 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
235 | 235 | $view->itemBody = ''; |
236 | 236 | |
237 | - foreach( $this->getSubClients() as $client ) { |
|
237 | + foreach ($this->getSubClients() as $client) { |
|
238 | 238 | $view->itemBody .= $client->save(); |
239 | 239 | } |
240 | 240 | |
241 | - $manager->saveItem( clone $view->item ); |
|
241 | + $manager->saveItem(clone $view->item); |
|
242 | 242 | $manager->commit(); |
243 | 243 | |
244 | - $this->nextAction( $view, $view->param( 'next' ), 'type/service', $view->item->getId(), 'save' ); |
|
244 | + $this->nextAction($view, $view->param('next'), 'type/service', $view->item->getId(), 'save'); |
|
245 | 245 | return; |
246 | 246 | } |
247 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
247 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
248 | 248 | { |
249 | 249 | // fall through to create |
250 | 250 | } |
251 | - catch( \Aimeos\MShop\Exception $e ) |
|
251 | + catch (\Aimeos\MShop\Exception $e) |
|
252 | 252 | { |
253 | - $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
254 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
255 | - $this->logException( $e ); |
|
253 | + $error = array('type-service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
254 | + $view->errors = $view->get('errors', []) + $error; |
|
255 | + $this->logException($e); |
|
256 | 256 | } |
257 | - catch( \Exception $e ) |
|
257 | + catch (\Exception $e) |
|
258 | 258 | { |
259 | - $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
260 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
261 | - $this->logException( $e ); |
|
259 | + $error = array('type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
260 | + $view->errors = $view->get('errors', []) + $error; |
|
261 | + $this->logException($e); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | $manager->rollback(); |
@@ -280,31 +280,31 @@ discard block |
||
280 | 280 | try |
281 | 281 | { |
282 | 282 | $total = 0; |
283 | - $params = $this->storeSearchParams( $view->param(), 'type/service' ); |
|
284 | - $manager = \Aimeos\MShop::create( $context, 'service/type' ); |
|
285 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
283 | + $params = $this->storeSearchParams($view->param(), 'type/service'); |
|
284 | + $manager = \Aimeos\MShop::create($context, 'service/type'); |
|
285 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
286 | 286 | |
287 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
288 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
287 | + $view->items = $manager->searchItems($search, [], $total); |
|
288 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
289 | 289 | $view->filterOperators = $search->getOperators(); |
290 | 290 | $view->total = $total; |
291 | 291 | $view->itemBody = ''; |
292 | 292 | |
293 | - foreach( $this->getSubClients() as $client ) { |
|
293 | + foreach ($this->getSubClients() as $client) { |
|
294 | 294 | $view->itemBody .= $client->search(); |
295 | 295 | } |
296 | 296 | } |
297 | - catch( \Aimeos\MShop\Exception $e ) |
|
297 | + catch (\Aimeos\MShop\Exception $e) |
|
298 | 298 | { |
299 | - $error = array( 'type-service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
300 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
301 | - $this->logException( $e ); |
|
299 | + $error = array('type-service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
300 | + $view->errors = $view->get('errors', []) + $error; |
|
301 | + $this->logException($e); |
|
302 | 302 | } |
303 | - catch( \Exception $e ) |
|
303 | + catch (\Exception $e) |
|
304 | 304 | { |
305 | - $error = array( 'type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
306 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
307 | - $this->logException( $e ); |
|
305 | + $error = array('type-service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
306 | + $view->errors = $view->get('errors', []) + $error; |
|
307 | + $this->logException($e); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | /** admin/jqadm/type/service/template-list |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $tplconf = 'admin/jqadm/type/service/template-list'; |
330 | 330 | $default = 'type/service/list-standard'; |
331 | 331 | |
332 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
332 | + return $view->render($view->config($tplconf, $default)); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | * @param string|null $name Name of the sub-client (Default if null) |
341 | 341 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
342 | 342 | */ |
343 | - public function getSubClient( $type, $name = null ) |
|
343 | + public function getSubClient($type, $name = null) |
|
344 | 344 | { |
345 | 345 | /** admin/jqadm/type/service/decorators/excludes |
346 | 346 | * Excludes decorators added by the "common" option from the type JQAdm client |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @see admin/jqadm/type/service/decorators/excludes |
416 | 416 | * @see admin/jqadm/type/service/decorators/global |
417 | 417 | */ |
418 | - return $this->createSubClient( 'type/service' . $type, $name ); |
|
418 | + return $this->createSubClient('type/service' . $type, $name); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | * @since 2017.10 |
460 | 460 | * @category Developer |
461 | 461 | */ |
462 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/service/standard/subparts', [] ); |
|
462 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/service/standard/subparts', []); |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | |
@@ -470,17 +470,17 @@ discard block |
||
470 | 470 | * @param string[] Data array |
471 | 471 | * @return \Aimeos\MShop\Common\Item\Type\Iface New type item object |
472 | 472 | */ |
473 | - protected function fromArray( array $data ) |
|
473 | + protected function fromArray(array $data) |
|
474 | 474 | { |
475 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'service/type' ); |
|
475 | + $manager = \Aimeos\MShop::create($this->getContext(), 'service/type'); |
|
476 | 476 | |
477 | - if( isset( $data['service.type.id'] ) && $data['service.type.id'] != '' ) { |
|
478 | - $item = $manager->getItem( $data['service.type.id'] ); |
|
477 | + if (isset($data['service.type.id']) && $data['service.type.id'] != '') { |
|
478 | + $item = $manager->getItem($data['service.type.id']); |
|
479 | 479 | } else { |
480 | 480 | $item = $manager->createItem(); |
481 | 481 | } |
482 | 482 | |
483 | - $item->fromArray( $data ); |
|
483 | + $item->fromArray($data); |
|
484 | 484 | |
485 | 485 | return $item; |
486 | 486 | } |
@@ -492,11 +492,11 @@ discard block |
||
492 | 492 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
493 | 493 | * @return string[] Multi-dimensional associative list of item data |
494 | 494 | */ |
495 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
495 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
496 | 496 | { |
497 | - $data = $item->toArray( true ); |
|
497 | + $data = $item->toArray(true); |
|
498 | 498 | |
499 | - if( $copy === true ) |
|
499 | + if ($copy === true) |
|
500 | 500 | { |
501 | 501 | $data['service.type.code'] = $data['service.type.code'] . '_copy'; |
502 | 502 | $data['service.type.id'] = ''; |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
513 | 513 | * @return string HTML output |
514 | 514 | */ |
515 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
515 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
516 | 516 | { |
517 | 517 | /** admin/jqadm/type/service/template-item |
518 | 518 | * Relative path to the HTML body template for the type item. |
@@ -536,6 +536,6 @@ discard block |
||
536 | 536 | $tplconf = 'admin/jqadm/type/service/template-item'; |
537 | 537 | $default = 'type/service/item-standard'; |
538 | 538 | |
539 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
539 | + return $view->render($view->config($tplconf, $default)); |
|
540 | 540 | } |
541 | 541 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/media/lists', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/media/lists', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Media\Lists; |
12 | 12 | |
13 | -sprintf( 'type/media/lists' ); // for translation |
|
13 | +sprintf('type/media/lists'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'media/lists/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'media/lists/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-media-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'media/lists/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'media/lists/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['media.lists.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-media-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'media/lists/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'media/lists/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/media/lists', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/media/lists', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-media-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'media/lists/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'media/lists/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-media-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'media/lists/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'media/lists/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/media/lists', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/media/lists', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-media-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/media/lists' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'media/lists/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/media/lists'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'media/lists/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-media-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-media-lists-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-media-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/type/media/lists/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/media/lists/template-list'; |
327 | 327 | $default = 'type/media/lists/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $liststype, $name = null ) |
|
340 | + public function getSubClient($liststype, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/media/lists/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the list type JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/type/media/lists/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/media/lists/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/media/lists' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/media/lists' . $liststype, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2017.10 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/media/lists/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/media/lists/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Common\Item\Type\Iface New list type item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'media/lists/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'media/lists/type'); |
|
473 | 473 | |
474 | - if( isset( $data['media.lists.type.id'] ) && $data['media.lists.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['media.lists.type.id'] ); |
|
474 | + if (isset($data['media.lists.type.id']) && $data['media.lists.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['media.lists.type.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['media.lists.type.code'] = $data['media.lists.type.code'] . '_copy'; |
499 | 499 | $data['media.lists.type.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/type/media/lists/template-item |
515 | 515 | * Relative path to the HTML body template for the list type item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/type/media/lists/template-item'; |
534 | 534 | $default = 'type/media/lists/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/media/property', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/media/property', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Media\Property; |
12 | 12 | |
13 | -sprintf( 'type/media/property' ); // for translation |
|
13 | +sprintf('type/media/property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'media/property/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'media/property/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-media-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'media/property/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'media/property/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['media.property.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-media-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'media/property/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'media/property/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/media/property', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/media/property', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-media-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'media/property/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'media/property/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-media-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'media/property/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'media/property/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/media/property', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/media/property', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-media-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/media/property' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'media/property/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/media/property'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'media/property/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-media-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-media-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-media-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/type/media/property/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/media/property/template-list'; |
327 | 327 | $default = 'type/media/property/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $propertytype, $name = null ) |
|
340 | + public function getSubClient($propertytype, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/media/property/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the list type JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/type/media/property/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/media/property/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/media/property' . $propertytype, $name ); |
|
415 | + return $this->createSubClient('type/media/property' . $propertytype, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2017.10 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/media/property/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/media/property/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Common\Item\Type\Iface New list type item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'media/property/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'media/property/type'); |
|
473 | 473 | |
474 | - if( isset( $data['media.property.type.id'] ) && $data['media.property.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['media.property.type.id'] ); |
|
474 | + if (isset($data['media.property.type.id']) && $data['media.property.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['media.property.type.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['media.property.type.code'] = $data['media.property.type.code'] . '_copy'; |
499 | 499 | $data['media.property.type.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/type/media/property/template-item |
515 | 515 | * Relative path to the HTML body template for the list type item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/type/media/property/template-item'; |
534 | 534 | $default = 'type/media/property/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |