@@ -291,8 +291,7 @@ |
||
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | 293 | unset( $propItems[$entry['media.property.id']] ); |
294 | - } |
|
295 | - else |
|
294 | + } else |
|
296 | 295 | { |
297 | 296 | $propItem = $propManager->createItem(); |
298 | 297 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Attribute\Image\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->imageData = $this->toArray( $view->item, $view->get( 'imageData', [] ), true ); |
|
47 | + $view->imageData = $this->toArray($view->item, $view->get('imageData', []), true); |
|
48 | 48 | $view->propertyBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->propertyBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->get( 'imageData', [] ); |
|
67 | + $data = $view->get('imageData', []); |
|
68 | 68 | |
69 | - foreach( $data as $index => $entry ) |
|
69 | + foreach ($data as $index => $entry) |
|
70 | 70 | { |
71 | - foreach( $view->value( $entry, 'property', [] ) as $idx => $y ) { |
|
71 | + foreach ($view->value($entry, 'property', []) as $idx => $y) { |
|
72 | 72 | $data[$index]['property'][$idx]['attribute.lists.siteid'] = $siteid; |
73 | 73 | } |
74 | 74 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | $view->propertyData = $data; |
77 | 77 | $view->propertyBody = ''; |
78 | 78 | |
79 | - foreach( $this->getSubClients() as $client ) { |
|
79 | + foreach ($this->getSubClients() as $client) { |
|
80 | 80 | $view->propertyBody .= $client->create(); |
81 | 81 | } |
82 | 82 | |
83 | - return $this->render( $view ); |
|
83 | + return $this->render($view); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function get() |
93 | 93 | { |
94 | - $view = $this->addViewData( $this->getView() ); |
|
94 | + $view = $this->addViewData($this->getView()); |
|
95 | 95 | |
96 | - $view->imageData = $this->toArray( $view->item, $view->get( 'imageData', [] ) ); |
|
96 | + $view->imageData = $this->toArray($view->item, $view->get('imageData', [])); |
|
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | { |
112 | 112 | $view = $this->getView(); |
113 | 113 | |
114 | - $view->item = $this->fromArray( $view->item, $view->param( 'image', [] ) ); |
|
114 | + $view->item = $this->fromArray($view->item, $view->param('image', [])); |
|
115 | 115 | $view->propertyBody = ''; |
116 | 116 | |
117 | - foreach( $this->getSubClients() as $client ) { |
|
117 | + foreach ($this->getSubClients() as $client) { |
|
118 | 118 | $view->propertyBody .= $client->save(); |
119 | 119 | } |
120 | 120 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @param string|null $name Name of the sub-client (Default if null) |
128 | 128 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
129 | 129 | */ |
130 | - public function getSubClient( $type, $name = null ) |
|
130 | + public function getSubClient($type, $name = null) |
|
131 | 131 | { |
132 | 132 | /** admin/jqadm/attribute/image/property/decorators/excludes |
133 | 133 | * Excludes decorators added by the "common" option from the attribute JQAdm client |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @see admin/jqadm/attribute/image/property/decorators/excludes |
203 | 203 | * @see admin/jqadm/attribute/image/property/decorators/global |
204 | 204 | */ |
205 | - return $this->createSubClient( 'attribute/image/property/' . $type, $name ); |
|
205 | + return $this->createSubClient('attribute/image/property/' . $type, $name); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -212,15 +212,15 @@ discard block |
||
212 | 212 | * @param \Aimeos\MW\View\Iface $view View object |
213 | 213 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
214 | 214 | */ |
215 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
215 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
216 | 216 | { |
217 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'media/property/type' ); |
|
217 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'media/property/type'); |
|
218 | 218 | |
219 | 219 | $search = $manager->createSearch(); |
220 | - $search->setConditions( $search->compare( '==', 'media.property.type.domain', 'attribute' ) ); |
|
221 | - $search->setSlice( 0, 0x7fffffff ); |
|
220 | + $search->setConditions($search->compare('==', 'media.property.type.domain', 'attribute')); |
|
221 | + $search->setSlice(0, 0x7fffffff); |
|
222 | 222 | |
223 | - $view->propertyTypes = $manager->searchItems( $search ); |
|
223 | + $view->propertyTypes = $manager->searchItems($search); |
|
224 | 224 | |
225 | 225 | return $view; |
226 | 226 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @since 2018.01 |
267 | 267 | * @category Developer |
268 | 268 | */ |
269 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/image/property/standard/subparts', [] ); |
|
269 | + return $this->getContext()->getConfig()->get('admin/jqadm/attribute/image/property/standard/subparts', []); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | |
@@ -276,32 +276,32 @@ discard block |
||
276 | 276 | * @param \Aimeos\MShop\Attribute\Item\Iface $item Attribute item object without referenced domain items |
277 | 277 | * @param string[] $data Data array |
278 | 278 | */ |
279 | - protected function fromArray( \Aimeos\MShop\Attribute\Item\Iface $item, array $data ) |
|
279 | + protected function fromArray(\Aimeos\MShop\Attribute\Item\Iface $item, array $data) |
|
280 | 280 | { |
281 | - $propManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'media/property' ); |
|
281 | + $propManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'media/property'); |
|
282 | 282 | $index = 0; |
283 | 283 | |
284 | - foreach( $item->getRefItems( 'media', null, null, false ) as $refItem ) |
|
284 | + foreach ($item->getRefItems('media', null, null, false) as $refItem) |
|
285 | 285 | { |
286 | - $propItems = $refItem->getPropertyItems( null, false ); |
|
286 | + $propItems = $refItem->getPropertyItems(null, false); |
|
287 | 287 | |
288 | - foreach( (array) $this->getValue( $data, $index . '/property', [] ) as $entry ) |
|
288 | + foreach ((array) $this->getValue($data, $index . '/property', []) as $entry) |
|
289 | 289 | { |
290 | - if( isset( $propItems[$entry['media.property.id']] ) ) |
|
290 | + if (isset($propItems[$entry['media.property.id']])) |
|
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | - unset( $propItems[$entry['media.property.id']] ); |
|
293 | + unset($propItems[$entry['media.property.id']]); |
|
294 | 294 | } |
295 | 295 | else |
296 | 296 | { |
297 | 297 | $propItem = $propManager->createItem(); |
298 | 298 | } |
299 | 299 | |
300 | - $propItem->fromArray( $entry ); |
|
301 | - $refItem->addPropertyItem( $propItem ); |
|
300 | + $propItem->fromArray($entry); |
|
301 | + $refItem->addPropertyItem($propItem); |
|
302 | 302 | } |
303 | 303 | |
304 | - $refItem->deletePropertyItems( $propItems ); |
|
304 | + $refItem->deletePropertyItems($propItems); |
|
305 | 305 | $index++; |
306 | 306 | } |
307 | 307 | |
@@ -317,18 +317,18 @@ discard block |
||
317 | 317 | * @param boolean $copy True if items should be copied, false if not |
318 | 318 | * @return string[] Multi-dimensional associative list of item data |
319 | 319 | */ |
320 | - protected function toArray( \Aimeos\MShop\Attribute\Item\Iface $item, array $data, $copy = false ) |
|
320 | + protected function toArray(\Aimeos\MShop\Attribute\Item\Iface $item, array $data, $copy = false) |
|
321 | 321 | { |
322 | 322 | $idx = 0; |
323 | 323 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
324 | 324 | |
325 | - foreach( $item->getRefItems( 'media', null, null, false ) as $mediaItem ) |
|
325 | + foreach ($item->getRefItems('media', null, null, false) as $mediaItem) |
|
326 | 326 | { |
327 | - foreach( $mediaItem->getPropertyItems( null, false ) as $propItem ) |
|
327 | + foreach ($mediaItem->getPropertyItems(null, false) as $propItem) |
|
328 | 328 | { |
329 | - $list = $propItem->toArray( true ); |
|
329 | + $list = $propItem->toArray(true); |
|
330 | 330 | |
331 | - if( $copy === true ) |
|
331 | + if ($copy === true) |
|
332 | 332 | { |
333 | 333 | $list['media.property.siteid'] = $siteId; |
334 | 334 | $list['media.property.id'] = ''; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
351 | 351 | * @return string HTML output |
352 | 352 | */ |
353 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
353 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
354 | 354 | { |
355 | 355 | /** admin/jqadm/attribute/image/property/template-item |
356 | 356 | * Relative path to the HTML body template of the image subpart for attributes. |
@@ -374,6 +374,6 @@ discard block |
||
374 | 374 | $tplconf = 'admin/jqadm/attribute/image/property/template-item'; |
375 | 375 | $default = 'attribute/item-image-property-standard'; |
376 | 376 | |
377 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
377 | + return $view->render($view->config($tplconf, $default)); |
|
378 | 378 | } |
379 | 379 | } |
380 | 380 | \ No newline at end of file |
@@ -291,8 +291,7 @@ |
||
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | 293 | unset( $propItems[$entry['media.property.id']] ); |
294 | - } |
|
295 | - else |
|
294 | + } else |
|
296 | 295 | { |
297 | 296 | $propItem = $propManager->createItem(); |
298 | 297 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Supplier\Image\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->imageData = $this->toArray( $view->item, $view->get( 'imageData', [] ), true ); |
|
47 | + $view->imageData = $this->toArray($view->item, $view->get('imageData', []), true); |
|
48 | 48 | $view->propertyBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->propertyBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->get( 'imageData', [] ); |
|
67 | + $data = $view->get('imageData', []); |
|
68 | 68 | |
69 | - foreach( $data as $index => $entry ) |
|
69 | + foreach ($data as $index => $entry) |
|
70 | 70 | { |
71 | - foreach( $view->value( $entry, 'property', [] ) as $idx => $y ) { |
|
71 | + foreach ($view->value($entry, 'property', []) as $idx => $y) { |
|
72 | 72 | $data[$index]['property'][$idx]['supplier.lists.siteid'] = $siteid; |
73 | 73 | } |
74 | 74 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | $view->propertyData = $data; |
77 | 77 | $view->propertyBody = ''; |
78 | 78 | |
79 | - foreach( $this->getSubClients() as $client ) { |
|
79 | + foreach ($this->getSubClients() as $client) { |
|
80 | 80 | $view->propertyBody .= $client->create(); |
81 | 81 | } |
82 | 82 | |
83 | - return $this->render( $view ); |
|
83 | + return $this->render($view); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function get() |
93 | 93 | { |
94 | - $view = $this->addViewData( $this->getView() ); |
|
94 | + $view = $this->addViewData($this->getView()); |
|
95 | 95 | |
96 | - $view->imageData = $this->toArray( $view->item, $view->get( 'imageData', [] ) ); |
|
96 | + $view->imageData = $this->toArray($view->item, $view->get('imageData', [])); |
|
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | { |
112 | 112 | $view = $this->getView(); |
113 | 113 | |
114 | - $view->item = $this->fromArray( $view->item, $view->param( 'image', [] ) ); |
|
114 | + $view->item = $this->fromArray($view->item, $view->param('image', [])); |
|
115 | 115 | $view->propertyBody = ''; |
116 | 116 | |
117 | - foreach( $this->getSubClients() as $client ) { |
|
117 | + foreach ($this->getSubClients() as $client) { |
|
118 | 118 | $view->propertyBody .= $client->save(); |
119 | 119 | } |
120 | 120 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @param string|null $name Name of the sub-client (Default if null) |
128 | 128 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
129 | 129 | */ |
130 | - public function getSubClient( $type, $name = null ) |
|
130 | + public function getSubClient($type, $name = null) |
|
131 | 131 | { |
132 | 132 | /** admin/jqadm/supplier/image/property/decorators/excludes |
133 | 133 | * Excludes decorators added by the "common" option from the supplier JQAdm client |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @see admin/jqadm/supplier/image/property/decorators/excludes |
203 | 203 | * @see admin/jqadm/supplier/image/property/decorators/global |
204 | 204 | */ |
205 | - return $this->createSubClient( 'supplier/image/property/' . $type, $name ); |
|
205 | + return $this->createSubClient('supplier/image/property/' . $type, $name); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -212,15 +212,15 @@ discard block |
||
212 | 212 | * @param \Aimeos\MW\View\Iface $view View object |
213 | 213 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
214 | 214 | */ |
215 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
215 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
216 | 216 | { |
217 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'media/property/type' ); |
|
217 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'media/property/type'); |
|
218 | 218 | |
219 | 219 | $search = $manager->createSearch(); |
220 | - $search->setConditions( $search->compare( '==', 'media.property.type.domain', 'supplier' ) ); |
|
221 | - $search->setSlice( 0, 0x7fffffff ); |
|
220 | + $search->setConditions($search->compare('==', 'media.property.type.domain', 'supplier')); |
|
221 | + $search->setSlice(0, 0x7fffffff); |
|
222 | 222 | |
223 | - $view->propertyTypes = $manager->searchItems( $search ); |
|
223 | + $view->propertyTypes = $manager->searchItems($search); |
|
224 | 224 | |
225 | 225 | return $view; |
226 | 226 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @since 2018.01 |
267 | 267 | * @category Developer |
268 | 268 | */ |
269 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/image/property/standard/subparts', [] ); |
|
269 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/image/property/standard/subparts', []); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | |
@@ -276,32 +276,32 @@ discard block |
||
276 | 276 | * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object without referenced domain items |
277 | 277 | * @param string[] $data Data array |
278 | 278 | */ |
279 | - protected function fromArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data ) |
|
279 | + protected function fromArray(\Aimeos\MShop\Supplier\Item\Iface $item, array $data) |
|
280 | 280 | { |
281 | - $propManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'media/property' ); |
|
281 | + $propManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'media/property'); |
|
282 | 282 | $index = 0; |
283 | 283 | |
284 | - foreach( $item->getRefItems( 'media', null, null, false ) as $refItem ) |
|
284 | + foreach ($item->getRefItems('media', null, null, false) as $refItem) |
|
285 | 285 | { |
286 | - $propItems = $refItem->getPropertyItems( null, false ); |
|
286 | + $propItems = $refItem->getPropertyItems(null, false); |
|
287 | 287 | |
288 | - foreach( (array) $this->getValue( $data, $index . '/property', [] ) as $entry ) |
|
288 | + foreach ((array) $this->getValue($data, $index . '/property', []) as $entry) |
|
289 | 289 | { |
290 | - if( isset( $propItems[$entry['media.property.id']] ) ) |
|
290 | + if (isset($propItems[$entry['media.property.id']])) |
|
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | - unset( $propItems[$entry['media.property.id']] ); |
|
293 | + unset($propItems[$entry['media.property.id']]); |
|
294 | 294 | } |
295 | 295 | else |
296 | 296 | { |
297 | 297 | $propItem = $propManager->createItem(); |
298 | 298 | } |
299 | 299 | |
300 | - $propItem->fromArray( $entry ); |
|
301 | - $refItem->addPropertyItem( $propItem ); |
|
300 | + $propItem->fromArray($entry); |
|
301 | + $refItem->addPropertyItem($propItem); |
|
302 | 302 | } |
303 | 303 | |
304 | - $refItem->deletePropertyItems( $propItems ); |
|
304 | + $refItem->deletePropertyItems($propItems); |
|
305 | 305 | $index++; |
306 | 306 | } |
307 | 307 | |
@@ -317,18 +317,18 @@ discard block |
||
317 | 317 | * @param boolean $copy True if items should be copied, false if not |
318 | 318 | * @return string[] Multi-dimensional associative list of item data |
319 | 319 | */ |
320 | - protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data, $copy = false ) |
|
320 | + protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, array $data, $copy = false) |
|
321 | 321 | { |
322 | 322 | $idx = 0; |
323 | 323 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
324 | 324 | |
325 | - foreach( $item->getRefItems( 'media', null, null, false ) as $mediaItem ) |
|
325 | + foreach ($item->getRefItems('media', null, null, false) as $mediaItem) |
|
326 | 326 | { |
327 | - foreach( $mediaItem->getPropertyItems( null, false ) as $propItem ) |
|
327 | + foreach ($mediaItem->getPropertyItems(null, false) as $propItem) |
|
328 | 328 | { |
329 | - $list = $propItem->toArray( true ); |
|
329 | + $list = $propItem->toArray(true); |
|
330 | 330 | |
331 | - if( $copy === true ) |
|
331 | + if ($copy === true) |
|
332 | 332 | { |
333 | 333 | $list['media.property.siteid'] = $siteId; |
334 | 334 | $list['media.property.id'] = ''; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
351 | 351 | * @return string HTML output |
352 | 352 | */ |
353 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
353 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
354 | 354 | { |
355 | 355 | /** admin/jqadm/supplier/image/property/template-item |
356 | 356 | * Relative path to the HTML body template of the image subpart for suppliers. |
@@ -374,6 +374,6 @@ discard block |
||
374 | 374 | $tplconf = 'admin/jqadm/supplier/image/property/template-item'; |
375 | 375 | $default = 'supplier/item-image-property-standard'; |
376 | 376 | |
377 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
377 | + return $view->render($view->config($tplconf, $default)); |
|
378 | 378 | } |
379 | 379 | } |
380 | 380 | \ No newline at end of file |
@@ -291,8 +291,7 @@ |
||
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | 293 | unset( $propItems[$entry['media.property.id']] ); |
294 | - } |
|
295 | - else |
|
294 | + } else |
|
296 | 295 | { |
297 | 296 | $propItem = $propManager->createItem(); |
298 | 297 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Catalog\Image\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->imageData = $this->toArray( $view->item, $view->get( 'imageData', [] ), true ); |
|
47 | + $view->imageData = $this->toArray($view->item, $view->get('imageData', []), true); |
|
48 | 48 | $view->propertyBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->propertyBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->get( 'imageData', [] ); |
|
67 | + $data = $view->get('imageData', []); |
|
68 | 68 | |
69 | - foreach( $data as $index => $entry ) |
|
69 | + foreach ($data as $index => $entry) |
|
70 | 70 | { |
71 | - foreach( $view->value( $entry, 'property', [] ) as $idx => $y ) { |
|
71 | + foreach ($view->value($entry, 'property', []) as $idx => $y) { |
|
72 | 72 | $data[$index]['property'][$idx]['catalog.lists.siteid'] = $siteid; |
73 | 73 | } |
74 | 74 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | $view->propertyData = $data; |
77 | 77 | $view->propertyBody = ''; |
78 | 78 | |
79 | - foreach( $this->getSubClients() as $client ) { |
|
79 | + foreach ($this->getSubClients() as $client) { |
|
80 | 80 | $view->propertyBody .= $client->create(); |
81 | 81 | } |
82 | 82 | |
83 | - return $this->render( $view ); |
|
83 | + return $this->render($view); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function get() |
93 | 93 | { |
94 | - $view = $this->addViewData( $this->getView() ); |
|
94 | + $view = $this->addViewData($this->getView()); |
|
95 | 95 | |
96 | - $view->imageData = $this->toArray( $view->item, $view->get( 'imageData', [] ) ); |
|
96 | + $view->imageData = $this->toArray($view->item, $view->get('imageData', [])); |
|
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | { |
112 | 112 | $view = $this->getView(); |
113 | 113 | |
114 | - $view->item = $this->fromArray( $view->item, $view->param( 'image', [] ) ); |
|
114 | + $view->item = $this->fromArray($view->item, $view->param('image', [])); |
|
115 | 115 | $view->propertyBody = ''; |
116 | 116 | |
117 | - foreach( $this->getSubClients() as $client ) { |
|
117 | + foreach ($this->getSubClients() as $client) { |
|
118 | 118 | $view->propertyBody .= $client->save(); |
119 | 119 | } |
120 | 120 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @param string|null $name Name of the sub-client (Default if null) |
128 | 128 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
129 | 129 | */ |
130 | - public function getSubClient( $type, $name = null ) |
|
130 | + public function getSubClient($type, $name = null) |
|
131 | 131 | { |
132 | 132 | /** admin/jqadm/catalog/image/property/decorators/excludes |
133 | 133 | * Excludes decorators added by the "common" option from the catalog JQAdm client |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @see admin/jqadm/catalog/image/property/decorators/excludes |
203 | 203 | * @see admin/jqadm/catalog/image/property/decorators/global |
204 | 204 | */ |
205 | - return $this->createSubClient( 'catalog/image/property/' . $type, $name ); |
|
205 | + return $this->createSubClient('catalog/image/property/' . $type, $name); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -212,15 +212,15 @@ discard block |
||
212 | 212 | * @param \Aimeos\MW\View\Iface $view View object |
213 | 213 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
214 | 214 | */ |
215 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
215 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
216 | 216 | { |
217 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'media/property/type' ); |
|
217 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'media/property/type'); |
|
218 | 218 | |
219 | 219 | $search = $manager->createSearch(); |
220 | - $search->setConditions( $search->compare( '==', 'media.property.type.domain', 'catalog' ) ); |
|
221 | - $search->setSlice( 0, 0x7fffffff ); |
|
220 | + $search->setConditions($search->compare('==', 'media.property.type.domain', 'catalog')); |
|
221 | + $search->setSlice(0, 0x7fffffff); |
|
222 | 222 | |
223 | - $view->propertyTypes = $manager->searchItems( $search ); |
|
223 | + $view->propertyTypes = $manager->searchItems($search); |
|
224 | 224 | |
225 | 225 | return $view; |
226 | 226 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @since 2018.01 |
267 | 267 | * @category Developer |
268 | 268 | */ |
269 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/image/property/standard/subparts', [] ); |
|
269 | + return $this->getContext()->getConfig()->get('admin/jqadm/catalog/image/property/standard/subparts', []); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | |
@@ -276,32 +276,32 @@ discard block |
||
276 | 276 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item object without referenced domain items |
277 | 277 | * @param string[] $data Data array |
278 | 278 | */ |
279 | - protected function fromArray( \Aimeos\MShop\Catalog\Item\Iface $item, array $data ) |
|
279 | + protected function fromArray(\Aimeos\MShop\Catalog\Item\Iface $item, array $data) |
|
280 | 280 | { |
281 | - $propManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'media/property' ); |
|
281 | + $propManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'media/property'); |
|
282 | 282 | $index = 0; |
283 | 283 | |
284 | - foreach( $item->getRefItems( 'media', null, null, false ) as $refItem ) |
|
284 | + foreach ($item->getRefItems('media', null, null, false) as $refItem) |
|
285 | 285 | { |
286 | - $propItems = $refItem->getPropertyItems( null, false ); |
|
286 | + $propItems = $refItem->getPropertyItems(null, false); |
|
287 | 287 | |
288 | - foreach( (array) $this->getValue( $data, $index . '/property', [] ) as $entry ) |
|
288 | + foreach ((array) $this->getValue($data, $index . '/property', []) as $entry) |
|
289 | 289 | { |
290 | - if( isset( $propItems[$entry['media.property.id']] ) ) |
|
290 | + if (isset($propItems[$entry['media.property.id']])) |
|
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | - unset( $propItems[$entry['media.property.id']] ); |
|
293 | + unset($propItems[$entry['media.property.id']]); |
|
294 | 294 | } |
295 | 295 | else |
296 | 296 | { |
297 | 297 | $propItem = $propManager->createItem(); |
298 | 298 | } |
299 | 299 | |
300 | - $propItem->fromArray( $entry ); |
|
301 | - $refItem->addPropertyItem( $propItem ); |
|
300 | + $propItem->fromArray($entry); |
|
301 | + $refItem->addPropertyItem($propItem); |
|
302 | 302 | } |
303 | 303 | |
304 | - $refItem->deletePropertyItems( $propItems ); |
|
304 | + $refItem->deletePropertyItems($propItems); |
|
305 | 305 | $index++; |
306 | 306 | } |
307 | 307 | |
@@ -317,18 +317,18 @@ discard block |
||
317 | 317 | * @param boolean $copy True if items should be copied, false if not |
318 | 318 | * @return string[] Multi-dimensional associative list of item data |
319 | 319 | */ |
320 | - protected function toArray( \Aimeos\MShop\Catalog\Item\Iface $item, array $data, $copy = false ) |
|
320 | + protected function toArray(\Aimeos\MShop\Catalog\Item\Iface $item, array $data, $copy = false) |
|
321 | 321 | { |
322 | 322 | $idx = 0; |
323 | 323 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
324 | 324 | |
325 | - foreach( $item->getRefItems( 'media', null, null, false ) as $mediaItem ) |
|
325 | + foreach ($item->getRefItems('media', null, null, false) as $mediaItem) |
|
326 | 326 | { |
327 | - foreach( $mediaItem->getPropertyItems( null, false ) as $propItem ) |
|
327 | + foreach ($mediaItem->getPropertyItems(null, false) as $propItem) |
|
328 | 328 | { |
329 | - $list = $propItem->toArray( true ); |
|
329 | + $list = $propItem->toArray(true); |
|
330 | 330 | |
331 | - if( $copy === true ) |
|
331 | + if ($copy === true) |
|
332 | 332 | { |
333 | 333 | $list['media.property.siteid'] = $siteId; |
334 | 334 | $list['media.property.id'] = ''; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
351 | 351 | * @return string HTML output |
352 | 352 | */ |
353 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
353 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
354 | 354 | { |
355 | 355 | /** admin/jqadm/catalog/image/property/template-item |
356 | 356 | * Relative path to the HTML body template of the image subpart for catalogs. |
@@ -374,6 +374,6 @@ discard block |
||
374 | 374 | $tplconf = 'admin/jqadm/catalog/image/property/template-item'; |
375 | 375 | $default = 'catalog/item-image-property-standard'; |
376 | 376 | |
377 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
377 | + return $view->render($view->config($tplconf, $default)); |
|
378 | 378 | } |
379 | 379 | } |
380 | 380 | \ No newline at end of file |
@@ -121,14 +121,12 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | - } |
|
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
124 | + } catch( \Aimeos\MShop\Exception $e ) |
|
126 | 125 | { |
127 | 126 | $error = array( 'attribute-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
128 | 127 | $view->errors = $view->get( 'errors', [] ) + $error; |
129 | 128 | $this->logException( $e ); |
130 | - } |
|
131 | - catch( \Exception $e ) |
|
129 | + } catch( \Exception $e ) |
|
132 | 130 | { |
133 | 131 | $error = array( 'attribute-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
134 | 132 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -320,8 +318,7 @@ discard block |
||
320 | 318 | { |
321 | 319 | $propItem = $propItems[$entry['attribute.property.id']]; |
322 | 320 | unset( $propItems[$entry['attribute.property.id']] ); |
323 | - } |
|
324 | - else |
|
321 | + } else |
|
325 | 322 | { |
326 | 323 | $propItem = $manager->createItem(); |
327 | 324 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Attribute\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->propertyData = $this->toArray( $view->item, true ); |
|
47 | + $view->propertyData = $this->toArray($view->item, true); |
|
48 | 48 | $view->propertyTypes = $this->getPropertyTypes(); |
49 | 49 | $view->propertyBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $client ) { |
|
51 | + foreach ($this->getSubClients() as $client) { |
|
52 | 52 | $view->propertyBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | |
55 | - return $this->render( $view ); |
|
55 | + return $this->render($view); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | { |
66 | 66 | $view = $this->getView(); |
67 | 67 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
68 | - $data = $view->param( 'property', [] ); |
|
68 | + $data = $view->param('property', []); |
|
69 | 69 | |
70 | - foreach( $data as $idx => $entry ) { |
|
70 | + foreach ($data as $idx => $entry) { |
|
71 | 71 | $data[$idx]['attribute.lists.siteid'] = $siteid; |
72 | 72 | } |
73 | 73 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->propertyData = $data; |
76 | 76 | $view->propertyBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->propertyBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -92,15 +92,15 @@ discard block |
||
92 | 92 | { |
93 | 93 | $view = $this->getView(); |
94 | 94 | |
95 | - $view->propertyData = $this->toArray( $view->item ); |
|
95 | + $view->propertyData = $this->toArray($view->item); |
|
96 | 96 | $view->propertyTypes = $this->getPropertyTypes(); |
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -113,26 +113,26 @@ discard block |
||
113 | 113 | |
114 | 114 | try |
115 | 115 | { |
116 | - $this->fromArray( $view->item, $view->param( 'property', [] ) ); |
|
116 | + $this->fromArray($view->item, $view->param('property', [])); |
|
117 | 117 | $view->propertyBody = ''; |
118 | 118 | |
119 | - foreach( $this->getSubClients() as $client ) { |
|
119 | + foreach ($this->getSubClients() as $client) { |
|
120 | 120 | $view->propertyBody .= $client->save(); |
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | 124 | } |
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
125 | + catch (\Aimeos\MShop\Exception $e) |
|
126 | 126 | { |
127 | - $error = array( 'attribute-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
128 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
129 | - $this->logException( $e ); |
|
127 | + $error = array('attribute-item-property' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
128 | + $view->errors = $view->get('errors', []) + $error; |
|
129 | + $this->logException($e); |
|
130 | 130 | } |
131 | - catch( \Exception $e ) |
|
131 | + catch (\Exception $e) |
|
132 | 132 | { |
133 | - $error = array( 'attribute-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
134 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
135 | - $this->logException( $e ); |
|
133 | + $error = array('attribute-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
134 | + $view->errors = $view->get('errors', []) + $error; |
|
135 | + $this->logException($e); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param string|null $name Name of the sub-client (Default if null) |
147 | 147 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
148 | 148 | */ |
149 | - public function getSubClient( $type, $name = null ) |
|
149 | + public function getSubClient($type, $name = null) |
|
150 | 150 | { |
151 | 151 | /** admin/jqadm/attribute/property/decorators/excludes |
152 | 152 | * Excludes decorators added by the "common" option from the attribute JQAdm client |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @see admin/jqadm/attribute/property/decorators/excludes |
222 | 222 | * @see admin/jqadm/attribute/property/decorators/global |
223 | 223 | */ |
224 | - return $this->createSubClient( 'attribute/property/' . $type, $name ); |
|
224 | + return $this->createSubClient('attribute/property/' . $type, $name); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @since 2018.01 |
266 | 266 | * @category Developer |
267 | 267 | */ |
268 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/property/standard/subparts', [] ); |
|
268 | + return $this->getContext()->getConfig()->get('admin/jqadm/attribute/property/standard/subparts', []); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | */ |
277 | 277 | protected function getPropertyTypes() |
278 | 278 | { |
279 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute/property/type' ); |
|
280 | - return $manager->searchItems( $manager->createSearch()->setSlice( 0, 0x7fffffff ) ); |
|
279 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute/property/type'); |
|
280 | + return $manager->searchItems($manager->createSearch()->setSlice(0, 0x7fffffff)); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | |
@@ -287,29 +287,29 @@ discard block |
||
287 | 287 | * @param \Aimeos\MShop\Attribute\Item\Iface $item Attribute item object without referenced domain items |
288 | 288 | * @param string[] $data Data array |
289 | 289 | */ |
290 | - protected function fromArray( \Aimeos\MShop\Attribute\Item\Iface $item, array $data ) |
|
290 | + protected function fromArray(\Aimeos\MShop\Attribute\Item\Iface $item, array $data) |
|
291 | 291 | { |
292 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute/property' ); |
|
292 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute/property'); |
|
293 | 293 | |
294 | - $propItems = $item->getPropertyItems( null, false ); |
|
294 | + $propItems = $item->getPropertyItems(null, false); |
|
295 | 295 | |
296 | - foreach( $data as $entry ) |
|
296 | + foreach ($data as $entry) |
|
297 | 297 | { |
298 | - if( isset( $propItems[$entry['attribute.property.id']] ) ) |
|
298 | + if (isset($propItems[$entry['attribute.property.id']])) |
|
299 | 299 | { |
300 | 300 | $propItem = $propItems[$entry['attribute.property.id']]; |
301 | - unset( $propItems[$entry['attribute.property.id']] ); |
|
301 | + unset($propItems[$entry['attribute.property.id']]); |
|
302 | 302 | } |
303 | 303 | else |
304 | 304 | { |
305 | 305 | $propItem = $manager->createItem(); |
306 | 306 | } |
307 | 307 | |
308 | - $propItem->fromArray( $entry ); |
|
309 | - $item->addPropertyItem( $propItem ); |
|
308 | + $propItem->fromArray($entry); |
|
309 | + $item->addPropertyItem($propItem); |
|
310 | 310 | } |
311 | 311 | |
312 | - $item->deletePropertyItems( $propItems ); |
|
312 | + $item->deletePropertyItems($propItems); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | |
@@ -320,16 +320,16 @@ discard block |
||
320 | 320 | * @param boolean $copy True if items should be copied, false if not |
321 | 321 | * @return string[] Multi-dimensional associative list of item data |
322 | 322 | */ |
323 | - protected function toArray( \Aimeos\MShop\Attribute\Item\Iface $item, $copy = false ) |
|
323 | + protected function toArray(\Aimeos\MShop\Attribute\Item\Iface $item, $copy = false) |
|
324 | 324 | { |
325 | 325 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
326 | 326 | $data = []; |
327 | 327 | |
328 | - foreach( $item->getPropertyItems( null, false ) as $item ) |
|
328 | + foreach ($item->getPropertyItems(null, false) as $item) |
|
329 | 329 | { |
330 | - $list = $item->toArray( true ); |
|
330 | + $list = $item->toArray(true); |
|
331 | 331 | |
332 | - if( $copy === true ) |
|
332 | + if ($copy === true) |
|
333 | 333 | { |
334 | 334 | $list['attribute.property.siteid'] = $siteId; |
335 | 335 | $list['attribute.property.id'] = ''; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
349 | 349 | * @return string HTML output |
350 | 350 | */ |
351 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
351 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
352 | 352 | { |
353 | 353 | /** admin/jqadm/attribute/property/template-item |
354 | 354 | * Relative path to the HTML body template of the property subpart for attributes. |
@@ -372,6 +372,6 @@ discard block |
||
372 | 372 | $tplconf = 'admin/jqadm/attribute/property/template-item'; |
373 | 373 | $default = 'attribute/item-property-standard'; |
374 | 374 | |
375 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
375 | + return $view->render($view->config($tplconf, $default)); |
|
376 | 376 | } |
377 | 377 | } |
@@ -305,8 +305,7 @@ |
||
305 | 305 | { |
306 | 306 | $propItem = $propItems[$entry['product.property.id']]; |
307 | 307 | unset( $propItems[$entry['product.property.id']] ); |
308 | - } |
|
309 | - else |
|
308 | + } else |
|
310 | 309 | { |
311 | 310 | $propItem = $manager->createItem(); |
312 | 311 | } |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->propertyData = $this->toArray( $view->item, true ); |
|
45 | + $view->propertyData = $this->toArray($view->item, true); |
|
46 | 46 | $view->propertyTypes = $this->getPropertyTypes(); |
47 | 47 | $view->propertyBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $client ) { |
|
49 | + foreach ($this->getSubClients() as $client) { |
|
50 | 50 | $view->propertyBody .= $client->copy(); |
51 | 51 | } |
52 | 52 | |
53 | - return $this->render( $view ); |
|
53 | + return $this->render($view); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | { |
64 | 64 | $view = $this->getView(); |
65 | 65 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
66 | - $data = $view->param( 'characteristic/property', [] ); |
|
66 | + $data = $view->param('characteristic/property', []); |
|
67 | 67 | |
68 | - foreach( $data as $idx => $entry ) { |
|
68 | + foreach ($data as $idx => $entry) { |
|
69 | 69 | $data[$idx]['product.lists.siteid'] = $siteid; |
70 | 70 | } |
71 | 71 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | $view->propertyData = $data; |
74 | 74 | $view->propertyBody = ''; |
75 | 75 | |
76 | - foreach( $this->getSubClients() as $client ) { |
|
76 | + foreach ($this->getSubClients() as $client) { |
|
77 | 77 | $view->propertyBody .= $client->create(); |
78 | 78 | } |
79 | 79 | |
80 | - return $this->render( $view ); |
|
80 | + return $this->render($view); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -90,15 +90,15 @@ discard block |
||
90 | 90 | { |
91 | 91 | $view = $this->getView(); |
92 | 92 | |
93 | - $view->propertyData = $this->toArray( $view->item ); |
|
93 | + $view->propertyData = $this->toArray($view->item); |
|
94 | 94 | $view->propertyTypes = $this->getPropertyTypes(); |
95 | 95 | $view->propertyBody = ''; |
96 | 96 | |
97 | - foreach( $this->getSubClients() as $client ) { |
|
97 | + foreach ($this->getSubClients() as $client) { |
|
98 | 98 | $view->propertyBody .= $client->get(); |
99 | 99 | } |
100 | 100 | |
101 | - return $this->render( $view ); |
|
101 | + return $this->render($view); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | { |
110 | 110 | $view = $this->getView(); |
111 | 111 | |
112 | - $this->fromArray( $view->item, $view->param( 'characteristic/property', [] ) ); |
|
112 | + $this->fromArray($view->item, $view->param('characteristic/property', [])); |
|
113 | 113 | $view->propertyBody = ''; |
114 | 114 | |
115 | - foreach( $this->getSubClients() as $client ) { |
|
115 | + foreach ($this->getSubClients() as $client) { |
|
116 | 116 | $view->propertyBody .= $client->save(); |
117 | 117 | } |
118 | 118 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @param string|null $name Name of the sub-client (Default if null) |
126 | 126 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
127 | 127 | */ |
128 | - public function getSubClient( $type, $name = null ) |
|
128 | + public function getSubClient($type, $name = null) |
|
129 | 129 | { |
130 | 130 | /** admin/jqadm/product/characteristic/property/decorators/excludes |
131 | 131 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * @see admin/jqadm/product/characteristic/property/decorators/excludes |
201 | 201 | * @see admin/jqadm/product/characteristic/property/decorators/global |
202 | 202 | */ |
203 | - return $this->createSubClient( 'product/characteristic/property/' . $type, $name ); |
|
203 | + return $this->createSubClient('product/characteristic/property/' . $type, $name); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -210,14 +210,14 @@ discard block |
||
210 | 210 | * @param \Aimeos\MShop\Common\Item\Property\Iface[] $propItems List of property items |
211 | 211 | * @return \Aimeos\MShop\Common\Item\Property\Iface[] Filtered list of property items |
212 | 212 | */ |
213 | - protected function excludeItems( array $propItems ) |
|
213 | + protected function excludeItems(array $propItems) |
|
214 | 214 | { |
215 | - $excludes = array( 'package-length', 'package-height', 'package-width', 'package-weight' ); |
|
215 | + $excludes = array('package-length', 'package-height', 'package-width', 'package-weight'); |
|
216 | 216 | |
217 | - foreach( $propItems as $key => $propItem ) |
|
217 | + foreach ($propItems as $key => $propItem) |
|
218 | 218 | { |
219 | - if( in_array( $propItem->getType(), $excludes ) ) { |
|
220 | - unset( $propItems[$key] ); |
|
219 | + if (in_array($propItem->getType(), $excludes)) { |
|
220 | + unset($propItems[$key]); |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @since 2016.01 |
266 | 266 | * @category Developer |
267 | 267 | */ |
268 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/characteristic/property/standard/subparts', [] ); |
|
268 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/characteristic/property/standard/subparts', []); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
@@ -276,14 +276,14 @@ discard block |
||
276 | 276 | */ |
277 | 277 | protected function getPropertyTypes() |
278 | 278 | { |
279 | - $excludes = array( 'package-length', 'package-height', 'package-width', 'package-weight' ); |
|
280 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/property/type' ); |
|
279 | + $excludes = array('package-length', 'package-height', 'package-width', 'package-weight'); |
|
280 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/property/type'); |
|
281 | 281 | |
282 | 282 | $search = $manager->createSearch(); |
283 | - $search->setConditions( $search->compare( '!=', 'product.property.type.code', $excludes ) ); |
|
284 | - $search->setSlice( 0, 0x7fffffff ); |
|
283 | + $search->setConditions($search->compare('!=', 'product.property.type.code', $excludes)); |
|
284 | + $search->setSlice(0, 0x7fffffff); |
|
285 | 285 | |
286 | - return $manager->searchItems( $search ); |
|
286 | + return $manager->searchItems($search); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -293,28 +293,28 @@ discard block |
||
293 | 293 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
294 | 294 | * @param string[] $data Data array |
295 | 295 | */ |
296 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
296 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
297 | 297 | { |
298 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/property' ); |
|
299 | - $propItems = $this->excludeItems( $item->getPropertyItems( null, false ) ); |
|
298 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/property'); |
|
299 | + $propItems = $this->excludeItems($item->getPropertyItems(null, false)); |
|
300 | 300 | |
301 | - foreach( $data as $entry ) |
|
301 | + foreach ($data as $entry) |
|
302 | 302 | { |
303 | - if( isset( $propItems[$entry['product.property.id']] ) ) |
|
303 | + if (isset($propItems[$entry['product.property.id']])) |
|
304 | 304 | { |
305 | 305 | $propItem = $propItems[$entry['product.property.id']]; |
306 | - unset( $propItems[$entry['product.property.id']] ); |
|
306 | + unset($propItems[$entry['product.property.id']]); |
|
307 | 307 | } |
308 | 308 | else |
309 | 309 | { |
310 | 310 | $propItem = $manager->createItem(); |
311 | 311 | } |
312 | 312 | |
313 | - $propItem->fromArray( $entry ); |
|
314 | - $item->addPropertyItem( $propItem ); |
|
313 | + $propItem->fromArray($entry); |
|
314 | + $item->addPropertyItem($propItem); |
|
315 | 315 | } |
316 | 316 | |
317 | - $item->deletePropertyItems( $propItems ); |
|
317 | + $item->deletePropertyItems($propItems); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | |
@@ -325,16 +325,16 @@ discard block |
||
325 | 325 | * @param boolean $copy True if items should be copied, false if not |
326 | 326 | * @return string[] Multi-dimensional associative list of item data |
327 | 327 | */ |
328 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
328 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
329 | 329 | { |
330 | 330 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
331 | 331 | $data = []; |
332 | 332 | |
333 | - foreach( $this->excludeItems( $item->getPropertyItems( null, false ) ) as $item ) |
|
333 | + foreach ($this->excludeItems($item->getPropertyItems(null, false)) as $item) |
|
334 | 334 | { |
335 | - $list = $item->toArray( true ); |
|
335 | + $list = $item->toArray(true); |
|
336 | 336 | |
337 | - if( $copy === true ) |
|
337 | + if ($copy === true) |
|
338 | 338 | { |
339 | 339 | $list['product.property.siteid'] = $siteId; |
340 | 340 | $list['product.property.id'] = ''; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
354 | 354 | * @return string HTML output |
355 | 355 | */ |
356 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
356 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
357 | 357 | { |
358 | 358 | /** admin/jqadm/product/characteristic/property/template-item |
359 | 359 | * Relative path to the HTML body template of the property characteristic subpart for products. |
@@ -377,6 +377,6 @@ discard block |
||
377 | 377 | $tplconf = 'admin/jqadm/product/characteristic/property/template-item'; |
378 | 378 | $default = 'product/item-characteristic-property-standard'; |
379 | 379 | |
380 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
380 | + return $view->render($view->config($tplconf, $default)); |
|
381 | 381 | } |
382 | 382 | } |
@@ -121,14 +121,12 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | - } |
|
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
124 | + } catch( \Aimeos\MShop\Exception $e ) |
|
126 | 125 | { |
127 | 126 | $error = array( 'customer-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
128 | 127 | $view->errors = $view->get( 'errors', [] ) + $error; |
129 | 128 | $this->logException( $e ); |
130 | - } |
|
131 | - catch( \Exception $e ) |
|
129 | + } catch( \Exception $e ) |
|
132 | 130 | { |
133 | 131 | $error = array( 'customer-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
134 | 132 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -299,8 +297,7 @@ discard block |
||
299 | 297 | { |
300 | 298 | $propItem = $propItems[$entry['customer.property.id']]; |
301 | 299 | unset( $propItems[$entry['customer.property.id']] ); |
302 | - } |
|
303 | - else |
|
300 | + } else |
|
304 | 301 | { |
305 | 302 | $propItem = $manager->createItem(); |
306 | 303 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->propertyData = $this->toArray( $view->item, true ); |
|
47 | + $view->propertyData = $this->toArray($view->item, true); |
|
48 | 48 | $view->propertyTypes = $this->getPropertyTypes(); |
49 | 49 | $view->propertyBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $client ) { |
|
51 | + foreach ($this->getSubClients() as $client) { |
|
52 | 52 | $view->propertyBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | |
55 | - return $this->render( $view ); |
|
55 | + return $this->render($view); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | { |
66 | 66 | $view = $this->getView(); |
67 | 67 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
68 | - $data = $view->param( 'property', [] ); |
|
68 | + $data = $view->param('property', []); |
|
69 | 69 | |
70 | - foreach( $data as $idx => $entry ) { |
|
70 | + foreach ($data as $idx => $entry) { |
|
71 | 71 | $data[$idx]['customer.lists.siteid'] = $siteid; |
72 | 72 | } |
73 | 73 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->propertyData = $data; |
76 | 76 | $view->propertyBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->propertyBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -92,15 +92,15 @@ discard block |
||
92 | 92 | { |
93 | 93 | $view = $this->getView(); |
94 | 94 | |
95 | - $view->propertyData = $this->toArray( $view->item ); |
|
95 | + $view->propertyData = $this->toArray($view->item); |
|
96 | 96 | $view->propertyTypes = $this->getPropertyTypes(); |
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -113,26 +113,26 @@ discard block |
||
113 | 113 | |
114 | 114 | try |
115 | 115 | { |
116 | - $this->fromArray( $view->item, $view->param( 'property', [] ) ); |
|
116 | + $this->fromArray($view->item, $view->param('property', [])); |
|
117 | 117 | $view->propertyBody = ''; |
118 | 118 | |
119 | - foreach( $this->getSubClients() as $client ) { |
|
119 | + foreach ($this->getSubClients() as $client) { |
|
120 | 120 | $view->propertyBody .= $client->save(); |
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | 124 | } |
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
125 | + catch (\Aimeos\MShop\Exception $e) |
|
126 | 126 | { |
127 | - $error = array( 'customer-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
128 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
129 | - $this->logException( $e ); |
|
127 | + $error = array('customer-item-property' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
128 | + $view->errors = $view->get('errors', []) + $error; |
|
129 | + $this->logException($e); |
|
130 | 130 | } |
131 | - catch( \Exception $e ) |
|
131 | + catch (\Exception $e) |
|
132 | 132 | { |
133 | - $error = array( 'customer-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
134 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
135 | - $this->logException( $e ); |
|
133 | + $error = array('customer-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
134 | + $view->errors = $view->get('errors', []) + $error; |
|
135 | + $this->logException($e); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param string|null $name Name of the sub-client (Default if null) |
147 | 147 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
148 | 148 | */ |
149 | - public function getSubClient( $type, $name = null ) |
|
149 | + public function getSubClient($type, $name = null) |
|
150 | 150 | { |
151 | 151 | /** admin/jqadm/customer/property/decorators/excludes |
152 | 152 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @see admin/jqadm/customer/property/decorators/excludes |
222 | 222 | * @see admin/jqadm/customer/property/decorators/global |
223 | 223 | */ |
224 | - return $this->createSubClient( 'customer/property/' . $type, $name ); |
|
224 | + return $this->createSubClient('customer/property/' . $type, $name); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @since 2018.07 |
266 | 266 | * @category Developer |
267 | 267 | */ |
268 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/property/standard/subparts', [] ); |
|
268 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/property/standard/subparts', []); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | */ |
277 | 277 | protected function getPropertyTypes() |
278 | 278 | { |
279 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/property/type' ); |
|
280 | - return $manager->searchItems( $manager->createSearch()->setSlice( 0, 0x7fffffff ) ); |
|
279 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/property/type'); |
|
280 | + return $manager->searchItems($manager->createSearch()->setSlice(0, 0x7fffffff)); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | |
@@ -287,29 +287,29 @@ discard block |
||
287 | 287 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object without referenced domain items |
288 | 288 | * @param string[] $data Data array |
289 | 289 | */ |
290 | - protected function fromArray( \Aimeos\MShop\Customer\Item\Iface $item, array $data ) |
|
290 | + protected function fromArray(\Aimeos\MShop\Customer\Item\Iface $item, array $data) |
|
291 | 291 | { |
292 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/property' ); |
|
292 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/property'); |
|
293 | 293 | |
294 | - $propItems = $item->getPropertyItems( null, false ); |
|
294 | + $propItems = $item->getPropertyItems(null, false); |
|
295 | 295 | |
296 | - foreach( $data as $entry ) |
|
296 | + foreach ($data as $entry) |
|
297 | 297 | { |
298 | - if( isset( $propItems[$entry['customer.property.id']] ) ) |
|
298 | + if (isset($propItems[$entry['customer.property.id']])) |
|
299 | 299 | { |
300 | 300 | $propItem = $propItems[$entry['customer.property.id']]; |
301 | - unset( $propItems[$entry['customer.property.id']] ); |
|
301 | + unset($propItems[$entry['customer.property.id']]); |
|
302 | 302 | } |
303 | 303 | else |
304 | 304 | { |
305 | 305 | $propItem = $manager->createItem(); |
306 | 306 | } |
307 | 307 | |
308 | - $propItem->fromArray( $entry ); |
|
309 | - $item->addPropertyItem( $propItem ); |
|
308 | + $propItem->fromArray($entry); |
|
309 | + $item->addPropertyItem($propItem); |
|
310 | 310 | } |
311 | 311 | |
312 | - $item->deletePropertyItems( $propItems ); |
|
312 | + $item->deletePropertyItems($propItems); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | |
@@ -320,16 +320,16 @@ discard block |
||
320 | 320 | * @param boolean $copy True if items should be copied, false if not |
321 | 321 | * @return string[] Multi-dimensional associative list of item data |
322 | 322 | */ |
323 | - protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false ) |
|
323 | + protected function toArray(\Aimeos\MShop\Customer\Item\Iface $item, $copy = false) |
|
324 | 324 | { |
325 | 325 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
326 | 326 | $data = []; |
327 | 327 | |
328 | - foreach( $item->getPropertyItems( null, false ) as $item ) |
|
328 | + foreach ($item->getPropertyItems(null, false) as $item) |
|
329 | 329 | { |
330 | - $list = $item->toArray( true ); |
|
330 | + $list = $item->toArray(true); |
|
331 | 331 | |
332 | - if( $copy === true ) |
|
332 | + if ($copy === true) |
|
333 | 333 | { |
334 | 334 | $list['customer.property.siteid'] = $siteId; |
335 | 335 | $list['customer.property.id'] = ''; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
349 | 349 | * @return string HTML output |
350 | 350 | */ |
351 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
351 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
352 | 352 | { |
353 | 353 | /** admin/jqadm/customer/property/template-item |
354 | 354 | * Relative path to the HTML body template of the property subpart for customers. |
@@ -372,6 +372,6 @@ discard block |
||
372 | 372 | $tplconf = 'admin/jqadm/customer/property/template-item'; |
373 | 373 | $default = 'customer/item-property-standard'; |
374 | 374 | |
375 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
375 | + return $view->render($view->config($tplconf, $default)); |
|
376 | 376 | } |
377 | 377 | } |
@@ -81,9 +81,12 @@ |
||
81 | 81 | </select> |
82 | 82 | </div> |
83 | 83 | </div> |
84 | - <?php else : ?> |
|
84 | + <?php else { |
|
85 | + : ?> |
|
85 | 86 | <input class="item-languageid" type="hidden" |
86 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
87 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); |
|
88 | +} |
|
89 | +?>'.replace('idx', idx)" |
|
87 | 90 | value="<?= $enc->attr( key( $languages ) ); ?>" /> |
88 | 91 | <?php endif; ?> |
89 | 92 | <div class="form-group row optional"> |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | ?> |
21 | 21 | <div id="address" class="item-address content-block tab-pane fade" role="tabpanel" aria-labelledby="address"> |
22 | 22 | <div id="item-address-group" role="tablist" aria-multiselectable="true" |
23 | - data-items="<?= $enc->attr( json_encode( $this->get( 'addressData', [] ) ) ); ?>" |
|
24 | - data-keys="<?= $enc->attr( json_encode( $keys ) ) ?>" |
|
23 | + data-items="<?= $enc->attr(json_encode($this->get('addressData', []))); ?>" |
|
24 | + data-keys="<?= $enc->attr(json_encode($keys)) ?>" |
|
25 | 25 | data-siteid="<?= $this->site()->siteid() ?>" > |
26 | 26 | |
27 | 27 | <div v-for="(entry, idx) in items" v-bind:key="idx" class="group-item card"> |
@@ -30,20 +30,20 @@ discard block |
||
30 | 30 | v-bind:data-target="'#item-address-group-data-' + idx" data-toggle="collapse" role="tab" class="card-header header" |
31 | 31 | v-bind:aria-controls="'item-address-group-data-' + idx" aria-expanded="false"> |
32 | 32 | <div class="card-tools-left"> |
33 | - <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
34 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide this entry') ); ?>"> |
|
33 | + <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
34 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide this entry')); ?>"> |
|
35 | 35 | </div> |
36 | 36 | </div> |
37 | 37 | <span class="item-label header-label">{{ getLabel(idx, 'customer.address.') }}</span> |
38 | 38 | |
39 | 39 | <div class="card-tools-right"> |
40 | - <div class="btn btn-card-header act-copy fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
41 | - title="<?= $enc->attr( $this->translate( 'admin', 'Duplicate entry (Ctrl+D)') ); ?>" |
|
40 | + <div class="btn btn-card-header act-copy fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
41 | + title="<?= $enc->attr($this->translate('admin', 'Duplicate entry (Ctrl+D)')); ?>" |
|
42 | 42 | v-on:click.stop="duplicateItem(idx)"> |
43 | 43 | </div> |
44 | 44 | <div v-if="!checkSite('customer.address.siteid', idx)" |
45 | - class="btn btn-card-header act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
46 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
45 | + class="btn btn-card-header act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
46 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
47 | 47 | v-on:click="removeItem(idx)"> |
48 | 48 | </div> |
49 | 49 | </div> |
@@ -53,29 +53,29 @@ discard block |
||
53 | 53 | v-bind:aria-labelledby="'item-address-group-item-' + idx" role="tabpanel" class="card-block collapse row"> |
54 | 54 | |
55 | 55 | <div class="col-xl-6 content-block"> |
56 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Personal data' ) ); ?></h2> |
|
56 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Personal data')); ?></h2> |
|
57 | 57 | |
58 | 58 | <input class="item-id" type="hidden" |
59 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.id' ) ) ); ?>'.replace('idx', idx)" |
|
59 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.id'))); ?>'.replace('idx', idx)" |
|
60 | 60 | v-bind:value="items[idx]['customer.address.id']" /> |
61 | 61 | |
62 | - <?php $languages = $this->get( 'pageLangItems', [] ) ?> |
|
63 | - <?php if( count( $languages ) > 1 ) : ?> |
|
62 | + <?php $languages = $this->get('pageLangItems', []) ?> |
|
63 | + <?php if (count($languages) > 1) : ?> |
|
64 | 64 | <div class="form-group row mandatory"> |
65 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label> |
|
65 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Language')); ?></label> |
|
66 | 66 | <div class="col-sm-8"> |
67 | - <select class="form-control custom-select item-languageid" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
68 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
67 | + <select class="form-control custom-select item-languageid" tabindex="<?= $this->get('tabindex'); ?>" |
|
68 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.languageid'))); ?>'.replace('idx', idx)" |
|
69 | 69 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
70 | 70 | v-model="items[idx]['customer.address.languageid']" > |
71 | 71 | |
72 | 72 | <option value="" disable > |
73 | - <?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?> |
|
73 | + <?= $enc->attr($this->translate('admin', 'Please select')); ?> |
|
74 | 74 | </option> |
75 | 75 | |
76 | - <?php foreach( $languages as $langId => $langItem ) : ?> |
|
77 | - <option value="<?= $enc->attr( $langId ); ?>" v-bind:selected="entry['customer.address.languageid'] == '<?= $enc->attr( $langId ) ?>'" > |
|
78 | - <?= $enc->html( $langItem->getLabel() ); ?> |
|
76 | + <?php foreach ($languages as $langId => $langItem) : ?> |
|
77 | + <option value="<?= $enc->attr($langId); ?>" v-bind:selected="entry['customer.address.languageid'] == '<?= $enc->attr($langId) ?>'" > |
|
78 | + <?= $enc->html($langItem->getLabel()); ?> |
|
79 | 79 | </option> |
80 | 80 | <?php endforeach; ?> |
81 | 81 | </select> |
@@ -83,261 +83,261 @@ discard block |
||
83 | 83 | </div> |
84 | 84 | <?php else : ?> |
85 | 85 | <input class="item-languageid" type="hidden" |
86 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
87 | - value="<?= $enc->attr( key( $languages ) ); ?>" /> |
|
86 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.languageid'))); ?>'.replace('idx', idx)" |
|
87 | + value="<?= $enc->attr(key($languages)); ?>" /> |
|
88 | 88 | <?php endif; ?> |
89 | 89 | <div class="form-group row optional"> |
90 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Salutation' ) ); ?></label> |
|
90 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Salutation')); ?></label> |
|
91 | 91 | <div class="col-sm-8"> |
92 | - <select class="form-control custom-select item-salutation" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
93 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.salutation' ) ) ); ?>'.replace('idx', idx)" |
|
92 | + <select class="form-control custom-select item-salutation" tabindex="<?= $this->get('tabindex'); ?>" |
|
93 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.salutation'))); ?>'.replace('idx', idx)" |
|
94 | 94 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
95 | 95 | v-model="items[idx]['customer.address.salutation']" > |
96 | 96 | <option value="company" v-bind:selected="items[idx]['customer.address.salutation'] == 'company'" > |
97 | - <?= $enc->html( $this->translate( 'mshop/code', 'company' ) ); ?> |
|
97 | + <?= $enc->html($this->translate('mshop/code', 'company')); ?> |
|
98 | 98 | </option> |
99 | 99 | <option value="mr" v-bind:selected="items[idx]['customer.address.salutation'] == 'mr'" > |
100 | - <?= $enc->html( $this->translate( 'mshop/code', 'mr' ) ); ?> |
|
100 | + <?= $enc->html($this->translate('mshop/code', 'mr')); ?> |
|
101 | 101 | </option> |
102 | 102 | <option value="mrs" v-bind:selected="items[idx]['customer.address.salutation'] == 'mrs'" > |
103 | - <?= $enc->html( $this->translate( 'mshop/code', 'mrs' ) ); ?> |
|
103 | + <?= $enc->html($this->translate('mshop/code', 'mrs')); ?> |
|
104 | 104 | </option> |
105 | 105 | <option value="miss" v-bind:selected="items[idx]['customer.address.salutation'] == 'miss'" > |
106 | - <?= $enc->html( $this->translate( 'mshop/code', 'miss' ) ); ?> |
|
106 | + <?= $enc->html($this->translate('mshop/code', 'miss')); ?> |
|
107 | 107 | </option> |
108 | 108 | </select> |
109 | 109 | </div> |
110 | 110 | <div class="col-sm-12 form-text text-muted help-text"> |
111 | - <?= $enc->html( $this->translate( 'admin', 'How the customer is addressed in e-mails' ) ); ?> |
|
111 | + <?= $enc->html($this->translate('admin', 'How the customer is addressed in e-mails')); ?> |
|
112 | 112 | </div> |
113 | 113 | </div> |
114 | 114 | <div class="form-group row optional"> |
115 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Title' ) ); ?></label> |
|
115 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Title')); ?></label> |
|
116 | 116 | <div class="col-sm-8"> |
117 | - <input class="form-control item-title" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
118 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.title' ) ) ); ?>'.replace('idx', idx)" |
|
119 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Honorary title (optional)' ) ); ?>" |
|
117 | + <input class="form-control item-title" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
118 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.title'))); ?>'.replace('idx', idx)" |
|
119 | + placeholder="<?= $enc->attr($this->translate('admin', 'Honorary title (optional)')); ?>" |
|
120 | 120 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
121 | 121 | v-model="items[idx]['customer.address.title']" /> |
122 | 122 | </div> |
123 | 123 | <div class="col-sm-12 form-text text-muted help-text"> |
124 | - <?= $enc->html( $this->translate( 'admin', 'Honorary titles like Dr., Ph.D, etc.' ) ); ?> |
|
124 | + <?= $enc->html($this->translate('admin', 'Honorary titles like Dr., Ph.D, etc.')); ?> |
|
125 | 125 | </div> |
126 | 126 | </div> |
127 | 127 | <div class="form-group row mandatory"> |
128 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Last name' ) ); ?></label> |
|
128 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Last name')); ?></label> |
|
129 | 129 | <div class="col-sm-8"> |
130 | - <input class="form-control item-lastname" type="text" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
131 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.lastname' ) ) ); ?>'.replace('idx', idx)" |
|
132 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Last name (required)' ) ); ?>" |
|
130 | + <input class="form-control item-lastname" type="text" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
131 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.lastname'))); ?>'.replace('idx', idx)" |
|
132 | + placeholder="<?= $enc->attr($this->translate('admin', 'Last name (required)')); ?>" |
|
133 | 133 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
134 | 134 | v-model="items[idx]['customer.address.lastname']" /> |
135 | 135 | </div> |
136 | 136 | <div class="col-sm-12 form-text text-muted help-text"> |
137 | - <?= $enc->html( $this->translate( 'admin', 'Last name of the person or full name in cultures where no first names are used' ) ); ?> |
|
137 | + <?= $enc->html($this->translate('admin', 'Last name of the person or full name in cultures where no first names are used')); ?> |
|
138 | 138 | </div> |
139 | 139 | </div> |
140 | 140 | <div class="form-group row optional"> |
141 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'First name' ) ); ?></label> |
|
141 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'First name')); ?></label> |
|
142 | 142 | <div class="col-sm-8"> |
143 | - <input class="form-control item-firstname" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
144 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.firstname' ) ) ); ?>'.replace('idx', idx)" |
|
145 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'First name (optional)' ) ); ?>" |
|
143 | + <input class="form-control item-firstname" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
144 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.firstname'))); ?>'.replace('idx', idx)" |
|
145 | + placeholder="<?= $enc->attr($this->translate('admin', 'First name (optional)')); ?>" |
|
146 | 146 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
147 | 147 | v-model="items[idx]['customer.address.firstname']" /> |
148 | 148 | </div> |
149 | 149 | <div class="col-sm-12 form-text text-muted help-text"> |
150 | - <?= $enc->html( $this->translate( 'admin', 'First name of the person if used in cultures where they are used' ) ); ?> |
|
150 | + <?= $enc->html($this->translate('admin', 'First name of the person if used in cultures where they are used')); ?> |
|
151 | 151 | </div> |
152 | 152 | </div> |
153 | 153 | </div><!-- |
154 | 154 | |
155 | 155 | --><div class="col-xl-6 content-block"> |
156 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Delivery address' ) ); ?></h2> |
|
156 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Delivery address')); ?></h2> |
|
157 | 157 | <div class="form-group row optional"> |
158 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Street' ) ); ?></label> |
|
158 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Street')); ?></label> |
|
159 | 159 | <div class="col-sm-8"> |
160 | - <input class="form-control item-address1" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
161 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.address1' ) ) ); ?>'.replace('idx', idx)" |
|
162 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Street name (optional)' ) ); ?>" |
|
160 | + <input class="form-control item-address1" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
161 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.address1'))); ?>'.replace('idx', idx)" |
|
162 | + placeholder="<?= $enc->attr($this->translate('admin', 'Street name (optional)')); ?>" |
|
163 | 163 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
164 | 164 | v-model="items[idx]['customer.address.address1']" /> |
165 | 165 | </div> |
166 | 166 | <div class="col-sm-12 form-text text-muted help-text"> |
167 | - <?= $enc->html( $this->translate( 'admin', 'First name of the person if used in cultures where they are used' ) ); ?> |
|
167 | + <?= $enc->html($this->translate('admin', 'First name of the person if used in cultures where they are used')); ?> |
|
168 | 168 | </div> |
169 | 169 | </div> |
170 | 170 | <div class="form-group row optional"> |
171 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'House number' ) ); ?></label> |
|
171 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'House number')); ?></label> |
|
172 | 172 | <div class="col-sm-8"> |
173 | - <input class="form-control item-address2" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
174 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.address2' ) ) ); ?>'.replace('idx', idx)" |
|
175 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'House number (optional)' ) ); ?>" |
|
173 | + <input class="form-control item-address2" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
174 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.address2'))); ?>'.replace('idx', idx)" |
|
175 | + placeholder="<?= $enc->attr($this->translate('admin', 'House number (optional)')); ?>" |
|
176 | 176 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
177 | 177 | v-model="items[idx]['customer.address.address2']" /> |
178 | 178 | </div> |
179 | 179 | <div class="col-sm-12 form-text text-muted help-text"> |
180 | - <?= $enc->html( $this->translate( 'admin', 'Address identifier of the customer\'s house for delivery' ) ); ?> |
|
180 | + <?= $enc->html($this->translate('admin', 'Address identifier of the customer\'s house for delivery')); ?> |
|
181 | 181 | </div> |
182 | 182 | </div> |
183 | 183 | <div class="form-group row optional"> |
184 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Floor / Appartment' ) ); ?></label> |
|
184 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Floor / Appartment')); ?></label> |
|
185 | 185 | <div class="col-sm-8"> |
186 | - <input class="form-control item-address3" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
187 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.address3' ) ) ); ?>'.replace('idx', idx)" |
|
188 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Floor and/or apartment (optional)' ) ); ?>" |
|
186 | + <input class="form-control item-address3" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
187 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.address3'))); ?>'.replace('idx', idx)" |
|
188 | + placeholder="<?= $enc->attr($this->translate('admin', 'Floor and/or apartment (optional)')); ?>" |
|
189 | 189 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
190 | 190 | v-model="items[idx]['customer.address.address3']" /> |
191 | 191 | </div> |
192 | 192 | <div class="col-sm-12 form-text text-muted help-text"> |
193 | - <?= $enc->html( $this->translate( 'admin', 'Additional information where the customer\'s apartment can be found' ) ); ?> |
|
193 | + <?= $enc->html($this->translate('admin', 'Additional information where the customer\'s apartment can be found')); ?> |
|
194 | 194 | </div> |
195 | 195 | </div> |
196 | 196 | <div class="form-group row optional"> |
197 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Zip code' ) ); ?></label> |
|
197 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Zip code')); ?></label> |
|
198 | 198 | <div class="col-sm-8"> |
199 | - <input class="form-control item-postal" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
200 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.postal' ) ) ); ?>'.replace('idx', idx)" |
|
201 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Zip code (optional)' ) ); ?>" |
|
199 | + <input class="form-control item-postal" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
200 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.postal'))); ?>'.replace('idx', idx)" |
|
201 | + placeholder="<?= $enc->attr($this->translate('admin', 'Zip code (optional)')); ?>" |
|
202 | 202 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
203 | 203 | v-model="items[idx]['customer.address.postal']" /> |
204 | 204 | </div> |
205 | 205 | <div class="col-sm-12 form-text text-muted help-text"> |
206 | - <?= $enc->html( $this->translate( 'admin', 'Postal code for delivery if used in the area the customer is living' ) ); ?> |
|
206 | + <?= $enc->html($this->translate('admin', 'Postal code for delivery if used in the area the customer is living')); ?> |
|
207 | 207 | </div> |
208 | 208 | </div> |
209 | 209 | <div class="form-group row mandatory"> |
210 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'City' ) ); ?></label> |
|
210 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'City')); ?></label> |
|
211 | 211 | <div class="col-sm-8"> |
212 | - <input class="form-control item-city" type="text" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
213 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.city' ) ) ); ?>'.replace('idx', idx)" |
|
214 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'City or town name (required)' ) ); ?>" |
|
212 | + <input class="form-control item-city" type="text" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
213 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.city'))); ?>'.replace('idx', idx)" |
|
214 | + placeholder="<?= $enc->attr($this->translate('admin', 'City or town name (required)')); ?>" |
|
215 | 215 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
216 | 216 | v-model="items[idx]['customer.address.city']" /> |
217 | 217 | </div> |
218 | 218 | </div> |
219 | 219 | <div class="form-group row mandatory"> |
220 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Country' ) ); ?></label> |
|
220 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Country')); ?></label> |
|
221 | 221 | <div class="col-sm-8"> |
222 | 222 | <select is="combo-box" class="form-control c-select item-countryid" required="required" |
223 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.countryid' ) ) ); ?>'.replace('idx', idx)" |
|
223 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.countryid'))); ?>'.replace('idx', idx)" |
|
224 | 224 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
225 | - v-bind:tabindex="'<?= $this->get( 'tabindex' ); ?>'" |
|
225 | + v-bind:tabindex="'<?= $this->get('tabindex'); ?>'" |
|
226 | 226 | v-bind:getfcn="getCountries" |
227 | 227 | v-model="items[idx]['customer.address.countryid']" > |
228 | 228 | <option value=""></option> |
229 | 229 | </select> |
230 | 230 | </div> |
231 | 231 | <div class="col-sm-12 form-text text-muted help-text"> |
232 | - <?= $enc->html( $this->translate( 'admin', 'Two letter ISO country code' ) ); ?> |
|
232 | + <?= $enc->html($this->translate('admin', 'Two letter ISO country code')); ?> |
|
233 | 233 | </div> |
234 | 234 | </div> |
235 | 235 | <div class="form-group row optional"> |
236 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'State' ) ); ?></label> |
|
236 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'State')); ?></label> |
|
237 | 237 | <div class="col-sm-8"> |
238 | - <input class="form-control item-state" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
239 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.state' ) ) ); ?>'.replace('idx', idx)" |
|
240 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Country state code (optional)' ) ); ?>" |
|
238 | + <input class="form-control item-state" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
239 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.state'))); ?>'.replace('idx', idx)" |
|
240 | + placeholder="<?= $enc->attr($this->translate('admin', 'Country state code (optional)')); ?>" |
|
241 | 241 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
242 | 242 | v-model="items[idx]['customer.address.state']" /> |
243 | 243 | </div> |
244 | 244 | <div class="col-sm-12 form-text text-muted help-text"> |
245 | - <?= $enc->html( $this->translate( 'admin', 'Short state code (e.g. NY) if used in the country the customer is living' ) ); ?> |
|
245 | + <?= $enc->html($this->translate('admin', 'Short state code (e.g. NY) if used in the country the customer is living')); ?> |
|
246 | 246 | </div> |
247 | 247 | </div> |
248 | 248 | </div><!-- |
249 | 249 | |
250 | 250 | --><div class="col-xl-6 content-block"> |
251 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Communication' ) ); ?></h2> |
|
251 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Communication')); ?></h2> |
|
252 | 252 | <div class="form-group row optional"> |
253 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Telephone' ) ); ?></label> |
|
253 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Telephone')); ?></label> |
|
254 | 254 | <div class="col-sm-8"> |
255 | - <input class="form-control item-telephone" type="tel" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
256 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.telephone' ) ) ); ?>'.replace('idx', idx)" |
|
257 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Telephone number (optional)' ) ); ?>" |
|
255 | + <input class="form-control item-telephone" type="tel" tabindex="<?= $this->get('tabindex'); ?>" |
|
256 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.telephone'))); ?>'.replace('idx', idx)" |
|
257 | + placeholder="<?= $enc->attr($this->translate('admin', 'Telephone number (optional)')); ?>" |
|
258 | 258 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
259 | 259 | v-model="items[idx]['customer.address.telephone']" /> |
260 | 260 | </div> |
261 | 261 | <div class="col-sm-12 form-text text-muted help-text"> |
262 | - <?= $enc->html( $this->translate( 'admin', '(International) telephone number without separation characters, can start with a "+"' ) ); ?> |
|
262 | + <?= $enc->html($this->translate('admin', '(International) telephone number without separation characters, can start with a "+"')); ?> |
|
263 | 263 | </div> |
264 | 264 | </div> |
265 | 265 | <div class="form-group row optional"> |
266 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Facsimile' ) ); ?></label> |
|
266 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Facsimile')); ?></label> |
|
267 | 267 | <div class="col-sm-8"> |
268 | - <input class="form-control item-telefax" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
269 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.telefax' ) ) ); ?>'.replace('idx', idx)" |
|
270 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Facsimile number (optional)' ) ); ?>" |
|
268 | + <input class="form-control item-telefax" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
269 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.telefax'))); ?>'.replace('idx', idx)" |
|
270 | + placeholder="<?= $enc->attr($this->translate('admin', 'Facsimile number (optional)')); ?>" |
|
271 | 271 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
272 | 272 | v-model="items[idx]['customer.address.telefax']" /> |
273 | 273 | </div> |
274 | 274 | <div class="col-sm-12 form-text text-muted help-text"> |
275 | - <?= $enc->html( $this->translate( 'admin', '(International) facsimilie number without separation characters, can start with a "+"' ) ); ?> |
|
275 | + <?= $enc->html($this->translate('admin', '(International) facsimilie number without separation characters, can start with a "+"')); ?> |
|
276 | 276 | </div> |
277 | 277 | </div> |
278 | 278 | <div class="form-group row optional"> |
279 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'E-mail' ) ); ?></label> |
|
279 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'E-mail')); ?></label> |
|
280 | 280 | <div class="col-sm-8"> |
281 | - <input class="form-control item-email" type="email" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
282 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.email' ) ) ); ?>'.replace('idx', idx)" |
|
283 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'E-mail address (optional)' ) ); ?>" |
|
281 | + <input class="form-control item-email" type="email" tabindex="<?= $this->get('tabindex'); ?>" |
|
282 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.email'))); ?>'.replace('idx', idx)" |
|
283 | + placeholder="<?= $enc->attr($this->translate('admin', 'E-mail address (optional)')); ?>" |
|
284 | 284 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
285 | 285 | v-model="items[idx]['customer.address.email']" /> |
286 | 286 | </div> |
287 | 287 | <div class="col-sm-12 form-text text-muted help-text"> |
288 | - <?= $enc->html( $this->translate( 'admin', 'E-mail address that belongs to the address' ) ); ?> |
|
288 | + <?= $enc->html($this->translate('admin', 'E-mail address that belongs to the address')); ?> |
|
289 | 289 | </div> |
290 | 290 | </div> |
291 | 291 | <div class="form-group row optional"> |
292 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Web site' ) ); ?></label> |
|
292 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Web site')); ?></label> |
|
293 | 293 | <div class="col-sm-8"> |
294 | - <input class="form-control item-website" type="url" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
295 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.website' ) ) ); ?>'.replace('idx', idx)" |
|
296 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Web site URL (optional)' ) ); ?>" |
|
294 | + <input class="form-control item-website" type="url" tabindex="<?= $this->get('tabindex'); ?>" |
|
295 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.website'))); ?>'.replace('idx', idx)" |
|
296 | + placeholder="<?= $enc->attr($this->translate('admin', 'Web site URL (optional)')); ?>" |
|
297 | 297 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
298 | 298 | v-model="items[idx]['customer.address.website']" /> |
299 | 299 | </div> |
300 | 300 | <div class="col-sm-12 form-text text-muted help-text"> |
301 | - <?= $enc->html( $this->translate( 'admin', 'URL of the customer web site' ) ); ?> |
|
301 | + <?= $enc->html($this->translate('admin', 'URL of the customer web site')); ?> |
|
302 | 302 | </div> |
303 | 303 | </div> |
304 | 304 | </div><!-- |
305 | 305 | |
306 | 306 | --><div class="col-xl-6 content-block"> |
307 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Company details' ) ); ?></h2> |
|
307 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Company details')); ?></h2> |
|
308 | 308 | <div class="form-group row optional"> |
309 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Company' ) ); ?></label> |
|
309 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Company')); ?></label> |
|
310 | 310 | <div class="col-sm-8"> |
311 | - <input class="form-control item-company" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
312 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.company' ) ) ); ?>'.replace('idx', idx)" |
|
313 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Company name (optional)' ) ); ?>" |
|
311 | + <input class="form-control item-company" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
312 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.company'))); ?>'.replace('idx', idx)" |
|
313 | + placeholder="<?= $enc->attr($this->translate('admin', 'Company name (optional)')); ?>" |
|
314 | 314 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
315 | 315 | v-model="items[idx]['customer.address.company']" /> |
316 | 316 | </div> |
317 | 317 | </div> |
318 | 318 | <div class="form-group row optional"> |
319 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'VAT ID' ) ); ?></label> |
|
319 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'VAT ID')); ?></label> |
|
320 | 320 | <div class="col-sm-8"> |
321 | - <input class="form-control item-vatid" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
322 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.vatid' ) ) ); ?>'.replace('idx', idx)" |
|
323 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Value added tax identifier (optional)' ) ); ?>" |
|
321 | + <input class="form-control item-vatid" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
322 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.vatid'))); ?>'.replace('idx', idx)" |
|
323 | + placeholder="<?= $enc->attr($this->translate('admin', 'Value added tax identifier (optional)')); ?>" |
|
324 | 324 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
325 | 325 | v-model="items[idx]['customer.address.vatid']" /> |
326 | 326 | </div> |
327 | 327 | <div class="col-sm-12 form-text text-muted help-text"> |
328 | - <?= $enc->html( $this->translate( 'admin', 'Official VAT ID to determine if the tax needs to be billed in invoices' ) ); ?> |
|
328 | + <?= $enc->html($this->translate('admin', 'Official VAT ID to determine if the tax needs to be billed in invoices')); ?> |
|
329 | 329 | </div> |
330 | 330 | </div> |
331 | 331 | </div> |
332 | 332 | |
333 | - <?= $this->get( 'addressBody' ); ?> |
|
333 | + <?= $this->get('addressBody'); ?> |
|
334 | 334 | |
335 | 335 | </div> |
336 | 336 | </div> |
337 | 337 | |
338 | 338 | <div class="card-tools-more"> |
339 | - <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
340 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
339 | + <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
340 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
341 | 341 | v-on:click="addItem('customer.address.')" > |
342 | 342 | </div> |
343 | 343 | </div> |
@@ -118,14 +118,12 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | return; |
121 | - } |
|
122 | - catch( \Aimeos\MShop\Exception $e ) |
|
121 | + } catch( \Aimeos\MShop\Exception $e ) |
|
123 | 122 | { |
124 | 123 | $error = array( 'customer-item-address' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
125 | 124 | $view->errors = $view->get( 'errors', [] ) + $error; |
126 | 125 | $this->logException( $e ); |
127 | - } |
|
128 | - catch( \Exception $e ) |
|
126 | + } catch( \Exception $e ) |
|
129 | 127 | { |
130 | 128 | $error = array( 'customer-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
131 | 129 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -284,8 +282,7 @@ discard block |
||
284 | 282 | { |
285 | 283 | $addrItem = $addrItems[$entry['customer.address.id']]; |
286 | 284 | unset( $addrItems[$entry['customer.address.id']] ); |
287 | - } |
|
288 | - else |
|
285 | + } else |
|
289 | 286 | { |
290 | 287 | $addrItem = $manager->createItem(); |
291 | 288 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer\Address; |
12 | 12 | |
13 | -sprintf( 'address' ); // for translation |
|
13 | +sprintf('address'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->addressData = $this->toArray( $view->item, true ); |
|
47 | + $view->addressData = $this->toArray($view->item, true); |
|
48 | 48 | $view->addressBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->addressBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | $view = $this->getView(); |
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'address', [] ); |
|
67 | + $data = $view->param('address', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) { |
|
69 | + foreach ($data as $idx => $entry) { |
|
70 | 70 | $data[$idx]['customer.address.siteid'] = $siteid; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $view->addressData = $data; |
74 | 74 | $view->addressBody = ''; |
75 | 75 | |
76 | - foreach( $this->getSubClients() as $client ) { |
|
76 | + foreach ($this->getSubClients() as $client) { |
|
77 | 77 | $view->addressBody .= $client->create(); |
78 | 78 | } |
79 | 79 | |
80 | - return $this->render( $view ); |
|
80 | + return $this->render($view); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | { |
91 | 91 | $view = $this->getView(); |
92 | 92 | |
93 | - $view->addressData = $this->toArray( $view->item ); |
|
93 | + $view->addressData = $this->toArray($view->item); |
|
94 | 94 | $view->addressBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $client ) { |
|
96 | + foreach ($this->getSubClients() as $client) { |
|
97 | 97 | $view->addressBody .= $client->get(); |
98 | 98 | } |
99 | 99 | |
100 | - return $this->render( $view ); |
|
100 | + return $this->render($view); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -110,26 +110,26 @@ discard block |
||
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->fromArray( $view->item, $view->param( 'address', [] ) ); |
|
113 | + $this->fromArray($view->item, $view->param('address', [])); |
|
114 | 114 | $view->addressBody = ''; |
115 | 115 | |
116 | - foreach( $this->getSubClients() as $client ) { |
|
116 | + foreach ($this->getSubClients() as $client) { |
|
117 | 117 | $view->addressBody .= $client->save(); |
118 | 118 | } |
119 | 119 | |
120 | 120 | return; |
121 | 121 | } |
122 | - catch( \Aimeos\MShop\Exception $e ) |
|
122 | + catch (\Aimeos\MShop\Exception $e) |
|
123 | 123 | { |
124 | - $error = array( 'customer-item-address' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
125 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
126 | - $this->logException( $e ); |
|
124 | + $error = array('customer-item-address' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
125 | + $view->errors = $view->get('errors', []) + $error; |
|
126 | + $this->logException($e); |
|
127 | 127 | } |
128 | - catch( \Exception $e ) |
|
128 | + catch (\Exception $e) |
|
129 | 129 | { |
130 | - $error = array( 'customer-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
131 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
132 | - $this->logException( $e ); |
|
130 | + $error = array('customer-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
131 | + $view->errors = $view->get('errors', []) + $error; |
|
132 | + $this->logException($e); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param string|null $name Name of the sub-client (Default if null) |
144 | 144 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
145 | 145 | */ |
146 | - public function getSubClient( $type, $name = null ) |
|
146 | + public function getSubClient($type, $name = null) |
|
147 | 147 | { |
148 | 148 | /** admin/jqadm/customer/address/decorators/excludes |
149 | 149 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @see admin/jqadm/customer/address/decorators/excludes |
219 | 219 | * @see admin/jqadm/customer/address/decorators/global |
220 | 220 | */ |
221 | - return $this->createSubClient( 'customer/address/' . $type, $name ); |
|
221 | + return $this->createSubClient('customer/address/' . $type, $name); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @since 2016.01 |
263 | 263 | * @category Developer |
264 | 264 | */ |
265 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/address/standard/subparts', [] ); |
|
265 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/address/standard/subparts', []); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | |
@@ -272,29 +272,29 @@ discard block |
||
272 | 272 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object without referenced domain items |
273 | 273 | * @param string[] $data Data array |
274 | 274 | */ |
275 | - protected function fromArray( \Aimeos\MShop\Customer\Item\Iface $item, array $data ) |
|
275 | + protected function fromArray(\Aimeos\MShop\Customer\Item\Iface $item, array $data) |
|
276 | 276 | { |
277 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' ); |
|
277 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address'); |
|
278 | 278 | |
279 | 279 | $addrItems = $item->getAddressItems(); |
280 | 280 | |
281 | - foreach( $data as $entry ) |
|
281 | + foreach ($data as $entry) |
|
282 | 282 | { |
283 | - if( isset( $addrItems[$entry['customer.address.id']] ) ) |
|
283 | + if (isset($addrItems[$entry['customer.address.id']])) |
|
284 | 284 | { |
285 | 285 | $addrItem = $addrItems[$entry['customer.address.id']]; |
286 | - unset( $addrItems[$entry['customer.address.id']] ); |
|
286 | + unset($addrItems[$entry['customer.address.id']]); |
|
287 | 287 | } |
288 | 288 | else |
289 | 289 | { |
290 | 290 | $addrItem = $manager->createItem(); |
291 | 291 | } |
292 | 292 | |
293 | - $addrItem->fromArray( $entry ); |
|
294 | - $item->addAddressItem( $addrItem ); |
|
293 | + $addrItem->fromArray($entry); |
|
294 | + $item->addAddressItem($addrItem); |
|
295 | 295 | } |
296 | 296 | |
297 | - $item->deleteAddressItems( $addrItems ); |
|
297 | + $item->deleteAddressItems($addrItems); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | * @param boolean $copy True if items should be copied, false if not |
306 | 306 | * @return string[] Multi-dimensional associative list of item data |
307 | 307 | */ |
308 | - protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false ) |
|
308 | + protected function toArray(\Aimeos\MShop\Customer\Item\Iface $item, $copy = false) |
|
309 | 309 | { |
310 | 310 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
311 | 311 | $data = []; |
312 | 312 | |
313 | - foreach( $item->getAddressItems() as $addrItem ) |
|
313 | + foreach ($item->getAddressItems() as $addrItem) |
|
314 | 314 | { |
315 | - $list = $addrItem->toArray( true ); |
|
315 | + $list = $addrItem->toArray(true); |
|
316 | 316 | |
317 | - if( $copy === true ) |
|
317 | + if ($copy === true) |
|
318 | 318 | { |
319 | 319 | $list['customer.address.siteid'] = $siteId; |
320 | 320 | $list['customer.address.id'] = ''; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
334 | 334 | * @return string HTML output |
335 | 335 | */ |
336 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
336 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
337 | 337 | { |
338 | 338 | /** admin/jqadm/customer/address/template-item |
339 | 339 | * Relative path to the HTML body template of the address subpart for customers. |
@@ -357,6 +357,6 @@ discard block |
||
357 | 357 | $tplconf = 'admin/jqadm/customer/address/template-item'; |
358 | 358 | $default = 'customer/item-address-standard'; |
359 | 359 | |
360 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
360 | + return $view->render($view->config($tplconf, $default)); |
|
361 | 361 | } |
362 | 362 | } |
@@ -118,14 +118,12 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | return; |
121 | - } |
|
122 | - catch( \Aimeos\MShop\Exception $e ) |
|
121 | + } catch( \Aimeos\MShop\Exception $e ) |
|
123 | 122 | { |
124 | 123 | $error = array( 'supplier-item-address' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
125 | 124 | $view->errors = $view->get( 'errors', [] ) + $error; |
126 | 125 | $this->logException( $e ); |
127 | - } |
|
128 | - catch( \Exception $e ) |
|
126 | + } catch( \Exception $e ) |
|
129 | 127 | { |
130 | 128 | $error = array( 'supplier-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
131 | 129 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -284,8 +282,7 @@ discard block |
||
284 | 282 | { |
285 | 283 | $addrItem = $addrItems[$entry['supplier.address.id']]; |
286 | 284 | unset( $addrItems[$entry['supplier.address.id']] ); |
287 | - } |
|
288 | - else |
|
285 | + } else |
|
289 | 286 | { |
290 | 287 | $addrItem = $manager->createItem(); |
291 | 288 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Supplier\Address; |
12 | 12 | |
13 | -sprintf( 'address' ); // for translation |
|
13 | +sprintf('address'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->addressData = $this->toArray( $view->item, true ); |
|
47 | + $view->addressData = $this->toArray($view->item, true); |
|
48 | 48 | $view->addressBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->addressBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | $view = $this->getView(); |
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'address', [] ); |
|
67 | + $data = $view->param('address', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) { |
|
69 | + foreach ($data as $idx => $entry) { |
|
70 | 70 | $data[$idx]['supplier.address.siteid'] = $siteid; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $view->addressData = $data; |
74 | 74 | $view->addressBody = ''; |
75 | 75 | |
76 | - foreach( $this->getSubClients() as $client ) { |
|
76 | + foreach ($this->getSubClients() as $client) { |
|
77 | 77 | $view->addressBody .= $client->create(); |
78 | 78 | } |
79 | 79 | |
80 | - return $this->render( $view ); |
|
80 | + return $this->render($view); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | { |
91 | 91 | $view = $this->getView(); |
92 | 92 | |
93 | - $view->addressData = $this->toArray( $view->item ); |
|
93 | + $view->addressData = $this->toArray($view->item); |
|
94 | 94 | $view->addressBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $client ) { |
|
96 | + foreach ($this->getSubClients() as $client) { |
|
97 | 97 | $view->addressBody .= $client->get(); |
98 | 98 | } |
99 | 99 | |
100 | - return $this->render( $view ); |
|
100 | + return $this->render($view); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -110,26 +110,26 @@ discard block |
||
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->fromArray( $view->item, $view->param( 'address', [] ) ); |
|
113 | + $this->fromArray($view->item, $view->param('address', [])); |
|
114 | 114 | $view->addressBody = ''; |
115 | 115 | |
116 | - foreach( $this->getSubClients() as $client ) { |
|
116 | + foreach ($this->getSubClients() as $client) { |
|
117 | 117 | $view->addressBody .= $client->save(); |
118 | 118 | } |
119 | 119 | |
120 | 120 | return; |
121 | 121 | } |
122 | - catch( \Aimeos\MShop\Exception $e ) |
|
122 | + catch (\Aimeos\MShop\Exception $e) |
|
123 | 123 | { |
124 | - $error = array( 'supplier-item-address' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
125 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
126 | - $this->logException( $e ); |
|
124 | + $error = array('supplier-item-address' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
125 | + $view->errors = $view->get('errors', []) + $error; |
|
126 | + $this->logException($e); |
|
127 | 127 | } |
128 | - catch( \Exception $e ) |
|
128 | + catch (\Exception $e) |
|
129 | 129 | { |
130 | - $error = array( 'supplier-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
131 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
132 | - $this->logException( $e ); |
|
130 | + $error = array('supplier-item-address' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
131 | + $view->errors = $view->get('errors', []) + $error; |
|
132 | + $this->logException($e); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param string|null $name Name of the sub-client (Default if null) |
144 | 144 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
145 | 145 | */ |
146 | - public function getSubClient( $type, $name = null ) |
|
146 | + public function getSubClient($type, $name = null) |
|
147 | 147 | { |
148 | 148 | /** admin/jqadm/supplier/address/decorators/excludes |
149 | 149 | * Excludes decorators added by the "common" option from the supplier JQAdm client |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @see admin/jqadm/supplier/address/decorators/excludes |
219 | 219 | * @see admin/jqadm/supplier/address/decorators/global |
220 | 220 | */ |
221 | - return $this->createSubClient( 'supplier/address/' . $type, $name ); |
|
221 | + return $this->createSubClient('supplier/address/' . $type, $name); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @since 2017.10 |
263 | 263 | * @category Developer |
264 | 264 | */ |
265 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/address/standard/subparts', [] ); |
|
265 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/address/standard/subparts', []); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | |
@@ -272,29 +272,29 @@ discard block |
||
272 | 272 | * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object without referenced domain items |
273 | 273 | * @param string[] $data Data array |
274 | 274 | */ |
275 | - protected function fromArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data ) |
|
275 | + protected function fromArray(\Aimeos\MShop\Supplier\Item\Iface $item, array $data) |
|
276 | 276 | { |
277 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier/address' ); |
|
277 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier/address'); |
|
278 | 278 | |
279 | 279 | $addrItems = $item->getAddressItems(); |
280 | 280 | |
281 | - foreach( $data as $entry ) |
|
281 | + foreach ($data as $entry) |
|
282 | 282 | { |
283 | - if( isset( $addrItems[$entry['supplier.address.id']] ) ) |
|
283 | + if (isset($addrItems[$entry['supplier.address.id']])) |
|
284 | 284 | { |
285 | 285 | $addrItem = $addrItems[$entry['supplier.address.id']]; |
286 | - unset( $addrItems[$entry['supplier.address.id']] ); |
|
286 | + unset($addrItems[$entry['supplier.address.id']]); |
|
287 | 287 | } |
288 | 288 | else |
289 | 289 | { |
290 | 290 | $addrItem = $manager->createItem(); |
291 | 291 | } |
292 | 292 | |
293 | - $addrItem->fromArray( $entry ); |
|
294 | - $item->addAddressItem( $addrItem ); |
|
293 | + $addrItem->fromArray($entry); |
|
294 | + $item->addAddressItem($addrItem); |
|
295 | 295 | } |
296 | 296 | |
297 | - $item->deleteAddressItems( $addrItems ); |
|
297 | + $item->deleteAddressItems($addrItems); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | * @param boolean $copy True if items should be copied, false if not |
306 | 306 | * @return string[] Multi-dimensional associative list of item data |
307 | 307 | */ |
308 | - protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, $copy = false ) |
|
308 | + protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, $copy = false) |
|
309 | 309 | { |
310 | 310 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
311 | 311 | $data = []; |
312 | 312 | |
313 | - foreach( $item->getAddressItems() as $addrItem ) |
|
313 | + foreach ($item->getAddressItems() as $addrItem) |
|
314 | 314 | { |
315 | - $list = $addrItem->toArray( true ); |
|
315 | + $list = $addrItem->toArray(true); |
|
316 | 316 | |
317 | - if( $copy === true ) |
|
317 | + if ($copy === true) |
|
318 | 318 | { |
319 | 319 | $list['supplier.address.siteid'] = $siteId; |
320 | 320 | $list['supplier.address.id'] = ''; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
334 | 334 | * @return string HTML output |
335 | 335 | */ |
336 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
336 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
337 | 337 | { |
338 | 338 | /** admin/jqadm/supplier/address/template-item |
339 | 339 | * Relative path to the HTML body template of the address subpart for suppliers. |
@@ -357,6 +357,6 @@ discard block |
||
357 | 357 | $tplconf = 'admin/jqadm/supplier/address/template-item'; |
358 | 358 | $default = 'supplier/item-address-standard'; |
359 | 359 | |
360 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
360 | + return $view->render($view->config($tplconf, $default)); |
|
361 | 361 | } |
362 | 362 | } |