Completed
Push — master ( 0229de...f71bfb )
by Aimeos
04:41
created
admin/jqadm/tests/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,17 +11,17 @@
 block discarded – undo
11 11
  * Set error reporting to maximum
12 12
  */
13 13
 error_reporting( -1 );
14
-ini_set( 'display_errors', '1' );
14
+ini_set('display_errors', '1');
15 15
 
16
-date_default_timezone_set( 'UTC' );
16
+date_default_timezone_set('UTC');
17 17
 
18 18
 /*
19 19
  * Set locale settings to reasonable defaults
20 20
  */
21
-setlocale( LC_ALL, 'en_US.UTF-8' );
22
-setlocale( LC_NUMERIC, 'POSIX' );
23
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
24
-setlocale( LC_TIME, 'POSIX' );
21
+setlocale(LC_ALL, 'en_US.UTF-8');
22
+setlocale(LC_NUMERIC, 'POSIX');
23
+setlocale(LC_CTYPE, 'en_US.UTF-8');
24
+setlocale(LC_TIME, 'POSIX');
25 25
 
26 26
 
27 27
 require_once 'TestHelperJqadm.php';
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Common/Decorator/Base.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 * Creates a new resource
75 75
 	 *
76 76
 	 * @return string|null admin output to display or null for redirecting to the list
77
-	*/
77
+	 */
78 78
 	public function create()
