@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Plugin; |
12 | 12 | |
13 | -sprintf( 'plugin' ); // for translation |
|
13 | +sprintf('plugin'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,41 +35,41 @@ 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\Factory::createManager( $context, 'plugin' ); |
|
42 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'plugin'); |
|
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->itemTypes = $this->getTypeItems(); |
51 | 51 | $view->itemBody = ''; |
52 | 52 | |
53 | - foreach( $this->getSubClients() as $idx => $client ) |
|
53 | + foreach ($this->getSubClients() as $idx => $client) |
|
54 | 54 | { |
55 | 55 | $view->tabindex = ++$idx + 1; |
56 | 56 | $view->itemBody .= $client->copy(); |
57 | 57 | } |
58 | 58 | } |
59 | - catch( \Aimeos\MShop\Exception $e ) |
|
59 | + catch (\Aimeos\MShop\Exception $e) |
|
60 | 60 | { |
61 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
62 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
63 | - $this->logException( $e ); |
|
61 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
62 | + $view->errors = $view->get('errors', []) + $error; |
|
63 | + $this->logException($e); |
|
64 | 64 | } |
65 | - catch( \Exception $e ) |
|
65 | + catch (\Exception $e) |
|
66 | 66 | { |
67 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
68 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
69 | - $this->logException( $e ); |
|
67 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
68 | + $view->errors = $view->get('errors', []) + $error; |
|
69 | + $this->logException($e); |
|
70 | 70 | } |
71 | 71 | |
72 | - return $this->render( $view ); |
|
72 | + return $this->render($view); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | |
86 | 86 | try |
87 | 87 | { |
88 | - $data = $view->param( 'item', [] ); |
|
88 | + $data = $view->param('item', []); |
|
89 | 89 | |
90 | - if( !isset( $view->item ) ) { |
|
91 | - $view->item = \Aimeos\MShop\Factory::createManager( $context, 'plugin' )->createItem(); |
|
90 | + if (!isset($view->item)) { |
|
91 | + $view->item = \Aimeos\MShop\Factory::createManager($context, 'plugin')->createItem(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $data['plugin.siteid'] = $view->item->getSiteId(); |
@@ -100,26 +100,26 @@ discard block |
||
100 | 100 | $view->itemData = $data; |
101 | 101 | $view->itemBody = ''; |
102 | 102 | |
103 | - foreach( $this->getSubClients() as $idx => $client ) |
|
103 | + foreach ($this->getSubClients() as $idx => $client) |
|
104 | 104 | { |
105 | 105 | $view->tabindex = ++$idx + 1; |
106 | 106 | $view->itemBody .= $client->create(); |
107 | 107 | } |
108 | 108 | } |
109 | - catch( \Aimeos\MShop\Exception $e ) |
|
109 | + catch (\Aimeos\MShop\Exception $e) |
|
110 | 110 | { |
111 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
112 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
113 | - $this->logException( $e ); |
|
111 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
112 | + $view->errors = $view->get('errors', []) + $error; |
|
113 | + $this->logException($e); |
|
114 | 114 | } |
115 | - catch( \Exception $e ) |
|
115 | + catch (\Exception $e) |
|
116 | 116 | { |
117 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
118 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
119 | - $this->logException( $e ); |
|
117 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
118 | + $view->errors = $view->get('errors', []) + $error; |
|
119 | + $this->logException($e); |
|
120 | 120 | } |
121 | 121 | |
122 | - return $this->render( $view ); |
|
122 | + return $this->render($view); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -133,38 +133,38 @@ discard block |
||
133 | 133 | $view = $this->getView(); |
134 | 134 | $context = $this->getContext(); |
135 | 135 | |
136 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' ); |
|
136 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'plugin'); |
|
137 | 137 | $manager->begin(); |
138 | 138 | |
139 | 139 | try |
140 | 140 | { |
141 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
142 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
141 | + if (($id = $view->param('id')) === null) { |
|
142 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
143 | 143 | } |
144 | 144 | |
145 | - $view->item = $manager->getItem( $id ); |
|
145 | + $view->item = $manager->getItem($id); |
|
146 | 146 | |
147 | - foreach( $this->getSubClients() as $client ) { |
|
147 | + foreach ($this->getSubClients() as $client) { |
|
148 | 148 | $client->delete(); |
149 | 149 | } |
150 | 150 | |
151 | - $manager->deleteItem( $id ); |
|
151 | + $manager->deleteItem($id); |
|
152 | 152 | $manager->commit(); |
153 | 153 | |
154 | - $this->nextAction( $view, 'search', 'plugin', null, 'delete' ); |
|
154 | + $this->nextAction($view, 'search', 'plugin', null, 'delete'); |
|
155 | 155 | return; |
156 | 156 | } |
157 | - catch( \Aimeos\MShop\Exception $e ) |
|
157 | + catch (\Aimeos\MShop\Exception $e) |
|
158 | 158 | { |
159 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
160 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
161 | - $this->logException( $e ); |
|
159 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
160 | + $view->errors = $view->get('errors', []) + $error; |
|
161 | + $this->logException($e); |
|
162 | 162 | } |
163 | - catch( \Exception $e ) |
|
163 | + catch (\Exception $e) |
|
164 | 164 | { |
165 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
166 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
167 | - $this->logException( $e ); |
|
165 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
166 | + $view->errors = $view->get('errors', []) + $error; |
|
167 | + $this->logException($e); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $manager->rollback(); |
@@ -185,41 +185,41 @@ discard block |
||
185 | 185 | |
186 | 186 | try |
187 | 187 | { |
188 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
189 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
188 | + if (($id = $view->param('id')) === null) { |
|
189 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
190 | 190 | } |
191 | 191 | |
192 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' ); |
|
192 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'plugin'); |
|
193 | 193 | |
194 | - $view->item = $manager->getItem( $id ); |
|
195 | - $view->itemData = $this->toArray( $view->item ); |
|
194 | + $view->item = $manager->getItem($id); |
|
195 | + $view->itemData = $this->toArray($view->item); |
|
196 | 196 | $view->itemSubparts = $this->getSubClientNames(); |
197 | 197 | $view->itemDecorators = $this->getDecoratorNames(); |
198 | 198 | $view->itemProviders = $this->getProviderNames(); |
199 | - $view->itemAttributes = $this->getConfigAttributes( $view->item ); |
|
199 | + $view->itemAttributes = $this->getConfigAttributes($view->item); |
|
200 | 200 | $view->itemTypes = $this->getTypeItems(); |
201 | 201 | $view->itemBody = ''; |
202 | 202 | |
203 | - foreach( $this->getSubClients() as $idx => $client ) |
|
203 | + foreach ($this->getSubClients() as $idx => $client) |
|
204 | 204 | { |
205 | 205 | $view->tabindex = ++$idx + 1; |
206 | 206 | $view->itemBody .= $client->get(); |
207 | 207 | } |
208 | 208 | } |
209 | - catch( \Aimeos\MShop\Exception $e ) |
|
209 | + catch (\Aimeos\MShop\Exception $e) |
|
210 | 210 | { |
211 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
212 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
213 | - $this->logException( $e ); |
|
211 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
212 | + $view->errors = $view->get('errors', []) + $error; |
|
213 | + $this->logException($e); |
|
214 | 214 | } |
215 | - catch( \Exception $e ) |
|
215 | + catch (\Exception $e) |
|
216 | 216 | { |
217 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
218 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
219 | - $this->logException( $e ); |
|
217 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
218 | + $view->errors = $view->get('errors', []) + $error; |
|
219 | + $this->logException($e); |
|
220 | 220 | } |
221 | 221 | |
222 | - return $this->render( $view ); |
|
222 | + return $this->render($view); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | |
@@ -233,40 +233,40 @@ discard block |
||
233 | 233 | $view = $this->getView(); |
234 | 234 | $context = $this->getContext(); |
235 | 235 | |
236 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' ); |
|
236 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'plugin'); |
|
237 | 237 | $manager->begin(); |
238 | 238 | |
239 | 239 | try |
240 | 240 | { |
241 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
242 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
241 | + $item = $this->fromArray($view->param('item', [])); |
|
242 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
243 | 243 | $view->itemBody = ''; |
244 | 244 | |
245 | - foreach( $this->getSubClients() as $client ) { |
|
245 | + foreach ($this->getSubClients() as $client) { |
|
246 | 246 | $view->itemBody .= $client->save(); |
247 | 247 | } |
248 | 248 | |
249 | - $manager->saveItem( clone $view->item ); |
|
249 | + $manager->saveItem(clone $view->item); |
|
250 | 250 | $manager->commit(); |
251 | 251 | |
252 | - $this->nextAction( $view, $view->param( 'next' ), 'plugin', $view->item->getId(), 'save' ); |
|
252 | + $this->nextAction($view, $view->param('next'), 'plugin', $view->item->getId(), 'save'); |
|
253 | 253 | return; |
254 | 254 | } |
255 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
255 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
256 | 256 | { |
257 | 257 | // fall through to create |
258 | 258 | } |
259 | - catch( \Aimeos\MShop\Exception $e ) |
|
259 | + catch (\Aimeos\MShop\Exception $e) |
|
260 | 260 | { |
261 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
262 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
263 | - $this->logException( $e ); |
|
261 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
262 | + $view->errors = $view->get('errors', []) + $error; |
|
263 | + $this->logException($e); |
|
264 | 264 | } |
265 | - catch( \Exception $e ) |
|
265 | + catch (\Exception $e) |
|
266 | 266 | { |
267 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
268 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
269 | - $this->logException( $e ); |
|
267 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
268 | + $view->errors = $view->get('errors', []) + $error; |
|
269 | + $this->logException($e); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | $manager->rollback(); |
@@ -288,35 +288,35 @@ discard block |
||
288 | 288 | try |
289 | 289 | { |
290 | 290 | $total = 0; |
291 | - $params = $this->storeSearchParams( $view->param(), 'plugin' ); |
|
292 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' ); |
|
291 | + $params = $this->storeSearchParams($view->param(), 'plugin'); |
|
292 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'plugin'); |
|
293 | 293 | |
294 | 294 | $search = $manager->createSearch(); |
295 | - $search->setSortations( [$search->sort( '+', 'plugin.type' ), $search->sort( '+', 'plugin.position' )] ); |
|
296 | - $search = $this->initCriteria( $search, $params ); |
|
295 | + $search->setSortations([$search->sort('+', 'plugin.type'), $search->sort('+', 'plugin.position')]); |
|
296 | + $search = $this->initCriteria($search, $params); |
|
297 | 297 | |
298 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
299 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
298 | + $view->items = $manager->searchItems($search, [], $total); |
|
299 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
300 | 300 | $view->filterOperators = $search->getOperators(); |
301 | 301 | $view->itemTypes = $this->getTypeItems(); |
302 | 302 | $view->total = $total; |
303 | 303 | $view->itemBody = ''; |
304 | 304 | |
305 | - foreach( $this->getSubClients() as $client ) { |
|
305 | + foreach ($this->getSubClients() as $client) { |
|
306 | 306 | $view->itemBody .= $client->search(); |
307 | 307 | } |
308 | 308 | } |
309 | - catch( \Aimeos\MShop\Exception $e ) |
|
309 | + catch (\Aimeos\MShop\Exception $e) |
|
310 | 310 | { |
311 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
312 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
313 | - $this->logException( $e ); |
|
311 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
312 | + $view->errors = $view->get('errors', []) + $error; |
|
313 | + $this->logException($e); |
|
314 | 314 | } |
315 | - catch( \Exception $e ) |
|
315 | + catch (\Exception $e) |
|
316 | 316 | { |
317 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
318 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
319 | - $this->logException( $e ); |
|
317 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
318 | + $view->errors = $view->get('errors', []) + $error; |
|
319 | + $this->logException($e); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /** admin/jqadm/plugin/template-list |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $tplconf = 'admin/jqadm/plugin/template-list'; |
342 | 342 | $default = 'plugin/list-standard'; |
343 | 343 | |
344 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
344 | + return $view->render($view->config($tplconf, $default)); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | * @param string|null $name Name of the sub-client (Default if null) |
353 | 353 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
354 | 354 | */ |
355 | - public function getSubClient( $type, $name = null ) |
|
355 | + public function getSubClient($type, $name = null) |
|
356 | 356 | { |
357 | 357 | /** admin/jqadm/plugin/decorators/excludes |
358 | 358 | * Excludes decorators added by the "common" option from the plugin JQAdm client |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * @see admin/jqadm/plugin/decorators/excludes |
428 | 428 | * @see admin/jqadm/plugin/decorators/global |
429 | 429 | */ |
430 | - return $this->createSubClient( 'plugin/' . $type, $name ); |
|
430 | + return $this->createSubClient('plugin/' . $type, $name); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | |
@@ -437,13 +437,13 @@ discard block |
||
437 | 437 | * @param \Aimeos\MShop\Plugin\Item\Iface $item Plugin item incl. provider/decorator property |
438 | 438 | * @return \Aimeos\MW\Common\Critera\Attribute\Iface[] List of configuration attributes |
439 | 439 | */ |
440 | - public function getConfigAttributes( \Aimeos\MShop\Plugin\Item\Iface $item ) |
|
440 | + public function getConfigAttributes(\Aimeos\MShop\Plugin\Item\Iface $item) |
|
441 | 441 | { |
442 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin' ); |
|
442 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin'); |
|
443 | 443 | |
444 | 444 | try { |
445 | - return $manager->getProvider( $item, $item->getType() )->getConfigBE(); |
|
446 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
445 | + return $manager->getProvider($item, $item->getType())->getConfigBE(); |
|
446 | + } catch (\Aimeos\MShop\Exception $e) { |
|
447 | 447 | return []; |
448 | 448 | } |
449 | 449 | } |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | protected function getDecoratorNames() |
458 | 458 | { |
459 | 459 | $ds = DIRECTORY_SEPARATOR; |
460 | - return $this->getClassNames( 'MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Decorator' ); |
|
460 | + return $this->getClassNames('MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Decorator'); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | { |
471 | 471 | $ds = DIRECTORY_SEPARATOR; |
472 | 472 | return [ |
473 | - 'order' => $this->getClassNames( 'MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Order' ) |
|
473 | + 'order' => $this->getClassNames('MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Order') |
|
474 | 474 | ]; |
475 | 475 | } |
476 | 476 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * @since 2017.10 |
516 | 516 | * @category Developer |
517 | 517 | */ |
518 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/plugin/standard/subparts', [] ); |
|
518 | + return $this->getContext()->getConfig()->get('admin/jqadm/plugin/standard/subparts', []); |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | |
@@ -526,12 +526,12 @@ discard block |
||
526 | 526 | */ |
527 | 527 | protected function getTypeItems() |
528 | 528 | { |
529 | - $typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin/type' ); |
|
529 | + $typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin/type'); |
|
530 | 530 | |
531 | - $search = $typeManager->createSearch()->setSlice( 0, 0x7fffffff ); |
|
532 | - $search->setSortations( array( $search->sort( '+', 'plugin.type.label' ) ) ); |
|
531 | + $search = $typeManager->createSearch()->setSlice(0, 0x7fffffff); |
|
532 | + $search->setSortations(array($search->sort('+', 'plugin.type.label'))); |
|
533 | 533 | |
534 | - return $typeManager->searchItems( $search ); |
|
534 | + return $typeManager->searchItems($search); |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | |
@@ -541,17 +541,17 @@ discard block |
||
541 | 541 | * @param string[] Data array |
542 | 542 | * @return \Aimeos\MShop\Plugin\Item\Iface New plugin item object |
543 | 543 | */ |
544 | - protected function fromArray( array $data ) |
|
544 | + protected function fromArray(array $data) |
|
545 | 545 | { |
546 | 546 | $conf = []; |
547 | 547 | |
548 | - if( isset( $data['config']['key'] ) ) |
|
548 | + if (isset($data['config']['key'])) |
|
549 | 549 | { |
550 | - foreach( (array) $data['config']['key'] as $idx => $key ) |
|
550 | + foreach ((array) $data['config']['key'] as $idx => $key) |
|
551 | 551 | { |
552 | - if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) |
|
552 | + if (trim($key) !== '' && isset($data['config']['val'][$idx])) |
|
553 | 553 | { |
554 | - if( ( $val = json_decode( $data['config']['val'][$idx] ) ) === null ) { |
|
554 | + if (($val = json_decode($data['config']['val'][$idx])) === null) { |
|
555 | 555 | $conf[$key] = $data['config']['val'][$idx]; |
556 | 556 | } else { |
557 | 557 | $conf[$key] = $val; |
@@ -560,16 +560,16 @@ discard block |
||
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
563 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin' ); |
|
563 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin'); |
|
564 | 564 | |
565 | - if( isset( $data['plugin.id'] ) && $data['plugin.id'] != '' ) { |
|
566 | - $item = $manager->getItem( $data['plugin.id'] ); |
|
565 | + if (isset($data['plugin.id']) && $data['plugin.id'] != '') { |
|
566 | + $item = $manager->getItem($data['plugin.id']); |
|
567 | 567 | } else { |
568 | 568 | $item = $manager->createItem(); |
569 | 569 | } |
570 | 570 | |
571 | - $item->fromArray( $data ); |
|
572 | - $item->setConfig( $conf ); |
|
571 | + $item->fromArray($data); |
|
572 | + $item->setConfig($conf); |
|
573 | 573 | |
574 | 574 | return $item; |
575 | 575 | } |
@@ -581,21 +581,21 @@ discard block |
||
581 | 581 | * @param \Aimeos\MShop\Plugin\Item\Iface $item Plugin item object |
582 | 582 | * @return string[] Multi-dimensional associative list of item data |
583 | 583 | */ |
584 | - protected function toArray( \Aimeos\MShop\Plugin\Item\Iface $item, $copy = false ) |
|
584 | + protected function toArray(\Aimeos\MShop\Plugin\Item\Iface $item, $copy = false) |
|
585 | 585 | { |
586 | 586 | $config = $item->getConfig(); |
587 | - $data = $item->toArray( true ); |
|
587 | + $data = $item->toArray(true); |
|
588 | 588 | $data['config'] = []; |
589 | 589 | |
590 | - if( $copy === true ) |
|
590 | + if ($copy === true) |
|
591 | 591 | { |
592 | 592 | $data['plugin.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
593 | 593 | $data['plugin.id'] = ''; |
594 | 594 | } |
595 | 595 | |
596 | - ksort( $config ); |
|
596 | + ksort($config); |
|
597 | 597 | |
598 | - foreach( $config as $key => $value ) |
|
598 | + foreach ($config as $key => $value) |
|
599 | 599 | { |
600 | 600 | $data['config']['key'][] = $key; |
601 | 601 | $data['config']['val'][] = $value; |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
612 | 612 | * @return string HTML output |
613 | 613 | */ |
614 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
614 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
615 | 615 | { |
616 | 616 | /** admin/jqadm/plugin/template-item |
617 | 617 | * Relative path to the HTML body template for the plugin item. |
@@ -635,6 +635,6 @@ discard block |
||
635 | 635 | $tplconf = 'admin/jqadm/plugin/template-item'; |
636 | 636 | $default = 'plugin/item-standard'; |
637 | 637 | |
638 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
638 | + return $view->render($view->config($tplconf, $default)); |
|
639 | 639 | } |
640 | 640 | } |