79 79
 	{
80 80
 		return $this->client->create();
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * Deletes a resource
86 86
 	 *
87 87
 	 * @return string|null admin output to display or null for redirecting to the list
88
-	*/
88
+	 */
89 89
 	public function delete()
90 90
 	{
91 91
 		return $this->client->delete();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * Returns a single resource
97 97
 	 *
98 98
 	 * @return string|null admin output to display or null for redirecting to the list
99
-	*/
99
+	 */
100 100
 	public function get()
101 101
 	{
102 102
 		return $this->client->get();
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * Saves the data
108 108
 	 *
109 109
 	 * @return string|null admin output to display or null for redirecting to the list
110
-	*/
110
+	 */
111 111
 	public function save()
112 112
 	{
113 113
 		return $this->client->save();
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * Returns a list of resource according to the conditions
119 119
 	 *
120 120
 	 * @return string admin output to display
121
-	*/
121
+	 */
122 122
 	public function search()
123 123
 	{
124 124
 		return $this->client->search();
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	 * @param \Aimeos\Admin\JQAdm\Iface $client Admin object
31 31
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects
32 32
 	 */
33
-	public function __construct( \Aimeos\Admin\JQAdm\Iface $client,
34
-		\Aimeos\MShop\Context\Item\Iface $context )
33
+	public function __construct(\Aimeos\Admin\JQAdm\Iface $client,
34
+		\Aimeos\MShop\Context\Item\Iface $context)
35 35
 	{
36
-		parent::__construct( $context );
36
+		parent::__construct($context);
37 37
 
38 38
 		$this->client = $client;
39 39
 	}
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	 * @return mixed Returns the value of the called method
48 48
 	 * @throws \Aimeos\Admin\JQAdm\Exception If method call failed
49 49
 	 */
50
-	public function __call( $name, array $param )
50
+	public function __call($name, array $param)
51 51
 	{
52
-		return @call_user_func_array( array( $this->client, $name ), $param );
52
+		return @call_user_func_array(array($this->client, $name), $param);
53 53
 	}
54 54
 
55 55
 
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 	 * @param string|null $name Name of the sub-client (Default if null)
149 149
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
150 150
 	 */
151
-	public function getSubClient( $type, $name = null )
151
+	public function getSubClient($type, $name = null)
152 152
 	{
153
-		return $this->client->getSubClient( $type, $name );
153
+		return $this->client->getSubClient($type, $name);
154 154
 	}
155 155
 
156 156
 
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 	 * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output
172 172
 	 * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls
173 173
 	 */
174
-	public function setView( \Aimeos\MW\View\Iface $view )
174
+	public function setView(\Aimeos\MW\View\Iface $view)
175 175
 	{
176
-		parent::setView( $view );
176
+		parent::setView($view);
177 177
 
178
-		$this->client->setView( $view );
178
+		$this->client->setView($view);
179 179
 		return $this;
180 180
 	}
181 181
 
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
 	 * @param \Aimeos\Bootstrap $aimeos The Aimeos bootstrap object
198 198
 	 * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls
199 199
 	 */
200
-	public function setAimeos( \Aimeos\Bootstrap $aimeos )
200
+	public function setAimeos(\Aimeos\Bootstrap $aimeos)
201 201
 	{
202
-		parent::setAimeos( $aimeos );
202
+		parent::setAimeos($aimeos);
203 203
 
204
-		$this->client->setAimeos( $aimeos );
204
+		$this->client->setAimeos($aimeos);
205 205
 		return $this;
206 206
 	}
207 207
 
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Common/Decorator/Cache.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$result = $this->getClient()->delete();
30 30
 
31
-		$ids = (array) $this->getView()->param( 'id' );
32
-		$tags = array( 'product' );
31
+		$ids = (array) $this->getView()->param('id');
32
+		$tags = array('product');
33 33
 
34
-		foreach( $ids as $id ) {
34
+		foreach ($ids as $id) {
35 35
 			$tags[] = 'product-' . $id;
36 36
 		}
37 37
 
38
-		$this->getContext()->getCache()->deleteByTags( $tags );
38
+		$this->getContext()->getCache()->deleteByTags($tags);
39 39
 
40 40
 		return $result;
41 41
 	}
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 		$result = $this->getClient()->save();
52 52
 		$item = $this->getView()->item;
53 53
 
54
-		if( $item->getId() !== null )
54
+		if ($item->getId() !== null)
55 55
 		{
56 56
 			$idtag = 'product-' . $item->getId();
57
-			$this->getContext()->getCache()->deleteByTags( array( 'product', $idtag ) );
57
+			$this->getContext()->getCache()->deleteByTags(array('product', $idtag));
58 58
 		}
59 59
 
60 60
 		return $result;
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Iface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @param string|null $name Name of the sub-client (Default if null)
27 27
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
28 28
 	 */
29
-	public function getSubClient( $type, $name = null );
29
+	public function getSubClient($type, $name = null);
30 30
 
31 31
 	/**
32 32
 	 * Returns the view object that will generate the admin output.
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output
42 42
 	 * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls
43 43
 	 */
44
-	public function setView( \Aimeos\MW\View\Iface $view );
44
+	public function setView(\Aimeos\MW\View\Iface $view);
45 45
 
46 46
 	/**
47 47
 	 * Copies a resource
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Product/Category/Decorator/Cache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@
 block discarded – undo
27 27
 	public function save()
28 28
 	{
29 29
 		$result = $this->getClient()->save();
30
-		$ids = array( 'catalog' );
30
+		$ids = array('catalog');
31 31
 
32
-		foreach( $this->getView()->param( 'category/catalog.id', [] ) as $id ) {
32
+		foreach ($this->getView()->param('category/catalog.id', []) as $id) {
33 33
 			$ids[] = 'catalog-' . $id;
34 34
 		}
35 35
 
36
-		$this->getContext()->getCache()->deleteByTags( $ids );
36
+		$this->getContext()->getCache()->deleteByTags($ids);
37 37
 
38 38
 		return $result;
39 39
 	}
Please login to merge, or discard this patch.
lib/custom/tests/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 block discarded – undo
10 10
  * Set error reporting to maximum
11 11
  */
12 12
 error_reporting( -1 );
13
-ini_set( 'display_errors', '1' );
13
+ini_set('display_errors', '1');
14 14
 
15
-date_default_timezone_set( 'UTC' );
15
+date_default_timezone_set('UTC');
16 16
 
17 17
 /*
18 18
  * Set locale settings to reasonable defaults
19 19
  */
20
-setlocale( LC_ALL, 'en_US.UTF-8' );
21
-setlocale( LC_NUMERIC, 'POSIX' );
22
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
23
-setlocale( LC_TIME, 'POSIX' );
20
+setlocale(LC_ALL, 'en_US.UTF-8');
21
+setlocale(LC_NUMERIC, 'POSIX');
22
+setlocale(LC_CTYPE, 'en_US.UTF-8');
23
+setlocale(LC_TIME, 'POSIX');
24 24
 
25 25
 
26 26
 require_once 'TestHelperCustom.php';
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Helper/Site/Standard.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	/**
38 38
 	 * Returns the site view helper
39 39
 	 *
40
-	 * @return Aimeos\MW\View\Helper\Site\Iface Site view helper
40
+	 * @return Standard Site view helper
41 41
 	 */
42 42
 	public function transform()
43 43
 	{
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 	 *
28 28
 	 * @param \Aimeos\MW\View\Iface $view View object
29 29
 	 */
30
-	public function __construct( \Aimeos\MW\View\Iface $view )
30
+	public function __construct(\Aimeos\MW\View\Iface $view)
31 31
 	{
32
-		parent::__construct( $view );
32
+		parent::__construct($view);
33 33
 		$this->siteItem = $view->pageSiteItem;
34 34
 	}
35 35
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 * @param string $siteid ID of a site item
63 63
 	 * @return string|null Label of the site item or null if not found
64 64
 	 */
65
-	public function match( $siteid )
65
+	public function match($siteid)
66 66
 	{
67
-		if( $this->siteItem->getId() == $siteid ) {
67
+		if ($this->siteItem->getId() == $siteid) {
68 68
 			return $this->siteItem->getLabel();
69 69
 		}
70 70
 	}
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	 * @param string $siteid ID of a site item
77 77
 	 * @return string|null "readonly" if item is from a parent site, null if not
78 78
 	 */
79
-	public function readonly( $siteid )
79
+	public function readonly($siteid)
80 80
 	{
81
-		if( $this->siteItem->getId() != $siteid ) {
81
+		if ($this->siteItem->getId() != $siteid) {
82 82
 			return 'readonly';
83 83
 		}
84 84
 	}
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Locale/Site/Standard.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -498,7 +498,7 @@
 block discarded – undo
498 498
 	/**
499 499
 	 * Constructs the data array for the view from the given item
500 500
 	 *
501
-	 * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object
501
+	 * @param \Aimeos\MShop\Locale\Item\Site\Iface $item Locale item object
502 502
 	 * @return string[] Multi-dimensional associative list of item data
503 503
 	 */
504 504
 	protected function toArray( \Aimeos\MShop\Locale\Item\Site\Iface $item, $copy = false )
Please login to merge, or discard this patch.
Braces   +18 added lines, -36 removed lines patch added patch discarded remove patch
@@ -90,20 +90,17 @@  discard block
 block discarded – undo
90 90
 				$view->tabindex = ++$idx + 1;
91 91
 				$view->itemBody .= $client->copy();
92 92
 			}
93
-		}
94
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
93
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
95 94
 		{
96 95
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
97 96
 			$view->errors = $view->get( 'errors', [] ) + $error;
98 97
 			$this->logException( $e );
99
-		}
100
-		catch( \Aimeos\MShop\Exception $e )
98
+		} catch( \Aimeos\MShop\Exception $e )
101 99
 		{
102 100
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
103 101
 			$view->errors = $view->get( 'errors', [] ) + $error;
104 102
 			$this->logException( $e );
105
-		}
106
-		catch( \Exception $e )
103
+		} catch( \Exception $e )
107 104
 		{
108 105
 			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
109 106
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -145,20 +142,17 @@  discard block
 block discarded – undo
145 142
 				$view->tabindex = ++$idx + 1;
146 143
 				$view->itemBody .= $client->create();
147 144
 			}
148
-		}
149
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
145
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
150 146
 		{
151 147
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
152 148
 			$view->errors = $view->get( 'errors', [] ) + $error;
153 149
 			$this->logException( $e );
154
-		}
155
-		catch( \Aimeos\MShop\Exception $e )
150
+		} catch( \Aimeos\MShop\Exception $e )
156 151
 		{
157 152
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
158 153
 			$view->errors = $view->get( 'errors', [] ) + $error;
159 154
 			$this->logException( $e );
160
-		}
161
-		catch( \Exception $e )
155
+		} catch( \Exception $e )
162 156
 		{
163 157
 			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
164 158
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -201,20 +195,17 @@  discard block
 block discarded – undo
201 195
 
202 196
 			$this->nextAction( $view, 'search', 'locale/site', null, 'delete' );
203 197
 			return;
204
-		}
205
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
198
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
206 199
 		{
207 200
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
208 201
 			$view->errors = $view->get( 'errors', [] ) + $error;
209 202
 			$this->logException( $e );
210
-		}
211
-		catch( \Aimeos\MShop\Exception $e )
203
+		} catch( \Aimeos\MShop\Exception $e )
212 204
 		{
213 205
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
214 206
 			$view->errors = $view->get( 'errors', [] ) + $error;
215 207
 			$this->logException( $e );
216
-		}
217
-		catch( \Exception $e )
208
+		} catch( \Exception $e )
218 209
 		{
219 210
 			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
220 211
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -257,20 +248,17 @@  discard block
 block discarded – undo
257 248
 				$view->tabindex = ++$idx + 1;
258 249
 				$view->itemBody .= $client->get();
259 250
 			}
260
-		}
261
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
251
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
262 252
 		{
263 253
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
264 254
 			$view->errors = $view->get( 'errors', [] ) + $error;
265 255
 			$this->logException( $e );
266
-		}
267
-		catch( \Aimeos\MShop\Exception $e )
256
+		} catch( \Aimeos\MShop\Exception $e )
268 257
 		{
269 258
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
270 259
 			$view->errors = $view->get( 'errors', [] ) + $error;
271 260
 			$this->logException( $e );
272
-		}
273
-		catch( \Exception $e )
261
+		} catch( \Exception $e )
274 262
 		{
275 263
 			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
276 264
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -308,20 +296,17 @@  discard block
 block discarded – undo
308 296
 
309 297
 			$this->nextAction( $view, $view->param( 'next' ), 'locale/site', $view->item->getId(), 'save' );
310 298
 			return;
311
-		}
312
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
299
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
313 300
 		{
314 301
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
315 302
 			$view->errors = $view->get( 'errors', [] ) + $error;
316 303
 			$this->logException( $e );
317
-		}
318
-		catch( \Aimeos\MShop\Exception $e )
304
+		} catch( \Aimeos\MShop\Exception $e )
319 305
 		{
320 306
 			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
321 307
 			$view->errors = $view->get( 'errors', [] ) + $error;
322 308
 			$this->logException( $e );
323
-		}
324
-		catch( \Exception $e )
309
+		} catch( \Exception $e )
325 310
 		{
326 311
 			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
327 312
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -368,14 +353,12 @@  discard block
 block discarded – undo
368 353
 			foreach( $this->getSubClients() as $client ) {
369 354
 				$view->itemBody .= $client->search();
370 355
 			}
371
-		}
372
-		catch( \Aimeos\MShop\Exception $e )
356
+		} catch( \Aimeos\MShop\Exception $e )
373 357
 		{
374 358
 			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
375 359
 			$view->errors = $view->get( 'errors', [] ) + $error;
376 360
 			$this->logException( $e );
377
-		}
378
-		catch( \Exception $e )
361
+		} catch( \Exception $e )
379 362
 		{
380 363
 			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
381 364
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -563,8 +546,7 @@  discard block
 block discarded – undo
563 546
 		{
564 547
 			$this->checkSite( $super, $data['locale.site.id'] );
565 548
 			$item = $manager->getItem( $data['locale.site.id'] );
566
-		}
567
-		else
549
+		} else
568 550
 		{
569 551
 			$this->checkSite( $super );
570 552
 			$item = $manager->createItem();
Please login to merge, or discard this patch.
Spacing   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Locale\Site;
12 12
 
13
-sprintf( 'locale/site' ); // for translation
13
+sprintf('locale/site'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,45 +35,45 @@  discard block
 block discarded – undo
35 35
 
36 36
 		try
37 37
 		{
38
-			if( ( $id = $view->param( 'id' ) ) === null ) {
39
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
38
+			if (($id = $view->param('id')) === null) {
39
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
40 40
 			}
41 41
 
42
-			$this->checkSite( $view->access( 'super' ), $id );
42
+			$this->checkSite($view->access('super'), $id);
43 43
 
44
-			$manager = \Aimeos\MShop::create( $context, 'locale/site' );
45
-			$view->item = $manager->getItem( $id );
44
+			$manager = \Aimeos\MShop::create($context, 'locale/site');
45
+			$view->item = $manager->getItem($id);
46 46
 
47
-			$view->itemData = $this->toArray( $view->item, true );
47
+			$view->itemData = $this->toArray($view->item, true);
48 48
 			$view->itemSubparts = $this->getSubClientNames();
49 49
 			$view->itemBody = '';
50 50
 
51
-			foreach( $this->getSubClients() as $idx => $client )
51
+			foreach ($this->getSubClients() as $idx => $client)
52 52
 			{
53 53
 				$view->tabindex = ++$idx + 1;
54 54
 				$view->itemBody .= $client->copy();
55 55
 			}
56 56
 		}
57
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
57
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
58 58
 		{
59
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
60
-			$view->errors = $view->get( 'errors', [] ) + $error;
61
-			$this->logException( $e );
59
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
60
+			$view->errors = $view->get('errors', []) + $error;
61
+			$this->logException($e);
62 62
 		}
63
-		catch( \Aimeos\MShop\Exception $e )
63
+		catch (\Aimeos\MShop\Exception $e)
64 64
 		{
65
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
66
-			$view->errors = $view->get( 'errors', [] ) + $error;
67
-			$this->logException( $e );
65
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
66
+			$view->errors = $view->get('errors', []) + $error;
67
+			$this->logException($e);
68 68
 		}
69
-		catch( \Exception $e )
69
+		catch (\Exception $e)
70 70
 		{
71
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
72
-			$view->errors = $view->get( 'errors', [] ) + $error;
73
-			$this->logException( $e );
71
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
72
+			$view->errors = $view->get('errors', []) + $error;
73
+			$this->logException($e);
74 74
 		}
75 75
 
76
-		return $this->render( $view );
76
+		return $this->render($view);
77 77
 	}
78 78
 
79 79
 
@@ -89,44 +89,44 @@  discard block
 block discarded – undo
89 89
 
90 90
 		try
91 91
 		{
92
-			$this->checkSite( $view->access( 'super' ) );
92
+			$this->checkSite($view->access('super'));
93 93
 
94
-			$data = $view->param( 'item', [] );
94
+			$data = $view->param('item', []);
95 95
 
96
-			if( !isset( $view->item ) ) {
97
-				$view->item = \Aimeos\MShop::create( $context, 'locale/site' )->createItem();
96
+			if (!isset($view->item)) {
97
+				$view->item = \Aimeos\MShop::create($context, 'locale/site')->createItem();
98 98
 			}
99 99
 
100 100
 			$view->itemSubparts = $this->getSubClientNames();
101 101
 			$view->itemData = $data;
102 102
 			$view->itemBody = '';
103 103
 
104
-			foreach( $this->getSubClients() as $idx => $client )
104
+			foreach ($this->getSubClients() as $idx => $client)
105 105
 			{
106 106
 				$view->tabindex = ++$idx + 1;
107 107
 				$view->itemBody .= $client->create();
108 108
 			}
109 109
 		}
110
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
110
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
111 111
 		{
112
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
113
-			$view->errors = $view->get( 'errors', [] ) + $error;
114
-			$this->logException( $e );
112
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
113
+			$view->errors = $view->get('errors', []) + $error;
114
+			$this->logException($e);
115 115
 		}
116
-		catch( \Aimeos\MShop\Exception $e )
116
+		catch (\Aimeos\MShop\Exception $e)
117 117
 		{
118
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
119
-			$view->errors = $view->get( 'errors', [] ) + $error;
120
-			$this->logException( $e );
118
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
119
+			$view->errors = $view->get('errors', []) + $error;
120
+			$this->logException($e);
121 121
 		}
122
-		catch( \Exception $e )
122
+		catch (\Exception $e)
123 123
 		{
124
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
125
-			$view->errors = $view->get( 'errors', [] ) + $error;
126
-			$this->logException( $e );
124
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
125
+			$view->errors = $view->get('errors', []) + $error;
126
+			$this->logException($e);
127 127
 		}
128 128
 
129
-		return $this->render( $view );
129
+		return $this->render($view);
130 130
 	}
131 131
 
132 132
 
@@ -140,46 +140,46 @@  discard block
 block discarded – undo
140 140
 		$view = $this->getView();
141 141
 		$context = $this->getContext();
142 142
 
143
-		$manager = \Aimeos\MShop::create( $context, 'locale/site' );
143
+		$manager = \Aimeos\MShop::create($context, 'locale/site');
144 144
 		$manager->begin();
145 145
 
146 146
 		try
147 147
 		{
148
-			if( ( $id = $view->param( 'id' ) ) === null ) {
149
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
148
+			if (($id = $view->param('id')) === null) {
149
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
150 150
 			}
151 151
 
152
-			$this->checkSite( $view->access( 'super' ), $id );
152
+			$this->checkSite($view->access('super'), $id);
153 153
 
154
-			$view->item = $manager->getItem( $id );
154
+			$view->item = $manager->getItem($id);
155 155
 
156
-			foreach( $this->getSubClients() as $client ) {
156
+			foreach ($this->getSubClients() as $client) {
157 157
 				$client->delete();
158 158
 			}
159 159
 
160
-			$manager->deleteItem( $id );
160
+			$manager->deleteItem($id);
161 161
 			$manager->commit();
162 162
 
163
-			$this->nextAction( $view, 'search', 'locale/site', null, 'delete' );
163
+			$this->nextAction($view, 'search', 'locale/site', null, 'delete');
164 164
 			return;
165 165
 		}
166
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
166
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
167 167
 		{
168
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
169
-			$view->errors = $view->get( 'errors', [] ) + $error;
170
-			$this->logException( $e );
168
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
169
+			$view->errors = $view->get('errors', []) + $error;
170
+			$this->logException($e);
171 171
 		}
172
-		catch( \Aimeos\MShop\Exception $e )
172
+		catch (\Aimeos\MShop\Exception $e)
173 173
 		{
174
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
175
-			$view->errors = $view->get( 'errors', [] ) + $error;
176
-			$this->logException( $e );
174
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
175
+			$view->errors = $view->get('errors', []) + $error;
176
+			$this->logException($e);
177 177
 		}
178
-		catch( \Exception $e )
178
+		catch (\Exception $e)
179 179
 		{
180
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
181
-			$view->errors = $view->get( 'errors', [] ) + $error;
182
-			$this->logException( $e );
180
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
181
+			$view->errors = $view->get('errors', []) + $error;
182
+			$this->logException($e);
183 183
 		}
184 184
 
185 185
 		$manager->rollback();
@@ -200,45 +200,45 @@  discard block
 block discarded – undo
200 200
 
201 201
 		try
202 202
 		{
203
-			if( ( $id = $view->param( 'id' ) ) === null ) {
204
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
203
+			if (($id = $view->param('id')) === null) {
204
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
205 205
 			}
206 206
 
207
-			$this->checkSite( $view->access( 'super' ), $id );
207
+			$this->checkSite($view->access('super'), $id);
208 208
 
209
-			$manager = \Aimeos\MShop::create( $context, 'locale/site' );
209
+			$manager = \Aimeos\MShop::create($context, 'locale/site');
210 210
 
211
-			$view->item = $manager->getItem( $id );
211
+			$view->item = $manager->getItem($id);
212 212
 			$view->itemSubparts = $this->getSubClientNames();
213
-			$view->itemData = $this->toArray( $view->item );
213
+			$view->itemData = $this->toArray($view->item);
214 214
 			$view->itemBody = '';
215 215
 
216
-			foreach( $this->getSubClients() as $idx => $client )
216
+			foreach ($this->getSubClients() as $idx => $client)
217 217
 			{
218 218
 				$view->tabindex = ++$idx + 1;
219 219
 				$view->itemBody .= $client->get();
220 220
 			}
221 221
 		}
222
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
222
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
223 223
 		{
224
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
225
-			$view->errors = $view->get( 'errors', [] ) + $error;
226
-			$this->logException( $e );
224
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
225
+			$view->errors = $view->get('errors', []) + $error;
226
+			$this->logException($e);
227 227
 		}
228
-		catch( \Aimeos\MShop\Exception $e )
228
+		catch (\Aimeos\MShop\Exception $e)
229 229
 		{
230
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
231
-			$view->errors = $view->get( 'errors', [] ) + $error;
232
-			$this->logException( $e );
230
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
231
+			$view->errors = $view->get('errors', []) + $error;
232
+			$this->logException($e);
233 233
 		}
234
-		catch( \Exception $e )
234
+		catch (\Exception $e)
235 235
 		{
236
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
237
-			$view->errors = $view->get( 'errors', [] ) + $error;
238
-			$this->logException( $e );
236
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
237
+			$view->errors = $view->get('errors', []) + $error;
238
+			$this->logException($e);
239 239
 		}
240 240
 
241
-		return $this->render( $view );
241
+		return $this->render($view);
242 242
 	}
243 243
 
244 244
 
@@ -252,42 +252,42 @@  discard block
 block discarded – undo
252 252
 		$view = $this->getView();
253 253
 		$context = $this->getContext();
254 254
 
255
-		$manager = \Aimeos\MShop::create( $context, 'locale/site' );
255
+		$manager = \Aimeos\MShop::create($context, 'locale/site');
256 256
 		$manager->begin();
257 257
 
258 258
 		try
259 259
 		{
260
-			$item = $this->fromArray( $view->param( 'item', [] ), $view->access( 'super' ) );
261
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
260
+			$item = $this->fromArray($view->param('item', []), $view->access('super'));
261
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
262 262
 			$view->itemBody = '';
263 263
 
264
-			foreach( $this->getSubClients() as $client ) {
264
+			foreach ($this->getSubClients() as $client) {
265 265
 				$view->itemBody .= $client->save();
266 266
 			}
267 267
 
268
-			$manager->saveItem( clone $view->item );
268
+			$manager->saveItem(clone $view->item);
269 269
 			$manager->commit();
270 270
 
271
-			$this->nextAction( $view, $view->param( 'next' ), 'locale/site', $view->item->getId(), 'save' );
271
+			$this->nextAction($view, $view->param('next'), 'locale/site', $view->item->getId(), 'save');
272 272
 			return;
273 273
 		}
274
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
274
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
275 275
 		{
276
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
277
-			$view->errors = $view->get( 'errors', [] ) + $error;
278
-			$this->logException( $e );
276
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
277
+			$view->errors = $view->get('errors', []) + $error;
278
+			$this->logException($e);
279 279
 		}
280
-		catch( \Aimeos\MShop\Exception $e )
280
+		catch (\Aimeos\MShop\Exception $e)
281 281
 		{
282
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
283
-			$view->errors = $view->get( 'errors', [] ) + $error;
284
-			$this->logException( $e );
282
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
283
+			$view->errors = $view->get('errors', []) + $error;
284
+			$this->logException($e);
285 285
 		}
286
-		catch( \Exception $e )
286
+		catch (\Exception $e)
287 287
 		{
288
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
289
-			$view->errors = $view->get( 'errors', [] ) + $error;
290
-			$this->logException( $e );
288
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
289
+			$view->errors = $view->get('errors', []) + $error;
290
+			$this->logException($e);
291 291
 		}
292 292
 
293 293
 		$manager->rollback();
@@ -309,39 +309,39 @@  discard block
 block discarded – undo
309 309
 		try
310 310
 		{
311 311
 			$total = 0;
312
-			$params = $this->storeSearchParams( $view->param(), 'locale/site' );
313
-			$manager = \Aimeos\MShop::create( $context, 'locale/site' );
314
-			$search = $this->initCriteria( $manager->createSearch(), $params );
312
+			$params = $this->storeSearchParams($view->param(), 'locale/site');
313
+			$manager = \Aimeos\MShop::create($context, 'locale/site');
314
+			$search = $this->initCriteria($manager->createSearch(), $params);
315 315
 
316
-			if( $view->access( 'super' ) === false )
316
+			if ($view->access('super') === false)
317 317
 			{
318
-				$search->setConditions( $search->combine( '&&', [
319
-					$search->compare( '==', 'locale.site.id', $this->getUserSiteId() ),
318
+				$search->setConditions($search->combine('&&', [
319
+					$search->compare('==', 'locale.site.id', $this->getUserSiteId()),
320 320
 					$search->getConditions(),
321
-				] ) );
321
+				]));
322 322
 			}
323 323
 
324
-			$view->items = $manager->searchItems( $search, [], $total );
325
-			$view->filterAttributes = $manager->getSearchAttributes( true );
324
+			$view->items = $manager->searchItems($search, [], $total);
325
+			$view->filterAttributes = $manager->getSearchAttributes(true);
326 326
 			$view->filterOperators = $search->getOperators();
327 327
 			$view->total = $total;
328 328
 			$view->itemBody = '';
329 329
 
330
-			foreach( $this->getSubClients() as $client ) {
330
+			foreach ($this->getSubClients() as $client) {
331 331
 				$view->itemBody .= $client->search();
332 332
 			}
333 333
 		}
334
-		catch( \Aimeos\MShop\Exception $e )
334
+		catch (\Aimeos\MShop\Exception $e)
335 335
 		{
336
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
337
-			$view->errors = $view->get( 'errors', [] ) + $error;
338
-			$this->logException( $e );
336
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
337
+			$view->errors = $view->get('errors', []) + $error;
338
+			$this->logException($e);
339 339
 		}
340
-		catch( \Exception $e )
340
+		catch (\Exception $e)
341 341
 		{
342
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
343
-			$view->errors = $view->get( 'errors', [] ) + $error;
344
-			$this->logException( $e );
342
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
343
+			$view->errors = $view->get('errors', []) + $error;
344
+			$this->logException($e);
345 345
 		}
346 346
 
347 347
 		/** admin/jqadm/locale/site/template-list
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 		$tplconf = 'admin/jqadm/locale/site/template-list';
367 367
 		$default = 'locale/site/list-standard';
368 368
 
369
-		return $view->render( $view->config( $tplconf, $default ) );
369
+		return $view->render($view->config($tplconf, $default));
370 370
 	}
371 371
 
372 372
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 * @param string|null $name Name of the sub-client (Default if null)
378 378
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
379 379
 	 */
380
-	public function getSubClient( $type, $name = null )
380
+	public function getSubClient($type, $name = null)
381 381
 	{
382 382
 		/** admin/jqadm/locale/site/decorators/excludes
383 383
 		 * Excludes decorators added by the "common" option from the locale JQAdm client
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 		 * @see admin/jqadm/locale/site/decorators/excludes
453 453
 		 * @see admin/jqadm/locale/site/decorators/global
454 454
 		 */
455
-		return $this->createSubClient( 'locale/site' . $type, $name );
455
+		return $this->createSubClient('locale/site' . $type, $name);
456 456
 	}
457 457
 
458 458
 
@@ -463,13 +463,13 @@  discard block
 block discarded – undo
463 463
 	 * @param string $id ID of the site to access
464 464
 	 * @throws \Aimeos\Admin\JQAdm\Exception If user isn't allowed to access the site
465 465
 	 */
466
-	protected function checkSite( $super, $id = null )
466
+	protected function checkSite($super, $id = null)
467 467
 	{
468
-		if( $super === true || (string) $this->getUserSiteId() === (string) $id ) {
468
+		if ($super === true || (string) $this->getUserSiteId() === (string) $id) {
469 469
 			return;
470 470
 		}
471 471
 
472
-		throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Permission denied' ) );
472
+		throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Permission denied'));
473 473
 	}
474 474
 
475 475
 
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
 	protected function getUserSiteId()
482 482
 	{
483 483
 		$context = $this->getContext();
484
-		$manager = \Aimeos\MShop::create( $context, 'customer' );
484
+		$manager = \Aimeos\MShop::create($context, 'customer');
485 485
 
486
-		return $manager->getItem( $context->getUserId() )->getSiteId();
486
+		return $manager->getItem($context->getUserId())->getSiteId();
487 487
 	}
488 488
 
489 489
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 		 * @since 2017.10
528 528
 		 * @category Developer
529 529
 		 */
530
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/locale/site/standard/subparts', [] );
530
+		return $this->getContext()->getConfig()->get('admin/jqadm/locale/site/standard/subparts', []);
531 531
 	}
532 532
 
533 533
 
@@ -538,38 +538,38 @@  discard block
 block discarded – undo
538 538
 	 * @param boolean $super If current user is a super user
539 539
 	 * @return \Aimeos\MShop\Locale\Item\Iface New locale item object
540 540
 	 */
541
-	protected function fromArray( array $data, $super )
541
+	protected function fromArray(array $data, $super)
542 542
 	{
543 543
 		$conf = [];
544 544
 
545
-		if( isset( $data['config']['key'] ) )
545
+		if (isset($data['config']['key']))
546 546
 		{
547
-			foreach( (array) $data['config']['key'] as $idx => $key )
547
+			foreach ((array) $data['config']['key'] as $idx => $key)
548 548
 			{
549
-				if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) {
549
+				if (trim($key) !== '' && isset($data['config']['val'][$idx])) {
550 550
 					$conf[$key] = $data['config']['val'][$idx];
551 551
 				}
552 552
 			}
553 553
 		}
554 554
 
555
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'locale/site' );
555
+		$manager = \Aimeos\MShop::create($this->getContext(), 'locale/site');
556 556
 
557
-		if( isset( $data['locale.site.id'] ) && $data['locale.site.id'] != '' )
557
+		if (isset($data['locale.site.id']) && $data['locale.site.id'] != '')
558 558
 		{
559
-			$this->checkSite( $super, $data['locale.site.id'] );
560
-			$item = $manager->getItem( $data['locale.site.id'] );
559
+			$this->checkSite($super, $data['locale.site.id']);
560
+			$item = $manager->getItem($data['locale.site.id']);
561 561
 		}
562 562
 		else
563 563
 		{
564
-			$this->checkSite( $super );
564
+			$this->checkSite($super);
565 565
 			$item = $manager->createItem();
566 566
 		}
567 567
 
568
-		$item->fromArray( $data );
569
-		$item->setConfig( $conf );
568
+		$item->fromArray($data);
569
+		$item->setConfig($conf);
570 570
 
571
-		if( $item->getId() == null ) {
572
-			return $manager->insertItem( $item );
571
+		if ($item->getId() == null) {
572
+			return $manager->insertItem($item);
573 573
 		}
574 574
 
575 575
 		return $item;
@@ -582,18 +582,18 @@  discard block
 block discarded – undo
582 582
 	 * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object
583 583
 	 * @return string[] Multi-dimensional associative list of item data
584 584
 	 */
585
-	protected function toArray( \Aimeos\MShop\Locale\Item\Site\Iface $item, $copy = false )
585
+	protected function toArray(\Aimeos\MShop\Locale\Item\Site\Iface $item, $copy = false)
586 586
 	{
587
-		$data = $item->toArray( true );
587
+		$data = $item->toArray(true);
588 588
 		$data['config'] = [];
589 589
 
590
-		if( $copy === true )
590
+		if ($copy === true)
591 591
 		{
592 592
 			$data['locale.site.code'] = $data['locale.site.code'] . '_copy';
593 593
 			$data['locale.site.id'] = '';
594 594
 		}
595 595
 
596
-		foreach( $item->getConfig() as $key => $value )
596
+		foreach ($item->getConfig() as $key => $value)
597 597
 		{
598 598
 			$data['config']['key'][] = $key;
599 599
 			$data['config']['val'][] = $value;
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 *
609 609
 	 * @return string HTML output
610 610
 	 */
611
-	protected function render( \Aimeos\MW\View\Iface $view )
611
+	protected function render(\Aimeos\MW\View\Iface $view)
612 612
 	{
613 613
 		/** admin/jqadm/locale/site/template-item
614 614
 		 * Relative path to the HTML body template for the locale item.
@@ -632,6 +632,6 @@  discard block
 block discarded – undo
632 632
 		$tplconf = 'admin/jqadm/locale/site/template-item';
633 633
 		$default = 'locale/site/item-standard';
634 634
 
635
-		return $view->render( $view->config( $tplconf, $default ) );
635
+		return $view->render($view->config($tplconf, $default));
636 636
 	}
637 637
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Locale/Language/Standard.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -476,7 +476,7 @@
 block discarded – undo
476 476
 	/**
477 477
 	 * Constructs the data array for the view from the given item
478 478
 	 *
479
-	 * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object
479
+	 * @param \Aimeos\MShop\Locale\Item\Language\Iface $item Locale item object
480 480
 	 * @return string[] Multi-dimensional associative list of item data
481 481
 	 */
482 482
 	protected function toArray( \Aimeos\MShop\Locale\Item\Language\Iface $item, $copy = false )
Please login to merge, or discard this patch.
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -51,14 +51,12 @@  discard block
 block discarded – undo
51 51
 				$view->tabindex = ++$idx + 1;
52 52
 				$view->itemBody .= $client->copy();
53 53
 			}
54
-		}
55
-		catch( \Aimeos\MShop\Exception $e )
54
+		} catch( \Aimeos\MShop\Exception $e )
56 55
 		{
57 56
 			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
58 57
 			$view->errors = $view->get( 'errors', [] ) + $error;
59 58
 			$this->logException( $e );
60
-		}
61
-		catch( \Exception $e )
59
+		} catch( \Exception $e )
62 60
 		{
63 61
 			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
64 62
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -96,14 +94,12 @@  discard block
 block discarded – undo
96 94
 				$view->tabindex = ++$idx + 1;
97 95
 				$view->itemBody .= $client->create();
98 96
 			}
99
-		}
100
-		catch( \Aimeos\MShop\Exception $e )
97
+		} catch( \Aimeos\MShop\Exception $e )
101 98
 		{
102 99
 			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
103 100
 			$view->errors = $view->get( 'errors', [] ) + $error;
104 101
 			$this->logException( $e );
105
-		}
106
-		catch( \Exception $e )
102
+		} catch( \Exception $e )
107 103
 		{
108 104
 			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
109 105
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -144,14 +140,12 @@  discard block
 block discarded – undo
144 140
 
145 141
 			$this->nextAction( $view, 'search', 'locale/language', null, 'delete' );
146 142
 			return;
147
-		}
148
-		catch( \Aimeos\MShop\Exception $e )
143
+		} catch( \Aimeos\MShop\Exception $e )
149 144
 		{
150 145
 			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
151 146
 			$view->errors = $view->get( 'errors', [] ) + $error;
152 147
 			$this->logException( $e );
153
-		}
154
-		catch( \Exception $e )
148
+		} catch( \Exception $e )
155 149
 		{
156 150
 			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
157 151
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -192,14 +186,12 @@  discard block
 block discarded – undo
192 186
 				$view->tabindex = ++$idx + 1;
193 187
 				$view->itemBody .= $client->get();
194 188
 			}
195
-		}
196
-		catch( \Aimeos\MShop\Exception $e )
189
+		} catch( \Aimeos\MShop\Exception $e )
197 190
 		{
198 191
 			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
199 192
 			$view->errors = $view->get( 'errors', [] ) + $error;
200 193
 			$this->logException( $e );
201
-		}
202
-		catch( \Exception $e )
194
+		} catch( \Exception $e )
203 195
 		{
204 196
 			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
205 197
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -238,18 +230,15 @@  discard block
 block discarded – undo
238 230
 
239 231
 			$this->nextAction( $view, $view->param( 'next' ), 'locale/language', $view->item->getId(), 'save' );
240 232
 			return;
241
-		}
242
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
233
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
243 234
 		{
244 235
 			// fall through to create
245
-		}
246
-		catch( \Aimeos\MShop\Exception $e )
236
+		} catch( \Aimeos\MShop\Exception $e )
247 237
 		{
248 238
 			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
249 239
 			$view->errors = $view->get( 'errors', [] ) + $error;
250 240
 			$this->logException( $e );
251
-		}
252
-		catch( \Exception $e )
241
+		} catch( \Exception $e )
253 242
 		{
254 243
 			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
255 244
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -291,14 +280,12 @@  discard block
 block discarded – undo
291 280
 			foreach( $this->getSubClients() as $client ) {
292 281
 				$view->itemBody .= $client->search();
293 282
 			}
294
-		}
295
-		catch( \Aimeos\MShop\Exception $e )
283
+		} catch( \Aimeos\MShop\Exception $e )
296 284
 		{
297 285
 			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
298 286
 			$view->errors = $view->get( 'errors', [] ) + $error;
299 287
 			$this->logException( $e );
300
-		}
301
-		catch( \Exception $e )
288
+		} catch( \Exception $e )
302 289
 		{
303 290
 			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
304 291
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Locale\Language;
12 12
 
13
-sprintf( 'locale/language' ); // for translation
13
+sprintf('locale/language'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,37 +35,37 @@  discard block
 block discarded – undo
35 35
 
36 36
 		try
37 37
 		{
38
-			if( ( $id = $view->param( 'id' ) ) === null ) {
39
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
38
+			if (($id = $view->param('id')) === null) {
39
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
40 40
 			}
41 41
 
42
-			$manager = \Aimeos\MShop::create( $context, 'locale/language' );
43
-			$view->item = $manager->getItem( $id );
42
+			$manager = \Aimeos\MShop::create($context, 'locale/language');
43
+			$view->item = $manager->getItem($id);
44 44
 
45
-			$view->itemData = $this->toArray( $view->item, true );
45
+			$view->itemData = $this->toArray($view->item, true);
46 46
 			$view->itemSubparts = $this->getSubClientNames();
47 47
 			$view->itemBody = '';
48 48
 
49
-			foreach( $this->getSubClients() as $idx => $client )
49
+			foreach ($this->getSubClients() as $idx => $client)
50 50
 			{
51 51
 				$view->tabindex = ++$idx + 1;
52 52
 				$view->itemBody .= $client->copy();
53 53
 			}
54 54
 		}
55
-		catch( \Aimeos\MShop\Exception $e )
55
+		catch (\Aimeos\MShop\Exception $e)
56 56
 		{
57
-			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
58
-			$view->errors = $view->get( 'errors', [] ) + $error;
59
-			$this->logException( $e );
57
+			$error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
58
+			$view->errors = $view->get('errors', []) + $error;
59
+			$this->logException($e);
60 60
 		}
61
-		catch( \Exception $e )
61
+		catch (\Exception $e)
62 62
 		{
63
-			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
64
-			$view->errors = $view->get( 'errors', [] ) + $error;
65
-			$this->logException( $e );
63
+			$error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
64
+			$view->errors = $view->get('errors', []) + $error;
65
+			$this->logException($e);
66 66
 		}
67 67
 
68
-		return $this->render( $view );
68
+		return $this->render($view);
69 69
 	}
70 70
 
71 71
 
@@ -81,36 +81,36 @@  discard block
 block discarded – undo
81 81
 
82 82
 		try
83 83
 		{
84
-			$data = $view->param( 'item', [] );
84
+			$data = $view->param('item', []);
85 85
 
86
-			if( !isset( $view->item ) ) {
87
-				$view->item = \Aimeos\MShop::create( $context, 'locale/language' )->createItem();
86
+			if (!isset($view->item)) {
87
+				$view->item = \Aimeos\MShop::create($context, 'locale/language')->createItem();
88 88
 			}
89 89
 
90 90
 			$view->itemSubparts = $this->getSubClientNames();
91 91
 			$view->itemData = $data;
92 92
 			$view->itemBody = '';
93 93
 
94
-			foreach( $this->getSubClients() as $idx => $client )
94
+			foreach ($this->getSubClients() as $idx => $client)
95 95
 			{
96 96
 				$view->tabindex = ++$idx + 1;
97 97
 				$view->itemBody .= $client->create();
98 98
 			}
99 99
 		}
100
-		catch( \Aimeos\MShop\Exception $e )
100
+		catch (\Aimeos\MShop\Exception $e)
101 101
 		{
102
-			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
103
-			$view->errors = $view->get( 'errors', [] ) + $error;
104
-			$this->logException( $e );
102
+			$error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
103
+			$view->errors = $view->get('errors', []) + $error;
104
+			$this->logException($e);
105 105
 		}
106
-		catch( \Exception $e )
106
+		catch (\Exception $e)
107 107
 		{
108
-			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
109
-			$view->errors = $view->get( 'errors', [] ) + $error;
110
-			$this->logException( $e );
108
+			$error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
109
+			$view->errors = $view->get('errors', []) + $error;
110
+			$this->logException($e);
111 111
 		}
112 112
 
113
-		return $this->render( $view );
113
+		return $this->render($view);
114 114
 	}
115 115
 
116 116
 
@@ -124,38 +124,38 @@  discard block
 block discarded – undo
124 124
 		$view = $this->getView();
125 125
 		$context = $this->getContext();
126 126
 
127
-		$manager = \Aimeos\MShop::create( $context, 'locale/language' );
127
+		$manager = \Aimeos\MShop::create($context, 'locale/language');
128 128
 		$manager->begin();
129 129
 
130 130
 		try
131 131
 		{
132
-			if( ( $id = $view->param( 'id' ) ) === null ) {
133
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
132
+			if (($id = $view->param('id')) === null) {
133
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
134 134
 			}
135 135
 
136
-			$view->item = $manager->getItem( $id );
136
+			$view->item = $manager->getItem($id);
137 137
 
138
-			foreach( $this->getSubClients() as $client ) {
138
+			foreach ($this->getSubClients() as $client) {
139 139
 				$client->delete();
140 140
 			}
141 141
 
142
-			$manager->deleteItem( $id );
142
+			$manager->deleteItem($id);
143 143
 			$manager->commit();
144 144
 
145
-			$this->nextAction( $view, 'search', 'locale/language', null, 'delete' );
145
+			$this->nextAction($view, 'search', 'locale/language', null, 'delete');
146 146
 			return;
147 147
 		}
148
-		catch( \Aimeos\MShop\Exception $e )
148
+		catch (\Aimeos\MShop\Exception $e)
149 149
 		{
150
-			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
151
-			$view->errors = $view->get( 'errors', [] ) + $error;
152
-			$this->logException( $e );
150
+			$error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
151
+			$view->errors = $view->get('errors', []) + $error;
152
+			$this->logException($e);
153 153
 		}
154
-		catch( \Exception $e )
154
+		catch (\Exception $e)
155 155
 		{
156
-			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
157
-			$view->errors = $view->get( 'errors', [] ) + $error;
158
-			$this->logException( $e );
156
+			$error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
157
+			$view->errors = $view->get('errors', []) + $error;
158
+			$this->logException($e);
159 159
 		}
160 160
 
161 161
 		$manager->rollback();
@@ -176,37 +176,37 @@  discard block
 block discarded – undo
176 176
 
177 177
 		try
178 178
 		{
179
-			if( ( $id = $view->param( 'id' ) ) === null ) {
180
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
179
+			if (($id = $view->param('id')) === null) {
180
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
181 181
 			}
182 182
 
183
-			$manager = \Aimeos\MShop::create( $context, 'locale/language' );
183
+			$manager = \Aimeos\MShop::create($context, 'locale/language');
184 184
 
185
-			$view->item = $manager->getItem( $id );
185
+			$view->item = $manager->getItem($id);
186 186
 			$view->itemSubparts = $this->getSubClientNames();
187
-			$view->itemData = $this->toArray( $view->item );
187
+			$view->itemData = $this->toArray($view->item);
188 188
 			$view->itemBody = '';
189 189
 
190
-			foreach( $this->getSubClients() as $idx => $client )
190
+			foreach ($this->getSubClients() as $idx => $client)
191 191
 			{
192 192
 				$view->tabindex = ++$idx + 1;
193 193
 				$view->itemBody .= $client->get();
194 194
 			}
195 195
 		}
196
-		catch( \Aimeos\MShop\Exception $e )
196
+		catch (\Aimeos\MShop\Exception $e)
197 197
 		{
198
-			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
199
-			$view->errors = $view->get( 'errors', [] ) + $error;
200
-			$this->logException( $e );
198
+			$error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
199
+			$view->errors = $view->get('errors', []) + $error;
200
+			$this->logException($e);
201 201
 		}
202
-		catch( \Exception $e )
202
+		catch (\Exception $e)
203 203
 		{
204
-			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
205
-			$view->errors = $view->get( 'errors', [] ) + $error;
206
-			$this->logException( $e );
204
+			$error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
205
+			$view->errors = $view->get('errors', []) + $error;
206
+			$this->logException($e);
207 207
 		}
208 208
 
209
-		return $this->render( $view );
209
+		return $this->render($view);
210 210
 	}
211 211
 
212 212
 
@@ -220,40 +220,40 @@  discard block
 block discarded – undo
220 220
 		$view = $this->getView();
221 221
 		$context = $this->getContext();
222 222
 
223
-		$manager = \Aimeos\MShop::create( $context, 'locale/language' );
223
+		$manager = \Aimeos\MShop::create($context, 'locale/language');
224 224
 		$manager->begin();
225 225
 
226 226
 		try
227 227
 		{
228
-			$item = $this->fromArray( $view->param( 'item', [] ) );
229
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
228
+			$item = $this->fromArray($view->param('item', []));
229
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
230 230
 			$view->itemBody = '';
231 231
 
232
-			foreach( $this->getSubClients() as $client ) {
232
+			foreach ($this->getSubClients() as $client) {
233 233
 				$view->itemBody .= $client->save();
234 234
 			}
235 235
 
236
-			$manager->saveItem( clone $view->item );
236
+			$manager->saveItem(clone $view->item);
237 237
 			$manager->commit();
238 238
 
239
-			$this->nextAction( $view, $view->param( 'next' ), 'locale/language', $view->item->getId(), 'save' );
239
+			$this->nextAction($view, $view->param('next'), 'locale/language', $view->item->getId(), 'save');
240 240
 			return;
241 241
 		}
242
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
242
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
243 243
 		{
244 244
 			// fall through to create
245 245
 		}
246
-		catch( \Aimeos\MShop\Exception $e )
246
+		catch (\Aimeos\MShop\Exception $e)
247 247
 		{
248
-			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
249
-			$view->errors = $view->get( 'errors', [] ) + $error;
250
-			$this->logException( $e );
248
+			$error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
249
+			$view->errors = $view->get('errors', []) + $error;
250
+			$this->logException($e);
251 251
 		}
252
-		catch( \Exception $e )
252
+		catch (\Exception $e)
253 253
 		{
254
-			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
255
-			$view->errors = $view->get( 'errors', [] ) + $error;
256
-			$this->logException( $e );
254
+			$error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
255
+			$view->errors = $view->get('errors', []) + $error;
256
+			$this->logException($e);
257 257
 		}
258 258
 
259 259
 		$manager->rollback();
@@ -275,34 +275,34 @@  discard block
 block discarded – undo
275 275
 		try
276 276
 		{
277 277
 			$total = 0;
278
-			$params = $this->storeSearchParams( $view->param(), 'locale/language' );
279
-			$manager = \Aimeos\MShop::create( $context, 'locale/language' );
278
+			$params = $this->storeSearchParams($view->param(), 'locale/language');
279
+			$manager = \Aimeos\MShop::create($context, 'locale/language');
280 280
 
281 281
 			$search = $manager->createSearch();
282
-			$search->setSortations( [$search->sort( '-', 'locale.language.status'), $search->sort( '+', 'locale.language.id')] );
283
-			$search = $this->initCriteria( $search, $params );
282
+			$search->setSortations([$search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.id')]);
283
+			$search = $this->initCriteria($search, $params);
284 284
 
285
-			$view->items = $manager->searchItems( $search, [], $total );
286
-			$view->filterAttributes = $manager->getSearchAttributes( true );
285
+			$view->items = $manager->searchItems($search, [], $total);
286
+			$view->filterAttributes = $manager->getSearchAttributes(true);
287 287
 			$view->filterOperators = $search->getOperators();
288 288
 			$view->total = $total;
289 289
 			$view->itemBody = '';
290 290
 
291
-			foreach( $this->getSubClients() as $client ) {
291
+			foreach ($this->getSubClients() as $client) {
292 292
 				$view->itemBody .= $client->search();
293 293
 			}
294 294
 		}
295
-		catch( \Aimeos\MShop\Exception $e )
295
+		catch (\Aimeos\MShop\Exception $e)
296 296
 		{
297
-			$error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
298
-			$view->errors = $view->get( 'errors', [] ) + $error;
299
-			$this->logException( $e );
297
+			$error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
298
+			$view->errors = $view->get('errors', []) + $error;
299
+			$this->logException($e);
300 300
 		}
301
-		catch( \Exception $e )
301
+		catch (\Exception $e)
302 302
 		{
303
-			$error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
304
-			$view->errors = $view->get( 'errors', [] ) + $error;
305
-			$this->logException( $e );
303
+			$error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
304
+			$view->errors = $view->get('errors', []) + $error;
305
+			$this->logException($e);
306 306
 		}
307 307
 
308 308
 		/** admin/jqadm/locale/language/template-list
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$tplconf = 'admin/jqadm/locale/language/template-list';
328 328
 		$default = 'locale/language/list-standard';
329 329
 
330
-		return $view->render( $view->config( $tplconf, $default ) );
330
+		return $view->render($view->config($tplconf, $default));
331 331
 	}
332 332
 
333 333
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 * @param string|null $name Name of the sub-client (Default if null)
339 339
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
340 340
 	 */
341
-	public function getSubClient( $type, $name = null )
341
+	public function getSubClient($type, $name = null)
342 342
 	{
343 343
 		/** admin/jqadm/locale/language/decorators/excludes
344 344
 		 * Excludes decorators added by the "common" option from the locale JQAdm client
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 		 * @see admin/jqadm/locale/language/decorators/excludes
414 414
 		 * @see admin/jqadm/locale/language/decorators/global
415 415
 		 */
416
-		return $this->createSubClient( 'locale/language' . $type, $name );
416
+		return $this->createSubClient('locale/language' . $type, $name);
417 417
 	}
418 418
 
419 419
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		 * @since 2017.10
458 458
 		 * @category Developer
459 459
 		 */
460
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/locale/language/standard/subparts', [] );
460
+		return $this->getContext()->getConfig()->get('admin/jqadm/locale/language/standard/subparts', []);
461 461
 	}
462 462
 
463 463
 
@@ -468,17 +468,17 @@  discard block
 block discarded – undo
468 468
 	 * @param string[] Data array
469 469
 	 * @return \Aimeos\MShop\Locale\Item\Iface New locale item object
470 470
 	 */
471
-	protected function fromArray( array $data )
471
+	protected function fromArray(array $data)
472 472
 	{
473
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'locale/language' );
473
+		$manager = \Aimeos\MShop::create($this->getContext(), 'locale/language');
474 474
 
475
-		if( isset( $data['locale.language.id'] ) && $data['locale.language.id'] != '' ) {
476
-			$item = $manager->getItem( $data['locale.language.id'] );
475
+		if (isset($data['locale.language.id']) && $data['locale.language.id'] != '') {
476
+			$item = $manager->getItem($data['locale.language.id']);
477 477
 		} else {
478 478
 			$item = $manager->createItem();
479 479
 		}
480 480
 
481
-		$item->fromArray( $data );
481
+		$item->fromArray($data);
482 482
 
483 483
 		return $item;
484 484
 	}
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
 	 * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object
491 491
 	 * @return string[] Multi-dimensional associative list of item data
492 492
 	 */
493
-	protected function toArray( \Aimeos\MShop\Locale\Item\Language\Iface $item, $copy = false )
493
+	protected function toArray(\Aimeos\MShop\Locale\Item\Language\Iface $item, $copy = false)
494 494
 	{
495
-		$data = $item->toArray( true );
495
+		$data = $item->toArray(true);
496 496
 
497
-		if( $copy === true )
497
+		if ($copy === true)
498 498
 		{
499 499
 			$data['locale.language.id'] = '';
500 500
 			$data['locale.language.code'] = '';
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
511 511
 	 * @return string HTML output
512 512
 	 */
513
-	protected function render( \Aimeos\MW\View\Iface $view )
513
+	protected function render(\Aimeos\MW\View\Iface $view)
514 514
 	{
515 515
 		/** admin/jqadm/locale/language/template-item
516 516
 		 * Relative path to the HTML body template for the locale item.
@@ -534,6 +534,6 @@  discard block
 block discarded – undo
534 534
 		$tplconf = 'admin/jqadm/locale/language/template-item';
535 535
 		$default = 'locale/language/item-standard';
536 536
 
537
-		return $view->render( $view->config( $tplconf, $default ) );
537
+		return $view->render($view->config($tplconf, $default));
538 538
 	}
539 539
 }
Please login to merge, or discard this patch.