Completed
Push — master ( 06a6c1...f03436 )
by Aimeos
03:56
created
admin/jqadm/templates/catalog/item-standard.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,9 +85,12 @@
 block discarded – undo
85 85
 		<div class="item-actions">
86 86
 			<?php if( isset( $this->itemData ) ) : ?>
87 87
 				<?= $this->partial( $this->config( 'admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php' ), ['params' => $params] ); ?>
88
-			<?php else : ?>
88
+			<?php else {
89
+	: ?>
89 90
 				<span class="placeholder">&nbsp;</span>
90
-			<?php endif; ?>
91
+			<?php endif;
92
+}
93
+?>
91 94
 		</div>
92 95
 	</nav>
93 96
 
Please login to merge, or discard this patch.
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -5,39 +5,39 @@  discard block
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2017-2018
6 6
  */
7 7
 
8
-$selected = function( $key, $code ) {
9
-	return ( $key == $code ? 'selected="selected"' : '' );
8
+$selected = function($key, $code) {
9
+	return ($key == $code ? 'selected="selected"' : '');
10 10
 };
11 11
 
12 12
 
13 13
 $enc = $this->encoder();
14 14
 
15
-$target = $this->config( 'admin/jqadm/url/save/target' );
16
-$cntl = $this->config( 'admin/jqadm/url/save/controller', 'Jqadm' );
17
-$action = $this->config( 'admin/jqadm/url/save/action', 'save' );
18
-$config = $this->config( 'admin/jqadm/url/save/config', [] );
15
+$target = $this->config('admin/jqadm/url/save/target');
16
+$cntl = $this->config('admin/jqadm/url/save/controller', 'Jqadm');
17
+$action = $this->config('admin/jqadm/url/save/action', 'save');
18
+$config = $this->config('admin/jqadm/url/save/config', []);
19 19
 
20
-$getTarget = $this->config( 'admin/jqadm/url/get/target' );
21
-$getCntl = $this->config( 'admin/jqadm/url/get/controller', 'Jqadm' );
22
-$getAction = $this->config( 'admin/jqadm/url/get/action', 'get' );
23
-$getConfig = $this->config( 'admin/jqadm/url/get/config', [] );
20
+$getTarget = $this->config('admin/jqadm/url/get/target');
21
+$getCntl = $this->config('admin/jqadm/url/get/controller', 'Jqadm');
22
+$getAction = $this->config('admin/jqadm/url/get/action', 'get');
23
+$getConfig = $this->config('admin/jqadm/url/get/config', []);
24 24
 
25
-$listTarget = $this->config( 'admin/jqadm/url/search/target' );
26
-$listCntl = $this->config( 'admin/jqadm/url/search/controller', 'Jqadm' );
27
-$listAction = $this->config( 'admin/jqadm/url/search/action', 'search' );
28
-$listConfig = $this->config( 'admin/jqadm/url/search/config', [] );
25
+$listTarget = $this->config('admin/jqadm/url/search/target');
26
+$listCntl = $this->config('admin/jqadm/url/search/controller', 'Jqadm');
27
+$listAction = $this->config('admin/jqadm/url/search/action', 'search');
28
+$listConfig = $this->config('admin/jqadm/url/search/config', []);
29 29
 
30
-$newTarget = $this->config( 'admin/jqadm/url/create/target' );
31
-$newCntl = $this->config( 'admin/jqadm/url/create/controller', 'Jqadm' );
32
-$newAction = $this->config( 'admin/jqadm/url/create/action', 'create' );
33
-$newConfig = $this->config( 'admin/jqadm/url/create/config', [] );
30
+$newTarget = $this->config('admin/jqadm/url/create/target');
31
+$newCntl = $this->config('admin/jqadm/url/create/controller', 'Jqadm');
32
+$newAction = $this->config('admin/jqadm/url/create/action', 'create');
33
+$newConfig = $this->config('admin/jqadm/url/create/config', []);
34 34
 
35
-$jsonTarget = $this->config( 'admin/jsonadm/url/target' );
36
-$jsonCntl = $this->config( 'admin/jsonadm/url/controller', 'Jsonadm' );
37
-$jsonAction = $this->config( 'admin/jsonadm/url/action', 'get' );
38
-$jsonConfig = $this->config( 'admin/jsonadm/url/config', [] );
35
+$jsonTarget = $this->config('admin/jsonadm/url/target');
36
+$jsonCntl = $this->config('admin/jsonadm/url/controller', 'Jsonadm');
37
+$jsonAction = $this->config('admin/jsonadm/url/action', 'get');
38
+$jsonConfig = $this->config('admin/jsonadm/url/config', []);
39 39
 
40
-$params = $this->get( 'pageParams', [] );
40
+$params = $this->get('pageParams', []);
41 41
 
42 42
 
43 43
 /** admin/jqadm/catalog/item/config/suggest
@@ -51,42 +51,42 @@  discard block
 block discarded – undo
51 51
  * @category Developer
52 52
  * @see admin/jqadm/product/item/config/suggest
53 53
  */
54
-$cfgSuggest = $this->config( 'admin/jqadm/catalog/item/config/suggest', ['css-class'] );
54
+$cfgSuggest = $this->config('admin/jqadm/catalog/item/config/suggest', ['css-class']);
55 55
 
56 56
 
57 57
 ?>
58
-<?php $this->block()->start( 'jqadm_content' ); ?>
58
+<?php $this->block()->start('jqadm_content'); ?>
59 59
 
60 60
 <form class="item item-catalog item-tree form-horizontal" method="POST" enctype="multipart/form-data"
61
-	action="<?= $enc->attr( $this->url( $target, $cntl, $action, $params, [], $config ) ); ?>"
62
-	data-rootid="<?= $enc->attr( $this->get( 'itemRootId' ) ); ?>"
63
-	data-geturl="<?= $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['resource' => 'catalog', 'id' => '_ID_'] + $params, [], $getConfig ) ); ?>"
64
-	data-createurl="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, ['resource' => 'catalog', 'id' => '_ID_'] + $params, [], $newConfig ) ); ?>"
65
-	data-jsonurl="<?= $enc->attr( $this->url( $jsonTarget, $jsonCntl, $jsonAction, ['resource' => 'catalog'], [], $jsonConfig ) ); ?>"
66
-	data-idname="<?= $this->formparam( 'id' ); ?>" >
67
-
68
-	<input id="item-id" type="hidden" name="<?= $enc->attr( $this->formparam( array( 'item', 'catalog.id' ) ) ); ?>"
69
-		value="<?= $enc->attr( $this->get( 'itemData/catalog.id' ) ); ?>" />
70
-	<input id="item-parentid" type="hidden" name="<?= $enc->attr( $this->formparam( array( 'item', 'catalog.parentid' ) ) ); ?>"
71
-		value="<?= $enc->attr( $this->get( 'itemData/catalog.parentid', $this->param( 'id', $this->get( 'itemRootId' ) ) ) ); ?>" />
72
-	<input id="item-next" type="hidden" name="<?= $enc->attr( $this->formparam( array( 'next' ) ) ); ?>" value="get" />
61
+	action="<?= $enc->attr($this->url($target, $cntl, $action, $params, [], $config)); ?>"
62
+	data-rootid="<?= $enc->attr($this->get('itemRootId')); ?>"
63
+	data-geturl="<?= $enc->attr($this->url($getTarget, $getCntl, $getAction, ['resource' => 'catalog', 'id' => '_ID_'] + $params, [], $getConfig)); ?>"
64
+	data-createurl="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, ['resource' => 'catalog', 'id' => '_ID_'] + $params, [], $newConfig)); ?>"
65
+	data-jsonurl="<?= $enc->attr($this->url($jsonTarget, $jsonCntl, $jsonAction, ['resource' => 'catalog'], [], $jsonConfig)); ?>"
66
+	data-idname="<?= $this->formparam('id'); ?>" >
67
+
68
+	<input id="item-id" type="hidden" name="<?= $enc->attr($this->formparam(array('item', 'catalog.id'))); ?>"
69
+		value="<?= $enc->attr($this->get('itemData/catalog.id')); ?>" />
70
+	<input id="item-parentid" type="hidden" name="<?= $enc->attr($this->formparam(array('item', 'catalog.parentid'))); ?>"
71
+		value="<?= $enc->attr($this->get('itemData/catalog.parentid', $this->param('id', $this->get('itemRootId')))); ?>" />
72
+	<input id="item-next" type="hidden" name="<?= $enc->attr($this->formparam(array('next'))); ?>" value="get" />
73 73
 	<?= $this->csrf()->formfield(); ?>
74 74
 
75 75
 	<nav class="main-navbar">
76 76
 		<span class="navbar-brand">
77
-			<?= $enc->html( $this->translate( 'admin', 'Catalog' ) ); ?>:
78
-			<?php if( $this->get( 'itemData/catalog.id' ) ) : ?>
79
-				<?= $enc->html( $this->get( 'itemData/catalog.id' ) ); ?> -
77
+			<?= $enc->html($this->translate('admin', 'Catalog')); ?>:
78
+			<?php if ($this->get('itemData/catalog.id')) : ?>
79
+				<?= $enc->html($this->get('itemData/catalog.id')); ?> -
80 80
 			<?php endif; ?>
81
-			<?= $enc->html( $this->get( 'itemData/catalog.label', $this->translate( 'admin', 'New' ) ) ); ?>
82
-			<?php if( $this->get( 'itemData/catalog.siteid' ) ) : ?>
83
-				<span class="navbar-secondary">(<?= $enc->html( $this->site()->match( $this->get( 'itemData/catalog.siteid' ) ) ); ?>)</span>
81
+			<?= $enc->html($this->get('itemData/catalog.label', $this->translate('admin', 'New'))); ?>
82
+			<?php if ($this->get('itemData/catalog.siteid')) : ?>
83
+				<span class="navbar-secondary">(<?= $enc->html($this->site()->match($this->get('itemData/catalog.siteid'))); ?>)</span>
84 84
 			<?php endif; ?>
85 85
 		</span>
86 86
 
87 87
 		<div class="item-actions">
88
-			<?php if( isset( $this->itemData ) ) : ?>
89
-				<?= $this->partial( $this->config( 'admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php' ), ['params' => $params] ); ?>
88
+			<?php if (isset($this->itemData)) : ?>
89
+				<?= $this->partial($this->config('admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php'), ['params' => $params]); ?>
90 90
 			<?php else : ?>
91 91
 				<span class="placeholder">&nbsp;</span>
92 92
 			<?php endif; ?>
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 					<span class="btn btn-secondary fa expand-all" tabindex="1"></span>
102 102
 					<span class="btn btn-secondary fa collapse-all" tabindex="1"></span>
103 103
 				</div>
104
-				<input type="text" class="form-control search-input" tabindex="1" placeholder="<?= $enc->attr( $this->translate( 'admin', 'Find category' ) ); ?>">
104
+				<input type="text" class="form-control search-input" tabindex="1" placeholder="<?= $enc->attr($this->translate('admin', 'Find category')); ?>">
105 105
 				<div class="input-group-append">
106 106
 					<span class="btn btn-secondary fa act-delete " tabindex="1"></span>
107 107
 					<span class="btn btn-primary fa act-add" tabindex="1"></span>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			</div>
112 112
 		</div>
113 113
 
114
-		<?php if( isset( $this->itemData ) ) : ?>
114
+		<?php if (isset($this->itemData)) : ?>
115 115
 
116 116
 			<div class="col-lg-9 catalog-content">
117 117
 				<div class="row">
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
 
122 122
 							<li class="nav-item basic">
123 123
 								<a class="nav-link active" href="#basic" data-toggle="tab" role="tab" aria-expanded="true" aria-controls="basic" tabindex="1">
124
-									<?= $enc->html( $this->translate( 'admin', 'Basic' ) ); ?>
124
+									<?= $enc->html($this->translate('admin', 'Basic')); ?>
125 125
 								</a>
126 126
 							</li>
127 127
 
128
-							<?php foreach( array_values( $this->get( 'itemSubparts', [] ) ) as $idx => $subpart ) : ?>
129
-								<li class="nav-item <?= $enc->attr( $subpart ); ?>">
130
-									<a class="nav-link" href="#<?= $enc->attr( $subpart ); ?>" data-toggle="tab" role="tab" tabindex="<?= ++$idx+1; ?>">
131
-										<?= $enc->html( $this->translate( 'admin', $subpart ) ); ?>
128
+							<?php foreach (array_values($this->get('itemSubparts', [])) as $idx => $subpart) : ?>
129
+								<li class="nav-item <?= $enc->attr($subpart); ?>">
130
+									<a class="nav-link" href="#<?= $enc->attr($subpart); ?>" data-toggle="tab" role="tab" tabindex="<?= ++$idx + 1; ?>">
131
+										<?= $enc->html($this->translate('admin', $subpart)); ?>
132 132
 									</a>
133 133
 								</li>
134 134
 							<?php endforeach; ?>
@@ -137,16 +137,16 @@  discard block
 block discarded – undo
137 137
 
138 138
 						<div class="item-meta text-muted">
139 139
 							<small>
140
-								<?= $enc->html( $this->translate( 'admin', 'Modified' ) ); ?>:
141
-								<span class="meta-value"><?= $enc->html( $this->get( 'itemData/catalog.mtime' ) ); ?></span>
140
+								<?= $enc->html($this->translate('admin', 'Modified')); ?>:
141
+								<span class="meta-value"><?= $enc->html($this->get('itemData/catalog.mtime')); ?></span>
142 142
 							</small>
143 143
 							<small>
144
-								<?= $enc->html( $this->translate( 'admin', 'Created' ) ); ?>:
145
-								<span class="meta-value"><?= $enc->html( $this->get( 'itemData/catalog.ctime' ) ); ?></span>
144
+								<?= $enc->html($this->translate('admin', 'Created')); ?>:
145
+								<span class="meta-value"><?= $enc->html($this->get('itemData/catalog.ctime')); ?></span>
146 146
 							</small>
147 147
 							<small>
148
-								<?= $enc->html( $this->translate( 'admin', 'Editor' ) ); ?>:
149
-								<span class="meta-value"><?= $enc->html( $this->get( 'itemData/catalog.editor' ) ); ?></span>
148
+								<?= $enc->html($this->translate('admin', 'Editor')); ?>:
149
+								<span class="meta-value"><?= $enc->html($this->get('itemData/catalog.editor')); ?></span>
150 150
 							</small>
151 151
 						</div>
152 152
 					</div>
@@ -155,89 +155,89 @@  discard block
 block discarded – undo
155 155
 
156 156
 						<div id="basic" class="row item-basic tab-pane fade show active" role="tabpanel" aria-labelledby="basic">
157 157
 
158
-							<div class="col-xl-6 content-block <?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?>">
158
+							<div class="col-xl-6 content-block <?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?>">
159 159
 								<div class="form-group row mandatory">
160
-									<label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label>
160
+									<label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label>
161 161
 									<div class="col-sm-8">
162 162
 										<select class="form-control custom-select item-status" required="required" tabindex="1"
163
-											name="<?= $enc->attr( $this->formparam( array( 'item', 'catalog.status' ) ) ); ?>"
164
-											<?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?> >
163
+											name="<?= $enc->attr($this->formparam(array('item', 'catalog.status'))); ?>"
164
+											<?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?> >
165 165
 											<option value="">
166
-												<?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?>
166
+												<?= $enc->html($this->translate('admin', 'Please select')); ?>
167 167
 											</option>
168
-											<option value="1" <?= $selected( $this->get( 'itemData/catalog.status', 1 ), 1 ); ?> >
169
-												<?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?>
168
+											<option value="1" <?= $selected($this->get('itemData/catalog.status', 1), 1); ?> >
169
+												<?= $enc->html($this->translate('mshop/code', 'status:1')); ?>
170 170
 											</option>
171
-											<option value="0" <?= $selected( $this->get( 'itemData/catalog.status', 1 ), 0 ); ?> >
172
-												<?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?>
171
+											<option value="0" <?= $selected($this->get('itemData/catalog.status', 1), 0); ?> >
172
+												<?= $enc->html($this->translate('mshop/code', 'status:0')); ?>
173 173
 											</option>
174
-											<option value="-1" <?= $selected( $this->get( 'itemData/catalog.status', 1 ), -1 ); ?> >
175
-												<?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?>
174
+											<option value="-1" <?= $selected($this->get('itemData/catalog.status', 1), -1); ?> >
175
+												<?= $enc->html($this->translate('mshop/code', 'status:-1')); ?>
176 176
 											</option>
177
-											<option value="-2" <?= $selected( $this->get( 'itemData/catalog.status', 1 ), -2 ); ?> >
178
-												<?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?>
177
+											<option value="-2" <?= $selected($this->get('itemData/catalog.status', 1), -2); ?> >
178
+												<?= $enc->html($this->translate('mshop/code', 'status:-2')); ?>
179 179
 											</option>
180 180
 										</select>
181 181
 									</div>
182 182
 								</div>
183 183
 								<div class="form-group row mandatory">
184
-									<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Code' ) ); ?></label>
184
+									<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Code')); ?></label>
185 185
 									<div class="col-sm-8">
186 186
 										<input class="form-control item-code" type="text" required="required" tabindex="1"
187
-											name="<?= $enc->attr( $this->formparam( array( 'item', 'catalog.code' ) ) ); ?>"
188
-											placeholder="<?= $enc->attr( $this->translate( 'admin', 'Unique category code (required)' ) ); ?>"
189
-											value="<?= $enc->attr( $this->get( 'itemData/catalog.code' ) ); ?>"
190
-											<?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?> />
187
+											name="<?= $enc->attr($this->formparam(array('item', 'catalog.code'))); ?>"
188
+											placeholder="<?= $enc->attr($this->translate('admin', 'Unique category code (required)')); ?>"
189
+											value="<?= $enc->attr($this->get('itemData/catalog.code')); ?>"
190
+											<?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?> />
191 191
 									</div>
192 192
 									<div class="col-sm-12 form-text text-muted help-text">
193
-										<?= $enc->html( $this->translate( 'admin', 'Unique category code, either from external system or self-invented' ) ); ?>
193
+										<?= $enc->html($this->translate('admin', 'Unique category code, either from external system or self-invented')); ?>
194 194
 									</div>
195 195
 								</div>
196 196
 								<div class="form-group row mandatory">
197
-									<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Label' ) ); ?></label>
197
+									<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Label')); ?></label>
198 198
 									<div class="col-sm-8">
199 199
 										<input class="form-control item-label" type="text" required="required" tabindex="1"
200
-											name="<?= $this->formparam( array( 'item', 'catalog.label' ) ); ?>"
201
-											placeholder="<?= $enc->attr( $this->translate( 'admin', 'Internal name (required)' ) ); ?>"
202
-											value="<?= $enc->attr( $this->get( 'itemData/catalog.label' ) ); ?>"
203
-											<?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?> />
200
+											name="<?= $this->formparam(array('item', 'catalog.label')); ?>"
201
+											placeholder="<?= $enc->attr($this->translate('admin', 'Internal name (required)')); ?>"
202
+											value="<?= $enc->attr($this->get('itemData/catalog.label')); ?>"
203
+											<?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?> />
204 204
 									</div>
205 205
 									<div class="col-sm-12 form-text text-muted help-text">
206
-										<?= $enc->html( $this->translate( 'admin', 'Internal category name, will be used on the web site if no name for the language is available' ) ); ?>
206
+										<?= $enc->html($this->translate('admin', 'Internal category name, will be used on the web site if no name for the language is available')); ?>
207 207
 									</div>
208 208
 								</div>
209 209
 								<div class="form-group row optional warning">
210
-									<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'URL target' ) ); ?></label>
210
+									<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'URL target')); ?></label>
211 211
 									<div class="col-sm-8">
212 212
 										<input class="form-control item-target" type="text" tabindex="1"
213
-											name="<?= $enc->attr( $this->formparam( array( 'item', 'catalog.target' ) ) ); ?>"
214
-											placeholder="<?= $enc->attr( $this->translate( 'admin', 'Route or page ID (optional)' ) ); ?>"
215
-											value="<?= $enc->attr( $this->get( 'itemData/catalog.target' ) ); ?>"
216
-											<?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?> />
213
+											name="<?= $enc->attr($this->formparam(array('item', 'catalog.target'))); ?>"
214
+											placeholder="<?= $enc->attr($this->translate('admin', 'Route or page ID (optional)')); ?>"
215
+											value="<?= $enc->attr($this->get('itemData/catalog.target')); ?>"
216
+											<?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?> />
217 217
 									</div>
218 218
 									<div class="col-sm-12 form-text text-muted help-text">
219
-										<?= $enc->html( $this->translate( 'admin', 'Route name or page ID of the category page if this category should shown on a different page' ) ); ?>
219
+										<?= $enc->html($this->translate('admin', 'Route name or page ID of the category page if this category should shown on a different page')); ?>
220 220
 									</div>
221 221
 								</div>
222 222
 							</div><!--
223 223
 
224
-							--><div class="col-xl-6 content-block <?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?>">
225
-								<table class="item-config table table-striped" data-keys="<?= $enc->attr( json_encode( $cfgSuggest ) ); ?>">
224
+							--><div class="col-xl-6 content-block <?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?>">
225
+								<table class="item-config table table-striped" data-keys="<?= $enc->attr(json_encode($cfgSuggest)); ?>">
226 226
 									<thead>
227 227
 										<tr>
228 228
 											<th>
229
-												<span class="help"><?= $enc->html( $this->translate( 'admin', 'Option' ) ); ?></span>
229
+												<span class="help"><?= $enc->html($this->translate('admin', 'Option')); ?></span>
230 230
 												<div class="form-text text-muted help-text">
231
-													<?= $enc->html( $this->translate( 'admin', 'Category specific configuration options, will be available as key/value pairs in the templates' ) ); ?>
231
+													<?= $enc->html($this->translate('admin', 'Category specific configuration options, will be available as key/value pairs in the templates')); ?>
232 232
 												</div>
233 233
 											</th>
234 234
 											<th>
235
-												<?= $enc->html( $this->translate( 'admin', 'Value' ) ); ?>
235
+												<?= $enc->html($this->translate('admin', 'Value')); ?>
236 236
 											</th>
237 237
 											<th class="actions">
238
-												<?php if( !$this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ) ) : ?>
238
+												<?php if (!$this->site()->readonly($this->get('itemData/catalog.siteid'))) : ?>
239 239
 													<div class="btn act-add fa" tabindex="1"
240
-														title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>">
240
+														title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>">
241 241
 													</div>
242 242
 												<?php endif; ?>
243 243
 											</th>
@@ -245,24 +245,24 @@  discard block
 block discarded – undo
245 245
 									</thead>
246 246
 									<tbody>
247 247
 
248
-										<?php foreach( (array) $this->get( 'itemData/config/key', [] ) as $idx => $key ) : ?>
248
+										<?php foreach ((array) $this->get('itemData/config/key', []) as $idx => $key) : ?>
249 249
 											<tr class="config-item">
250 250
 												<td>
251 251
 													<input type="text" class="config-key form-control" tabindex="1"
252
-														name="<?= $enc->attr( $this->formparam( array( 'item', 'config', 'key', '' ) ) ); ?>"
253
-														value="<?= $enc->attr( $this->get( 'itemData/config/key/' . $idx, $key ) ); ?>"
254
-														<?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?> />
252
+														name="<?= $enc->attr($this->formparam(array('item', 'config', 'key', ''))); ?>"
253
+														value="<?= $enc->attr($this->get('itemData/config/key/' . $idx, $key)); ?>"
254
+														<?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?> />
255 255
 												</td>
256 256
 												<td>
257 257
 													<input type="text" class="config-value form-control" tabindex="1"
258
-														name="<?= $enc->attr( $this->formparam( array( 'item', 'config', 'val', '' ) ) ); ?>"
259
-														value="<?= $enc->attr( $this->get( 'itemData/config/val/' . $idx ) ); ?>"
260
-														<?= $this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ); ?> />
258
+														name="<?= $enc->attr($this->formparam(array('item', 'config', 'val', ''))); ?>"
259
+														value="<?= $enc->attr($this->get('itemData/config/val/' . $idx)); ?>"
260
+														<?= $this->site()->readonly($this->get('itemData/catalog.siteid')); ?> />
261 261
 												</td>
262 262
 												<td class="actions">
263
-													<?php if( !$this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ) ) : ?>
263
+													<?php if (!$this->site()->readonly($this->get('itemData/catalog.siteid'))) : ?>
264 264
 														<div class="btn act-delete fa" tabindex="1"
265
-															title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>">
265
+															title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>">
266 266
 														</div>
267 267
 													<?php endif; ?>
268 268
 												</td>
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
 										<tr class="prototype">
273 273
 											<td>
274 274
 												<input type="text" class="config-key form-control" tabindex="1" disabled="disabled"
275
-													name="<?= $enc->attr( $this->formparam( array( 'item', 'config', 'key', '' ) ) ); ?>" />
275
+													name="<?= $enc->attr($this->formparam(array('item', 'config', 'key', ''))); ?>" />
276 276
 											</td>
277 277
 											<td>
278 278
 												<input type="text" class="config-value form-control" tabindex="1" disabled="disabled"
279
-													name="<?= $enc->attr( $this->formparam( array( 'item', 'config', 'val', '' ) ) ); ?>" />
279
+													name="<?= $enc->attr($this->formparam(array('item', 'config', 'val', ''))); ?>" />
280 280
 											</td>
281 281
 											<td class="actions">
282
-												<?php if( !$this->site()->readonly( $this->get( 'itemData/catalog.siteid' ) ) ) : ?>
282
+												<?php if (!$this->site()->readonly($this->get('itemData/catalog.siteid'))) : ?>
283 283
 													<div class="btn act-delete fa" tabindex="1"
284
-														title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>">
284
+														title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>">
285 285
 													</div>
286 286
 												<?php endif; ?>
287 287
 											</td>
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 
293 293
 						</div>
294 294
 
295
-						<?= $this->get( 'itemBody' ); ?>
295
+						<?= $this->get('itemBody'); ?>
296 296
 
297 297
 					</div>
298 298
 
299 299
 					<div class="item-actions">
300
-						<?= $this->partial( $this->config( 'admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php' ), ['params' => $params] ); ?>
300
+						<?= $this->partial($this->config('admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php'), ['params' => $params]); ?>
301 301
 					</div>
302 302
 				</div>
303 303
 
@@ -311,4 +311,4 @@  discard block
 block discarded – undo
311 311
 <?php $this->block()->stop(); ?>
312 312
 
313 313
 
314
-<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?>
314
+<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?>
Please login to merge, or discard this patch.
admin/jqadm/templates/dashboard/list-order-standard.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@
 block discarded – undo
6 6
  */
7 7
 
8 8
 $enc = $this->encoder();
9
-$currencies = array_keys( $this->get( 'orderCurrencyItems', [] ) );
9
+$currencies = array_keys($this->get('orderCurrencyItems', []));
10 10
 
11 11
 
12 12
 ?>
13
-<div class="dashboard-order row" data-currencies="<?= $enc->attr( json_encode( $currencies ) ) ?>">
14
-	<?= $this->get( 'orderBody' ); ?>
13
+<div class="dashboard-order row" data-currencies="<?= $enc->attr(json_encode($currencies)) ?>">
14
+	<?= $this->get('orderBody'); ?>
15 15
 </div>
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Plugin/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -92,14 +92,12 @@  discard block
 block discarded – undo
92 92
 				$view->tabindex = ++$idx + 1;
93 93
 				$view->itemBody .= $client->copy();
94 94
 			}
95
-		}
96
-		catch( \Aimeos\MShop\Exception $e )
95
+		} catch( \Aimeos\MShop\Exception $e )
97 96
 		{
98 97
 			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
99 98
 			$view->errors = $view->get( 'errors', [] ) + $error;
100 99
 			$this->logException( $e );
101
-		}
102
-		catch( \Exception $e )
100
+		} catch( \Exception $e )
103 101
 		{
104 102
 			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
105 103
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -144,14 +142,12 @@  discard block
 block discarded – undo
144 142
 				$view->tabindex = ++$idx + 1;
145 143
 				$view->itemBody .= $client->create();
146 144
 			}
147
-		}
148
-		catch( \Aimeos\MShop\Exception $e )
145
+		} catch( \Aimeos\MShop\Exception $e )
149 146
 		{
150 147
 			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
151 148
 			$view->errors = $view->get( 'errors', [] ) + $error;
152 149
 			$this->logException( $e );
153
-		}
154
-		catch( \Exception $e )
150
+		} catch( \Exception $e )
155 151
 		{
156 152
 			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
157 153
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -192,14 +188,12 @@  discard block
 block discarded – undo
192 188
 
193 189
 			$this->nextAction( $view, 'search', 'plugin', null, 'delete' );
194 190
 			return;
195
-		}
196
-		catch( \Aimeos\MShop\Exception $e )
191
+		} catch( \Aimeos\MShop\Exception $e )
197 192
 		{
198 193
 			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
199 194
 			$view->errors = $view->get( 'errors', [] ) + $error;
200 195
 			$this->logException( $e );
201
-		}
202
-		catch( \Exception $e )
196
+		} catch( \Exception $e )
203 197
 		{
204 198
 			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
205 199
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -244,14 +238,12 @@  discard block
 block discarded – undo
244 238
 				$view->tabindex = ++$idx + 1;
245 239
 				$view->itemBody .= $client->get();
246 240
 			}
247
-		}
248
-		catch( \Aimeos\MShop\Exception $e )
241
+		} catch( \Aimeos\MShop\Exception $e )
249 242
 		{
250 243
 			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
251 244
 			$view->errors = $view->get( 'errors', [] ) + $error;
252 245
 			$this->logException( $e );
253
-		}
254
-		catch( \Exception $e )
246
+		} catch( \Exception $e )
255 247
 		{
256 248
 			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
257 249
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -288,18 +280,15 @@  discard block
 block discarded – undo
288 280
 
289 281
 			$this->nextAction( $view, $view->param( 'next' ), 'plugin', $view->item->getId(), 'save' );
290 282
 			return;
291
-		}
292
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
283
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
293 284
 		{
294 285
 			// fall through to create
295
-		}
296
-		catch( \Aimeos\MShop\Exception $e )
286
+		} catch( \Aimeos\MShop\Exception $e )
297 287
 		{
298 288
 			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
299 289
 			$view->errors = $view->get( 'errors', [] ) + $error;
300 290
 			$this->logException( $e );
301
-		}
302
-		catch( \Exception $e )
291
+		} catch( \Exception $e )
303 292
 		{
304 293
 			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
305 294
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -342,14 +331,12 @@  discard block
 block discarded – undo
342 331
 			foreach( $this->getSubClients() as $client ) {
343 332
 				$view->itemBody .= $client->search();
344 333
 			}
345
-		}
346
-		catch( \Aimeos\MShop\Exception $e )
334
+		} catch( \Aimeos\MShop\Exception $e )
347 335
 		{
348 336
 			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
349 337
 			$view->errors = $view->get( 'errors', [] ) + $error;
350 338
 			$this->logException( $e );
351
-		}
352
-		catch( \Exception $e )
339
+		} catch( \Exception $e )
353 340
 		{
354 341
 			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
355 342
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +124 added lines, -124 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\Plugin;
12 12
 
13
-sprintf( 'plugin' ); // for translation
13
+sprintf('plugin'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,41 +35,41 @@  discard block
 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\Factory::createManager( $context, 'plugin' );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'plugin');
43 43
 
44
-			$view->item = $manager->getItem( $id );
45
-			$view->itemData = $this->toArray( $view->item, true );
44
+			$view->item = $manager->getItem($id);
45
+			$view->itemData = $this->toArray($view->item, true);
46 46
 			$view->itemSubparts = $this->getSubClientNames();
47 47
 			$view->itemProviders = $this->getProviderNames();
48 48
 			$view->itemDecorators = $this->getDecoratorNames();
49
-			$view->itemAttributes = $this->getConfigAttributes( $view->item );
49
+			$view->itemAttributes = $this->getConfigAttributes($view->item);
50 50
 			$view->itemTypes = $this->getTypeItems();
51 51
 			$view->itemBody = '';
52 52
 
53
-			foreach( $this->getSubClients() as $idx => $client )
53
+			foreach ($this->getSubClients() as $idx => $client)
54 54
 			{
55 55
 				$view->tabindex = ++$idx + 1;
56 56
 				$view->itemBody .= $client->copy();
57 57
 			}
58 58
 		}
59
-		catch( \Aimeos\MShop\Exception $e )
59
+		catch (\Aimeos\MShop\Exception $e)
60 60
 		{
61
-			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
62
-			$view->errors = $view->get( 'errors', [] ) + $error;
63
-			$this->logException( $e );
61
+			$error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
62
+			$view->errors = $view->get('errors', []) + $error;
63
+			$this->logException($e);
64 64
 		}
65
-		catch( \Exception $e )
65
+		catch (\Exception $e)
66 66
 		{
67
-			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
68
-			$view->errors = $view->get( 'errors', [] ) + $error;
69
-			$this->logException( $e );
67
+			$error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
68
+			$view->errors = $view->get('errors', []) + $error;
69
+			$this->logException($e);
70 70
 		}
71 71
 
72
-		return $this->render( $view );
72
+		return $this->render($view);
73 73
 	}
74 74
 
75 75
 
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 
86 86
 		try
87 87
 		{
88
-			$data = $view->param( 'item', [] );
88
+			$data = $view->param('item', []);
89 89
 
90
-			if( !isset( $view->item ) ) {
91
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'plugin' )->createItem();
90
+			if (!isset($view->item)) {
91
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'plugin')->createItem();
92 92
 			}
93 93
 
94 94
 			$data['plugin.siteid'] = $view->item->getSiteId();
@@ -100,26 +100,26 @@  discard block
 block discarded – undo
100 100
 			$view->itemData = $data;
101 101
 			$view->itemBody = '';
102 102
 
103
-			foreach( $this->getSubClients() as $idx => $client )
103
+			foreach ($this->getSubClients() as $idx => $client)
104 104
 			{
105 105
 				$view->tabindex = ++$idx + 1;
106 106
 				$view->itemBody .= $client->create();
107 107
 			}
108 108
 		}
109
-		catch( \Aimeos\MShop\Exception $e )
109
+		catch (\Aimeos\MShop\Exception $e)
110 110
 		{
111
-			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
112
-			$view->errors = $view->get( 'errors', [] ) + $error;
113
-			$this->logException( $e );
111
+			$error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
112
+			$view->errors = $view->get('errors', []) + $error;
113
+			$this->logException($e);
114 114
 		}
115
-		catch( \Exception $e )
115
+		catch (\Exception $e)
116 116
 		{
117
-			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
118
-			$view->errors = $view->get( 'errors', [] ) + $error;
119
-			$this->logException( $e );
117
+			$error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
118
+			$view->errors = $view->get('errors', []) + $error;
119
+			$this->logException($e);
120 120
 		}
121 121
 
122
-		return $this->render( $view );
122
+		return $this->render($view);
123 123
 	}
124 124
 
125 125
 
@@ -133,38 +133,38 @@  discard block
 block discarded – undo
133 133
 		$view = $this->getView();
134 134
 		$context = $this->getContext();
135 135
 
136
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' );
136
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'plugin');
137 137
 		$manager->begin();
138 138
 
139 139
 		try
140 140
 		{
141
-			if( ( $id = $view->param( 'id' ) ) === null ) {
142
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
141
+			if (($id = $view->param('id')) === null) {
142
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
143 143
 			}
144 144
 
145
-			$view->item = $manager->getItem( $id );
145
+			$view->item = $manager->getItem($id);
146 146
 
147
-			foreach( $this->getSubClients() as $client ) {
147
+			foreach ($this->getSubClients() as $client) {
148 148
 				$client->delete();
149 149
 			}
150 150
 
151
-			$manager->deleteItem( $id );
151
+			$manager->deleteItem($id);
152 152
 			$manager->commit();
153 153
 
154
-			$this->nextAction( $view, 'search', 'plugin', null, 'delete' );
154
+			$this->nextAction($view, 'search', 'plugin', null, 'delete');
155 155
 			return;
156 156
 		}
157
-		catch( \Aimeos\MShop\Exception $e )
157
+		catch (\Aimeos\MShop\Exception $e)
158 158
 		{
159
-			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
160
-			$view->errors = $view->get( 'errors', [] ) + $error;
161
-			$this->logException( $e );
159
+			$error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
160
+			$view->errors = $view->get('errors', []) + $error;
161
+			$this->logException($e);
162 162
 		}
163
-		catch( \Exception $e )
163
+		catch (\Exception $e)
164 164
 		{
165
-			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
166
-			$view->errors = $view->get( 'errors', [] ) + $error;
167
-			$this->logException( $e );
165
+			$error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
166
+			$view->errors = $view->get('errors', []) + $error;
167
+			$this->logException($e);
168 168
 		}
169 169
 
170 170
 		$manager->rollback();
@@ -185,41 +185,41 @@  discard block
 block discarded – undo
185 185
 
186 186
 		try
187 187
 		{
188
-			if( ( $id = $view->param( 'id' ) ) === null ) {
189
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
188
+			if (($id = $view->param('id')) === null) {
189
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
190 190
 			}
191 191
 
192
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' );
192
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'plugin');
193 193
 
194
-			$view->item = $manager->getItem( $id );
195
-			$view->itemData = $this->toArray( $view->item );
194
+			$view->item = $manager->getItem($id);
195
+			$view->itemData = $this->toArray($view->item);
196 196
 			$view->itemSubparts = $this->getSubClientNames();
197 197
 			$view->itemDecorators = $this->getDecoratorNames();
198 198
 			$view->itemProviders = $this->getProviderNames();
199
-			$view->itemAttributes = $this->getConfigAttributes( $view->item );
199
+			$view->itemAttributes = $this->getConfigAttributes($view->item);
200 200
 			$view->itemTypes = $this->getTypeItems();
201 201
 			$view->itemBody = '';
202 202
 
203
-			foreach( $this->getSubClients() as $idx => $client )
203
+			foreach ($this->getSubClients() as $idx => $client)
204 204
 			{
205 205
 				$view->tabindex = ++$idx + 1;
206 206
 				$view->itemBody .= $client->get();
207 207
 			}
208 208
 		}
209
-		catch( \Aimeos\MShop\Exception $e )
209
+		catch (\Aimeos\MShop\Exception $e)
210 210
 		{
211
-			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
212
-			$view->errors = $view->get( 'errors', [] ) + $error;
213
-			$this->logException( $e );
211
+			$error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
212
+			$view->errors = $view->get('errors', []) + $error;
213
+			$this->logException($e);
214 214
 		}
215
-		catch( \Exception $e )
215
+		catch (\Exception $e)
216 216
 		{
217
-			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
218
-			$view->errors = $view->get( 'errors', [] ) + $error;
219
-			$this->logException( $e );
217
+			$error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
218
+			$view->errors = $view->get('errors', []) + $error;
219
+			$this->logException($e);
220 220
 		}
221 221
 
222
-		return $this->render( $view );
222
+		return $this->render($view);
223 223
 	}
224 224
 
225 225
 
@@ -233,40 +233,40 @@  discard block
 block discarded – undo
233 233
 		$view = $this->getView();
234 234
 		$context = $this->getContext();
235 235
 
236
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' );
236
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'plugin');
237 237
 		$manager->begin();
238 238
 
239 239
 		try
240 240
 		{
241
-			$item = $this->fromArray( $view->param( 'item', [] ) );
242
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
241
+			$item = $this->fromArray($view->param('item', []));
242
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
243 243
 			$view->itemBody = '';
244 244
 
245
-			foreach( $this->getSubClients() as $client ) {
245
+			foreach ($this->getSubClients() as $client) {
246 246
 				$view->itemBody .= $client->save();
247 247
 			}
248 248
 
249
-			$manager->saveItem( clone $view->item );
249
+			$manager->saveItem(clone $view->item);
250 250
 			$manager->commit();
251 251
 
252
-			$this->nextAction( $view, $view->param( 'next' ), 'plugin', $view->item->getId(), 'save' );
252
+			$this->nextAction($view, $view->param('next'), 'plugin', $view->item->getId(), 'save');
253 253
 			return;
254 254
 		}
255
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
255
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
256 256
 		{
257 257
 			// fall through to create
258 258
 		}
259
-		catch( \Aimeos\MShop\Exception $e )
259
+		catch (\Aimeos\MShop\Exception $e)
260 260
 		{
261
-			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
262
-			$view->errors = $view->get( 'errors', [] ) + $error;
263
-			$this->logException( $e );
261
+			$error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
262
+			$view->errors = $view->get('errors', []) + $error;
263
+			$this->logException($e);
264 264
 		}
265
-		catch( \Exception $e )
265
+		catch (\Exception $e)
266 266
 		{
267
-			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
268
-			$view->errors = $view->get( 'errors', [] ) + $error;
269
-			$this->logException( $e );
267
+			$error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
268
+			$view->errors = $view->get('errors', []) + $error;
269
+			$this->logException($e);
270 270
 		}
271 271
 
272 272
 		$manager->rollback();
@@ -288,35 +288,35 @@  discard block
 block discarded – undo
288 288
 		try
289 289
 		{
290 290
 			$total = 0;
291
-			$params = $this->storeSearchParams( $view->param(), 'plugin' );
292
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'plugin' );
291
+			$params = $this->storeSearchParams($view->param(), 'plugin');
292
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'plugin');
293 293
 
294 294
 			$search = $manager->createSearch();
295
-			$search->setSortations( [$search->sort( '+', 'plugin.typeid' ), $search->sort( '+', 'plugin.position' )] );
296
-			$search = $this->initCriteria( $search, $params );
295
+			$search->setSortations([$search->sort('+', 'plugin.typeid'), $search->sort('+', 'plugin.position')]);
296
+			$search = $this->initCriteria($search, $params);
297 297
 
298
-			$view->items = $manager->searchItems( $search, [], $total );
299
-			$view->filterAttributes = $manager->getSearchAttributes( true );
298
+			$view->items = $manager->searchItems($search, [], $total);
299
+			$view->filterAttributes = $manager->getSearchAttributes(true);
300 300
 			$view->filterOperators = $search->getOperators();
301 301
 			$view->itemTypes = $this->getTypeItems();
302 302
 			$view->total = $total;
303 303
 			$view->itemBody = '';
304 304
 
305
-			foreach( $this->getSubClients() as $client ) {
305
+			foreach ($this->getSubClients() as $client) {
306 306
 				$view->itemBody .= $client->search();
307 307
 			}
308 308
 		}
309
-		catch( \Aimeos\MShop\Exception $e )
309
+		catch (\Aimeos\MShop\Exception $e)
310 310
 		{
311
-			$error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
312
-			$view->errors = $view->get( 'errors', [] ) + $error;
313
-			$this->logException( $e );
311
+			$error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
312
+			$view->errors = $view->get('errors', []) + $error;
313
+			$this->logException($e);
314 314
 		}
315
-		catch( \Exception $e )
315
+		catch (\Exception $e)
316 316
 		{
317
-			$error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
318
-			$view->errors = $view->get( 'errors', [] ) + $error;
319
-			$this->logException( $e );
317
+			$error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
318
+			$view->errors = $view->get('errors', []) + $error;
319
+			$this->logException($e);
320 320
 		}
321 321
 
322 322
 		/** admin/jqadm/plugin/template-list
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 		$tplconf = 'admin/jqadm/plugin/template-list';
342 342
 		$default = 'plugin/list-standard.php';
343 343
 
344
-		return $view->render( $view->config( $tplconf, $default ) );
344
+		return $view->render($view->config($tplconf, $default));
345 345
 	}
346 346
 
347 347
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	 * @param string|null $name Name of the sub-client (Default if null)
353 353
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
354 354
 	 */
355
-	public function getSubClient( $type, $name = null )
355
+	public function getSubClient($type, $name = null)
356 356
 	{
357 357
 		/** admin/jqadm/plugin/decorators/excludes
358 358
 		 * Excludes decorators added by the "common" option from the plugin JQAdm client
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 		 * @see admin/jqadm/plugin/decorators/excludes
428 428
 		 * @see admin/jqadm/plugin/decorators/global
429 429
 		 */
430
-		return $this->createSubClient( 'plugin/' . $type, $name );
430
+		return $this->createSubClient('plugin/' . $type, $name);
431 431
 	}
432 432
 
433 433
 
@@ -437,13 +437,13 @@  discard block
 block discarded – undo
437 437
 	 * @param \Aimeos\MShop\Plugin\Item\Iface $item Plugin item incl. provider/decorator property
438 438
 	 * @return \Aimeos\MW\Common\Critera\Attribute\Iface[] List of configuration attributes
439 439
 	 */
440
-	public function getConfigAttributes( \Aimeos\MShop\Plugin\Item\Iface $item )
440
+	public function getConfigAttributes(\Aimeos\MShop\Plugin\Item\Iface $item)
441 441
 	{
442
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin' );
442
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin');
443 443
 
444 444
 		try {
445
-			return $manager->getProvider( $item, $item->getType() )->getConfigBE();
446
-		} catch( \Aimeos\MShop\Exception $e ) {
445
+			return $manager->getProvider($item, $item->getType())->getConfigBE();
446
+		} catch (\Aimeos\MShop\Exception $e) {
447 447
 			return [];
448 448
 		}
449 449
 	}
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 	protected function getDecoratorNames()
458 458
 	{
459 459
 		$ds = DIRECTORY_SEPARATOR;
460
-		return $this->getClassNames( 'MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Decorator' );
460
+		return $this->getClassNames('MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Decorator');
461 461
 	}
462 462
 
463 463
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 	{
471 471
 		$ds = DIRECTORY_SEPARATOR;
472 472
 		return [
473
-			'order' => $this->getClassNames( 'MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Order' )
473
+			'order' => $this->getClassNames('MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Order')
474 474
 		];
475 475
 	}
476 476
 
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 		 * @since 2017.10
516 516
 		 * @category Developer
517 517
 		 */
518
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/plugin/standard/subparts', [] );
518
+		return $this->getContext()->getConfig()->get('admin/jqadm/plugin/standard/subparts', []);
519 519
 	}
520 520
 
521 521
 
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 	 */
527 527
 	protected function getTypeItems()
528 528
 	{
529
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin/type' );
529
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin/type');
530 530
 
531
-		$search = $typeManager->createSearch()->setSlice( 0, 0x7fffffff );
532
-		$search->setSortations( array( $search->sort( '+', 'plugin.type.label' ) ) );
531
+		$search = $typeManager->createSearch()->setSlice(0, 0x7fffffff);
532
+		$search->setSortations(array($search->sort('+', 'plugin.type.label')));
533 533
 
534
-		return $typeManager->searchItems( $search );
534
+		return $typeManager->searchItems($search);
535 535
 	}
536 536
 
537 537
 
@@ -541,17 +541,17 @@  discard block
 block discarded – undo
541 541
 	 * @param string[] Data array
542 542
 	 * @return \Aimeos\MShop\Plugin\Item\Iface New plugin item object
543 543
 	 */
544
-	protected function fromArray( array $data )
544
+	protected function fromArray(array $data)
545 545
 	{
546 546
 		$conf = [];
547 547
 
548
-		if( isset( $data['config']['key'] ) )
548
+		if (isset($data['config']['key']))
549 549
 		{
550
-			foreach( (array) $data['config']['key'] as $idx => $key )
550
+			foreach ((array) $data['config']['key'] as $idx => $key)
551 551
 			{
552
-				if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) )
552
+				if (trim($key) !== '' && isset($data['config']['val'][$idx]))
553 553
 				{
554
-					if( ( $val = json_decode( $data['config']['val'][$idx] ) ) === null ) {
554
+					if (($val = json_decode($data['config']['val'][$idx])) === null) {
555 555
 						$conf[$key] = $data['config']['val'][$idx];
556 556
 					} else {
557 557
 						$conf[$key] = $val;
@@ -560,17 +560,17 @@  discard block
 block discarded – undo
560 560
 			}
561 561
 		}
562 562
 
563
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin' );
563
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin');
564 564
 
565
-		if( isset( $data['plugin.id'] ) && $data['plugin.id'] != '' ) {
566
-			$item = $manager->getItem( $data['plugin.id'], $this->getDomains() );
565
+		if (isset($data['plugin.id']) && $data['plugin.id'] != '') {
566
+			$item = $manager->getItem($data['plugin.id'], $this->getDomains());
567 567
 		} else {
568
-			$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin/type' );
569
-			$item = $manager->createItem( $typeManager->getItem( $data['plugin.typeid'] )->getCode(), 'plugin' );
568
+			$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin/type');
569
+			$item = $manager->createItem($typeManager->getItem($data['plugin.typeid'])->getCode(), 'plugin');
570 570
 		}
571 571
 
572
-		$item->fromArray( $data );
573
-		$item->setConfig( $conf );
572
+		$item->fromArray($data);
573
+		$item->setConfig($conf);
574 574
 
575 575
 		return $item;
576 576
 	}
@@ -582,21 +582,21 @@  discard block
 block discarded – undo
582 582
 	 * @param \Aimeos\MShop\Plugin\Item\Iface $item Plugin item object
583 583
 	 * @return string[] Multi-dimensional associative list of item data
584 584
 	 */
585
-	protected function toArray( \Aimeos\MShop\Plugin\Item\Iface $item, $copy = false )
585
+	protected function toArray(\Aimeos\MShop\Plugin\Item\Iface $item, $copy = false)
586 586
 	{
587 587
 		$config = $item->getConfig();
588
-		$data = $item->toArray( true );
588
+		$data = $item->toArray(true);
589 589
 		$data['config'] = [];
590 590
 
591
-		if( $copy === true )
591
+		if ($copy === true)
592 592
 		{
593 593
 			$data['plugin.siteid'] = $this->getContext()->getLocale()->getSiteId();
594 594
 			$data['plugin.id'] = '';
595 595
 		}
596 596
 
597
-		ksort( $config );
597
+		ksort($config);
598 598
 
599
-		foreach( $config as $key => $value )
599
+		foreach ($config as $key => $value)
600 600
 		{
601 601
 			$data['config']['key'][] = $key;
602 602
 			$data['config']['val'][] = $value;
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
613 613
 	 * @return string HTML output
614 614
 	 */
615
-	protected function render( \Aimeos\MW\View\Iface $view )
615
+	protected function render(\Aimeos\MW\View\Iface $view)
616 616
 	{
617 617
 		/** admin/jqadm/plugin/template-item
618 618
 		 * Relative path to the HTML body template for the plugin item.
@@ -636,6 +636,6 @@  discard block
 block discarded – undo
636 636
 		$tplconf = 'admin/jqadm/plugin/template-item';
637 637
 		$default = 'plugin/item-standard.php';
638 638
 
639
-		return $view->render( $view->config( $tplconf, $default ) );
639
+		return $view->render($view->config($tplconf, $default));
640 640
 	}
641 641
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Dashboard/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -111,14 +111,12 @@
 block discarded – undo
111 111
 			foreach( $this->getSubClients() as $client ) {
112 112
 				$view->listBody .= $client->search();
113 113
 			}
114
-		}
115
-		catch( \Aimeos\MShop\Exception $e )
114
+		} catch( \Aimeos\MShop\Exception $e )
116 115
 		{
117 116
 			$error = array( 'dashboard' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
118 117
 			$view->errors = $view->get( 'errors', [] ) + $error;
119 118
 			$this->logException( $e );
120
-		}
121
-		catch( \Exception $e )
119
+		} catch( \Exception $e )
122 120
 		{
123 121
 			$error = array( 'dashboard' => $e->getMessage() );
124 122
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 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\Dashboard;
12 12
 
13
-sprintf( 'dashboard' ); // for translation
13
+sprintf('dashboard'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -49,21 +49,21 @@  discard block
 block discarded – undo
49 49
 		{
50 50
 			$view->listBody = '';
51 51
 
52
-			foreach( $this->getSubClients() as $client ) {
52
+			foreach ($this->getSubClients() as $client) {
53 53
 				$view->listBody .= $client->search();
54 54
 			}
55 55
 		}
56
-		catch( \Aimeos\MShop\Exception $e )
56
+		catch (\Aimeos\MShop\Exception $e)
57 57
 		{
58
-			$error = array( 'dashboard' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
59
-			$view->errors = $view->get( 'errors', [] ) + $error;
60
-			$this->logException( $e );
58
+			$error = array('dashboard' => $context->getI18n()->dt('mshop', $e->getMessage()));
59
+			$view->errors = $view->get('errors', []) + $error;
60
+			$this->logException($e);
61 61
 		}
62
-		catch( \Exception $e )
62
+		catch (\Exception $e)
63 63
 		{
64
-			$error = array( 'dashboard' => $e->getMessage() );
65
-			$view->errors = $view->get( 'errors', [] ) + $error;
66
-			$this->logException( $e );
64
+			$error = array('dashboard' => $e->getMessage());
65
+			$view->errors = $view->get('errors', []) + $error;
66
+			$this->logException($e);
67 67
 		}
68 68
 
69 69
 		/** admin/jqadm/dashboard/template-list
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		$tplconf = 'admin/jqadm/dashboard/template-list';
89 89
 		$default = 'dashboard/list-standard.php';
90 90
 
91
-		return $view->render( $view->config( $tplconf, $default ) );
91
+		return $view->render($view->config($tplconf, $default));
92 92
 	}
93 93
 
94 94
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @param string|null $name Name of the sub-client (Default if null)
100 100
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
101 101
 	 */
102
-	public function getSubClient( $type, $name = null )
102
+	public function getSubClient($type, $name = null)
103 103
 	{
104 104
 		/** admin/jqadm/dashboard/decorators/excludes
105 105
 		 * Excludes decorators added by the "common" option from the dashboard JQAdm client
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		 * @see admin/jqadm/dashboard/decorators/excludes
175 175
 		 * @see admin/jqadm/dashboard/decorators/global
176 176
 		 */
177
-		return $this->createSubClient( 'dashboard/' . $type, $name );
177
+		return $this->createSubClient('dashboard/' . $type, $name);
178 178
 	}
179 179
 
180 180
 
@@ -218,6 +218,6 @@  discard block
 block discarded – undo
218 218
 		 * @since 2016.07
219 219
 		 * @category Developer
220 220
 		 */
221
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/dashboard/standard/subparts', [] );
221
+		return $this->getContext()->getConfig()->get('admin/jqadm/dashboard/standard/subparts', []);
222 222
 	}
223 223
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Service/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -125,14 +125,12 @@  discard block
 block discarded – undo
125 125
 				$view->tabindex = ++$idx + 1;
126 126
 				$view->itemBody .= $client->copy();
127 127
 			}
128
-		}
129
-		catch( \Aimeos\MShop\Exception $e )
128
+		} catch( \Aimeos\MShop\Exception $e )
130 129
 		{
131 130
 			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
132 131
 			$view->errors = $view->get( 'errors', [] ) + $error;
133 132
 			$this->logException( $e );
134
-		}
135
-		catch( \Exception $e )
133
+		} catch( \Exception $e )
136 134
 		{
137 135
 			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
138 136
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -177,14 +175,12 @@  discard block
 block discarded – undo
177 175
 				$view->tabindex = ++$idx + 1;
178 176
 				$view->itemBody .= $client->create();
179 177
 			}
180
-		}
181
-		catch( \Aimeos\MShop\Exception $e )
178
+		} catch( \Aimeos\MShop\Exception $e )
182 179
 		{
183 180
 			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
184 181
 			$view->errors = $view->get( 'errors', [] ) + $error;
185 182
 			$this->logException( $e );
186
-		}
187
-		catch( \Exception $e )
183
+		} catch( \Exception $e )
188 184
 		{
189 185
 			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
190 186
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -225,14 +221,12 @@  discard block
 block discarded – undo
225 221
 
226 222
 			$this->nextAction( $view, 'search', 'service', null, 'delete' );
227 223
 			return;
228
-		}
229
-		catch( \Aimeos\MShop\Exception $e )
224
+		} catch( \Aimeos\MShop\Exception $e )
230 225
 		{
231 226
 			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
232 227
 			$view->errors = $view->get( 'errors', [] ) + $error;
233 228
 			$this->logException( $e );
234
-		}
235
-		catch( \Exception $e )
229
+		} catch( \Exception $e )
236 230
 		{
237 231
 			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
238 232
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -277,14 +271,12 @@  discard block
 block discarded – undo
277 271
 				$view->tabindex = ++$idx + 1;
278 272
 				$view->itemBody .= $client->get();
279 273
 			}
280
-		}
281
-		catch( \Aimeos\MShop\Exception $e )
274
+		} catch( \Aimeos\MShop\Exception $e )
282 275
 		{
283 276
 			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
284 277
 			$view->errors = $view->get( 'errors', [] ) + $error;
285 278
 			$this->logException( $e );
286
-		}
287
-		catch( \Exception $e )
279
+		} catch( \Exception $e )
288 280
 		{
289 281
 			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
290 282
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -321,18 +313,15 @@  discard block
 block discarded – undo
321 313
 
322 314
 			$this->nextAction( $view, $view->param( 'next' ), 'service', $view->item->getId(), 'save' );
323 315
 			return;
324
-		}
325
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
316
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
326 317
 		{
327 318
 			// fall through to create
328
-		}
329
-		catch( \Aimeos\MShop\Exception $e )
319
+		} catch( \Aimeos\MShop\Exception $e )
330 320
 		{
331 321
 			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
332 322
 			$view->errors = $view->get( 'errors', [] ) + $error;
333 323
 			$this->logException( $e );
334
-		}
335
-		catch( \Exception $e )
324
+		} catch( \Exception $e )
336 325
 		{
337 326
 			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
338 327
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -375,14 +364,12 @@  discard block
 block discarded – undo
375 364
 			foreach( $this->getSubClients() as $client ) {
376 365
 				$view->itemBody .= $client->search();
377 366
 			}
378
-		}
379
-		catch( \Aimeos\MShop\Exception $e )
367
+		} catch( \Aimeos\MShop\Exception $e )
380 368
 		{
381 369
 			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
382 370
 			$view->errors = $view->get( 'errors', [] ) + $error;
383 371
 			$this->logException( $e );
384
-		}
385
-		catch( \Exception $e )
372
+		} catch( \Exception $e )
386 373
 		{
387 374
 			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
388 375
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +128 added lines, -128 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\Service;
12 12
 
13
-sprintf( 'service' ); // for translation
13
+sprintf('service'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,41 +35,41 @@  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\Factory::createManager( $context, 'service' );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'service');
43 43
 
44
-			$view->item = $manager->getItem( $id, $this->getDomains() );
45
-			$view->itemData = $this->toArray( $view->item, true );
44
+			$view->item = $manager->getItem($id, $this->getDomains());
45
+			$view->itemData = $this->toArray($view->item, true);
46 46
 			$view->itemSubparts = $this->getSubClientNames();
47 47
 			$view->itemProviders = $this->getProviderNames();
48 48
 			$view->itemDecorators = $this->getDecoratorNames();
49
-			$view->itemAttributes = $this->getConfigAttributes( $view->item );
49
+			$view->itemAttributes = $this->getConfigAttributes($view->item);
50 50
 			$view->itemTypes = $this->getTypeItems();
51 51
 			$view->itemBody = '';
52 52
 
53
-			foreach( $this->getSubClients() as $idx => $client )
53
+			foreach ($this->getSubClients() as $idx => $client)
54 54
 			{
55 55
 				$view->tabindex = ++$idx + 1;
56 56
 				$view->itemBody .= $client->copy();
57 57
 			}
58 58
 		}
59
-		catch( \Aimeos\MShop\Exception $e )
59
+		catch (\Aimeos\MShop\Exception $e)
60 60
 		{
61
-			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
62
-			$view->errors = $view->get( 'errors', [] ) + $error;
63
-			$this->logException( $e );
61
+			$error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
62
+			$view->errors = $view->get('errors', []) + $error;
63
+			$this->logException($e);
64 64
 		}
65
-		catch( \Exception $e )
65
+		catch (\Exception $e)
66 66
 		{
67
-			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
68
-			$view->errors = $view->get( 'errors', [] ) + $error;
69
-			$this->logException( $e );
67
+			$error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
68
+			$view->errors = $view->get('errors', []) + $error;
69
+			$this->logException($e);
70 70
 		}
71 71
 
72
-		return $this->render( $view );
72
+		return $this->render($view);
73 73
 	}
74 74
 
75 75
 
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 
86 86
 		try
87 87
 		{
88
-			$data = $view->param( 'item', [] );
88
+			$data = $view->param('item', []);
89 89
 
90
-			if( !isset( $view->item ) ) {
91
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'service' )->createItem();
90
+			if (!isset($view->item)) {
91
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'service')->createItem();
92 92
 			}
93 93
 
94 94
 			$data['service.siteid'] = $view->item->getSiteId();
@@ -100,26 +100,26 @@  discard block
 block discarded – undo
100 100
 			$view->itemData = $data;
101 101
 			$view->itemBody = '';
102 102
 
103
-			foreach( $this->getSubClients() as $idx => $client )
103
+			foreach ($this->getSubClients() as $idx => $client)
104 104
 			{
105 105
 				$view->tabindex = ++$idx + 1;
106 106
 				$view->itemBody .= $client->create();
107 107
 			}
108 108
 		}
109
-		catch( \Aimeos\MShop\Exception $e )
109
+		catch (\Aimeos\MShop\Exception $e)
110 110
 		{
111
-			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
112
-			$view->errors = $view->get( 'errors', [] ) + $error;
113
-			$this->logException( $e );
111
+			$error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
112
+			$view->errors = $view->get('errors', []) + $error;
113
+			$this->logException($e);
114 114
 		}
115
-		catch( \Exception $e )
115
+		catch (\Exception $e)
116 116
 		{
117
-			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
118
-			$view->errors = $view->get( 'errors', [] ) + $error;
119
-			$this->logException( $e );
117
+			$error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
118
+			$view->errors = $view->get('errors', []) + $error;
119
+			$this->logException($e);
120 120
 		}
121 121
 
122
-		return $this->render( $view );
122
+		return $this->render($view);
123 123
 	}
124 124
 
125 125
 
@@ -133,39 +133,39 @@  discard block
 block discarded – undo
133 133
 		$view = $this->getView();
134 134
 		$context = $this->getContext();
135 135
 
136
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
136
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'service');
137 137
 		$manager->begin();
138 138
 
139 139
 		try
140 140
 		{
141
-			if( ( $id = $view->param( 'id' ) ) === null ) {
142
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
141
+			if (($id = $view->param('id')) === null) {
142
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
143 143
 			}
144 144
 
145
-			$view->item = $manager->getItem( $id, $this->getDomains() );
145
+			$view->item = $manager->getItem($id, $this->getDomains());
146 146
 
147
-			foreach( $this->getSubClients() as $client ) {
147
+			foreach ($this->getSubClients() as $client) {
148 148
 				$client->delete();
149 149
 			}
150 150
 
151
-			$manager->saveItem( $view->item );
152
-			$manager->deleteItem( $id );
151
+			$manager->saveItem($view->item);
152
+			$manager->deleteItem($id);
153 153
 			$manager->commit();
154 154
 
155
-			$this->nextAction( $view, 'search', 'service', null, 'delete' );
155
+			$this->nextAction($view, 'search', 'service', null, 'delete');
156 156
 			return;
157 157
 		}
158
-		catch( \Aimeos\MShop\Exception $e )
158
+		catch (\Aimeos\MShop\Exception $e)
159 159
 		{
160
-			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
161
-			$view->errors = $view->get( 'errors', [] ) + $error;
162
-			$this->logException( $e );
160
+			$error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
161
+			$view->errors = $view->get('errors', []) + $error;
162
+			$this->logException($e);
163 163
 		}
164
-		catch( \Exception $e )
164
+		catch (\Exception $e)
165 165
 		{
166
-			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
167
-			$view->errors = $view->get( 'errors', [] ) + $error;
168
-			$this->logException( $e );
166
+			$error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
167
+			$view->errors = $view->get('errors', []) + $error;
168
+			$this->logException($e);
169 169
 		}
170 170
 
171 171
 		$manager->rollback();
@@ -186,41 +186,41 @@  discard block
 block discarded – undo
186 186
 
187 187
 		try
188 188
 		{
189
-			if( ( $id = $view->param( 'id' ) ) === null ) {
190
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
189
+			if (($id = $view->param('id')) === null) {
190
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
191 191
 			}
192 192
 
193
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
193
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'service');
194 194
 
195
-			$view->item = $manager->getItem( $id, $this->getDomains() );
196
-			$view->itemData = $this->toArray( $view->item );
195
+			$view->item = $manager->getItem($id, $this->getDomains());
196
+			$view->itemData = $this->toArray($view->item);
197 197
 			$view->itemSubparts = $this->getSubClientNames();
198 198
 			$view->itemDecorators = $this->getDecoratorNames();
199 199
 			$view->itemProviders = $this->getProviderNames();
200
-			$view->itemAttributes = $this->getConfigAttributes( $view->item );
200
+			$view->itemAttributes = $this->getConfigAttributes($view->item);
201 201
 			$view->itemTypes = $this->getTypeItems();
202 202
 			$view->itemBody = '';
203 203
 
204
-			foreach( $this->getSubClients() as $idx => $client )
204
+			foreach ($this->getSubClients() as $idx => $client)
205 205
 			{
206 206
 				$view->tabindex = ++$idx + 1;
207 207
 				$view->itemBody .= $client->get();
208 208
 			}
209 209
 		}
210
-		catch( \Aimeos\MShop\Exception $e )
210
+		catch (\Aimeos\MShop\Exception $e)
211 211
 		{
212
-			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
213
-			$view->errors = $view->get( 'errors', [] ) + $error;
214
-			$this->logException( $e );
212
+			$error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
213
+			$view->errors = $view->get('errors', []) + $error;
214
+			$this->logException($e);
215 215
 		}
216
-		catch( \Exception $e )
216
+		catch (\Exception $e)
217 217
 		{
218
-			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
219
-			$view->errors = $view->get( 'errors', [] ) + $error;
220
-			$this->logException( $e );
218
+			$error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
219
+			$view->errors = $view->get('errors', []) + $error;
220
+			$this->logException($e);
221 221
 		}
222 222
 
223
-		return $this->render( $view );
223
+		return $this->render($view);
224 224
 	}
225 225
 
226 226
 
@@ -234,40 +234,40 @@  discard block
 block discarded – undo
234 234
 		$view = $this->getView();
235 235
 		$context = $this->getContext();
236 236
 
237
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
237
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'service');
238 238
 		$manager->begin();
239 239
 
240 240
 		try
241 241
 		{
242
-			$item = $this->fromArray( $view->param( 'item', [] ) );
243
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
242
+			$item = $this->fromArray($view->param('item', []));
243
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
244 244
 			$view->itemBody = '';
245 245
 
246
-			foreach( $this->getSubClients() as $client ) {
246
+			foreach ($this->getSubClients() as $client) {
247 247
 				$view->itemBody .= $client->save();
248 248
 			}
249 249
 
250
-			$manager->saveItem( clone $view->item );
250
+			$manager->saveItem(clone $view->item);
251 251
 			$manager->commit();
252 252
 
253
-			$this->nextAction( $view, $view->param( 'next' ), 'service', $view->item->getId(), 'save' );
253
+			$this->nextAction($view, $view->param('next'), 'service', $view->item->getId(), 'save');
254 254
 			return;
255 255
 		}
256
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
256
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
257 257
 		{
258 258
 			// fall through to create
259 259
 		}
260
-		catch( \Aimeos\MShop\Exception $e )
260
+		catch (\Aimeos\MShop\Exception $e)
261 261
 		{
262
-			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
263
-			$view->errors = $view->get( 'errors', [] ) + $error;
264
-			$this->logException( $e );
262
+			$error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
263
+			$view->errors = $view->get('errors', []) + $error;
264
+			$this->logException($e);
265 265
 		}
266
-		catch( \Exception $e )
266
+		catch (\Exception $e)
267 267
 		{
268
-			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
269
-			$view->errors = $view->get( 'errors', [] ) + $error;
270
-			$this->logException( $e );
268
+			$error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
269
+			$view->errors = $view->get('errors', []) + $error;
270
+			$this->logException($e);
271 271
 		}
272 272
 
273 273
 		$manager->rollback();
@@ -289,35 +289,35 @@  discard block
 block discarded – undo
289 289
 		try
290 290
 		{
291 291
 			$total = 0;
292
-			$params = $this->storeSearchParams( $view->param(), 'service' );
293
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
292
+			$params = $this->storeSearchParams($view->param(), 'service');
293
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'service');
294 294
 
295 295
 			$search = $manager->createSearch();
296
-			$search->setSortations( [$search->sort( '+', 'service.typeid' ), $search->sort( '+', 'service.position' )] );
297
-			$search = $this->initCriteria( $search, $params );
296
+			$search->setSortations([$search->sort('+', 'service.typeid'), $search->sort('+', 'service.position')]);
297
+			$search = $this->initCriteria($search, $params);
298 298
 
299
-			$view->items = $manager->searchItems( $search, $this->getDomains(), $total );
300
-			$view->filterAttributes = $manager->getSearchAttributes( true );
299
+			$view->items = $manager->searchItems($search, $this->getDomains(), $total);
300
+			$view->filterAttributes = $manager->getSearchAttributes(true);
301 301
 			$view->filterOperators = $search->getOperators();
302 302
 			$view->itemTypes = $this->getTypeItems();
303 303
 			$view->total = $total;
304 304
 			$view->itemBody = '';
305 305
 
306
-			foreach( $this->getSubClients() as $client ) {
306
+			foreach ($this->getSubClients() as $client) {
307 307
 				$view->itemBody .= $client->search();
308 308
 			}
309 309
 		}
310
-		catch( \Aimeos\MShop\Exception $e )
310
+		catch (\Aimeos\MShop\Exception $e)
311 311
 		{
312
-			$error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
313
-			$view->errors = $view->get( 'errors', [] ) + $error;
314
-			$this->logException( $e );
312
+			$error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
313
+			$view->errors = $view->get('errors', []) + $error;
314
+			$this->logException($e);
315 315
 		}
316
-		catch( \Exception $e )
316
+		catch (\Exception $e)
317 317
 		{
318
-			$error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
319
-			$view->errors = $view->get( 'errors', [] ) + $error;
320
-			$this->logException( $e );
318
+			$error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
319
+			$view->errors = $view->get('errors', []) + $error;
320
+			$this->logException($e);
321 321
 		}
322 322
 
323 323
 		/** admin/jqadm/service/template-list
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 		$tplconf = 'admin/jqadm/service/template-list';
343 343
 		$default = 'service/list-standard.php';
344 344
 
345
-		return $view->render( $view->config( $tplconf, $default ) );
345
+		return $view->render($view->config($tplconf, $default));
346 346
 	}
347 347
 
348 348
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	 * @param string|null $name Name of the sub-client (Default if null)
354 354
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
355 355
 	 */
356
-	public function getSubClient( $type, $name = null )
356
+	public function getSubClient($type, $name = null)
357 357
 	{
358 358
 		/** admin/jqadm/service/decorators/excludes
359 359
 		 * Excludes decorators added by the "common" option from the service JQAdm client
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 		 * @see admin/jqadm/service/decorators/excludes
429 429
 		 * @see admin/jqadm/service/decorators/global
430 430
 		 */
431
-		return $this->createSubClient( 'service/' . $type, $name );
431
+		return $this->createSubClient('service/' . $type, $name);
432 432
 	}
433 433
 
434 434
 
@@ -438,13 +438,13 @@  discard block
 block discarded – undo
438 438
 	 * @param \Aimeos\MShop\Service\Item\Iface $item Service item incl. provider/decorator property
439 439
 	 * @return \Aimeos\MW\Common\Critera\Attribute\Iface[] List of configuration attributes
440 440
 	 */
441
-	public function getConfigAttributes( \Aimeos\MShop\Service\Item\Iface $item )
441
+	public function getConfigAttributes(\Aimeos\MShop\Service\Item\Iface $item)
442 442
 	{
443
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
443
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
444 444
 
445 445
 		try {
446
-			return $manager->getProvider( $item, $item->getType() )->getConfigBE();
447
-		} catch( \Aimeos\MShop\Exception $e ) {
446
+			return $manager->getProvider($item, $item->getType())->getConfigBE();
447
+		} catch (\Aimeos\MShop\Exception $e) {
448 448
 			return [];
449 449
 		}
450 450
 	}
@@ -468,9 +468,9 @@  discard block
 block discarded – undo
468 468
 		 * @since 2017.10
469 469
 		 * @category Developer
470 470
 		 */
471
-		$domains = array( 'media', 'price', 'text' );
471
+		$domains = array('media', 'price', 'text');
472 472
 
473
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/service/domains', $domains );
473
+		return $this->getContext()->getConfig()->get('admin/jqadm/service/domains', $domains);
474 474
 	}
475 475
 
476 476
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 	protected function getDecoratorNames()
483 483
 	{
484 484
 		$ds = DIRECTORY_SEPARATOR;
485
-		return $this->getClassNames( 'MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Decorator' );
485
+		return $this->getClassNames('MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Decorator');
486 486
 	}
487 487
 
488 488
 
@@ -495,8 +495,8 @@  discard block
 block discarded – undo
495 495
 	{
496 496
 		$ds = DIRECTORY_SEPARATOR;
497 497
 		return [
498
-			'delivery' => $this->getClassNames( 'MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Delivery' ),
499
-			'payment' => $this->getClassNames( 'MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Payment' ),
498
+			'delivery' => $this->getClassNames('MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Delivery'),
499
+			'payment' => $this->getClassNames('MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Payment'),
500 500
 		];
501 501
 	}
502 502
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 		 * @since 2017.10
542 542
 		 * @category Developer
543 543
 		 */
544
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/service/standard/subparts', [] );
544
+		return $this->getContext()->getConfig()->get('admin/jqadm/service/standard/subparts', []);
545 545
 	}
546 546
 
547 547
 
@@ -552,12 +552,12 @@  discard block
 block discarded – undo
552 552
 	 */
553 553
 	protected function getTypeItems()
554 554
 	{
555
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service/type' );
555
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service/type');
556 556
 
557
-		$search = $typeManager->createSearch()->setSlice( 0, 0x7fffffff );
558
-		$search->setSortations( array( $search->sort( '+', 'service.type.label' ) ) );
557
+		$search = $typeManager->createSearch()->setSlice(0, 0x7fffffff);
558
+		$search->setSortations(array($search->sort('+', 'service.type.label')));
559 559
 
560
-		return $typeManager->searchItems( $search );
560
+		return $typeManager->searchItems($search);
561 561
 	}
562 562
 
563 563
 
@@ -567,17 +567,17 @@  discard block
 block discarded – undo
567 567
 	 * @param string[] Data array
568 568
 	 * @return \Aimeos\MShop\Service\Item\Iface New service item object
569 569
 	 */
570
-	protected function fromArray( array $data )
570
+	protected function fromArray(array $data)
571 571
 	{
572 572
 		$conf = [];
573 573
 
574
-		if( isset( $data['config']['key'] ) )
574
+		if (isset($data['config']['key']))
575 575
 		{
576
-			foreach( (array) $data['config']['key'] as $idx => $key )
576
+			foreach ((array) $data['config']['key'] as $idx => $key)
577 577
 			{
578
-				if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) )
578
+				if (trim($key) !== '' && isset($data['config']['val'][$idx]))
579 579
 				{
580
-					if( ( $val = json_decode( $data['config']['val'][$idx] ) ) === null ) {
580
+					if (($val = json_decode($data['config']['val'][$idx])) === null) {
581 581
 						$conf[$key] = $data['config']['val'][$idx];
582 582
 					} else {
583 583
 						$conf[$key] = $val;
@@ -586,17 +586,17 @@  discard block
 block discarded – undo
586 586
 			}
587 587
 		}
588 588
 
589
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
589
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
590 590
 
591
-		if( isset( $data['service.id'] ) && $data['service.id'] != '' ) {
592
-			$item = $manager->getItem( $data['service.id'], $this->getDomains() );
591
+		if (isset($data['service.id']) && $data['service.id'] != '') {
592
+			$item = $manager->getItem($data['service.id'], $this->getDomains());
593 593
 		} else {
594
-			$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service/type' );
595
-			$item = $manager->createItem( $typeManager->getItem( $data['service.typeid'] )->getCode(), 'service' );
594
+			$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service/type');
595
+			$item = $manager->createItem($typeManager->getItem($data['service.typeid'])->getCode(), 'service');
596 596
 		}
597 597
 
598
-		$item->fromArray( $data );
599
-		$item->setConfig( $conf );
598
+		$item->fromArray($data);
599
+		$item->setConfig($conf);
600 600
 
601 601
 		return $item;
602 602
 	}
@@ -608,22 +608,22 @@  discard block
 block discarded – undo
608 608
 	 * @param \Aimeos\MShop\Service\Item\Iface $item Service item object
609 609
 	 * @return string[] Multi-dimensional associative list of item data
610 610
 	 */
611
-	protected function toArray( \Aimeos\MShop\Service\Item\Iface $item, $copy = false )
611
+	protected function toArray(\Aimeos\MShop\Service\Item\Iface $item, $copy = false)
612 612
 	{
613 613
 		$config = $item->getConfig();
614
-		$data = $item->toArray( true );
614
+		$data = $item->toArray(true);
615 615
 		$data['config'] = [];
616 616
 
617
-		if( $copy === true )
617
+		if ($copy === true)
618 618
 		{
619 619
 			$data['service.siteid'] = $this->getContext()->getLocale()->getSiteId();
620 620
 			$data['service.code'] = $data['service.code'] . '_copy';
621 621
 			$data['service.id'] = '';
622 622
 		}
623 623
 
624
-		ksort( $config );
624
+		ksort($config);
625 625
 
626
-		foreach( $config as $key => $value )
626
+		foreach ($config as $key => $value)
627 627
 		{
628 628
 			$data['config']['key'][] = $key;
629 629
 			$data['config']['val'][] = $value;
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
640 640
 	 * @return string HTML output
641 641
 	 */
642
-	protected function render( \Aimeos\MW\View\Iface $view )
642
+	protected function render(\Aimeos\MW\View\Iface $view)
643 643
 	{
644 644
 		/** admin/jqadm/service/template-item
645 645
 		 * Relative path to the HTML body template for the service item.
@@ -663,6 +663,6 @@  discard block
 block discarded – undo
663 663
 		$tplconf = 'admin/jqadm/service/template-item';
664 664
 		$default = 'service/item-standard.php';
665 665
 
666
-		return $view->render( $view->config( $tplconf, $default ) );
666
+		return $view->render($view->config($tplconf, $default));
667 667
 	}
668 668
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Customer/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -122,14 +122,12 @@  discard block
 block discarded – undo
122 122
 				$view->tabindex = ++$idx + 1;
123 123
 				$view->itemBody .= $client->copy();
124 124
 			}
125
-		}
126
-		catch( \Aimeos\MShop\Exception $e )
125
+		} catch( \Aimeos\MShop\Exception $e )
127 126
 		{
128 127
 			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
129 128
 			$view->errors = $view->get( 'errors', [] ) + $error;
130 129
 			$this->logException( $e );
131
-		}
132
-		catch( \Exception $e )
130
+		} catch( \Exception $e )
133 131
 		{
134 132
 			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
135 133
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -172,14 +170,12 @@  discard block
 block discarded – undo
172 170
 				$view->tabindex = ++$idx + 1;
173 171
 				$view->itemBody .= $client->create();
174 172
 			}
175
-		}
176
-		catch( \Aimeos\MShop\Exception $e )
173
+		} catch( \Aimeos\MShop\Exception $e )
177 174
 		{
178 175
 			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
179 176
 			$view->errors = $view->get( 'errors', [] ) + $error;
180 177
 			$this->logException( $e );
181
-		}
182
-		catch( \Exception $e )
178
+		} catch( \Exception $e )
183 179
 		{
184 180
 			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
185 181
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -220,14 +216,12 @@  discard block
 block discarded – undo
220 216
 
221 217
 			$this->nextAction( $view, 'search', 'customer', null, 'delete' );
222 218
 			return;
223
-		}
224
-		catch( \Aimeos\MShop\Exception $e )
219
+		} catch( \Aimeos\MShop\Exception $e )
225 220
 		{
226 221
 			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
227 222
 			$view->errors = $view->get( 'errors', [] ) + $error;
228 223
 			$this->logException( $e );
229
-		}
230
-		catch( \Exception $e )
224
+		} catch( \Exception $e )
231 225
 		{
232 226
 			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
233 227
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -269,14 +263,12 @@  discard block
 block discarded – undo
269 263
 				$view->tabindex = ++$idx + 1;
270 264
 				$view->itemBody .= $client->get();
271 265
 			}
272
-		}
273
-		catch( \Aimeos\MShop\Exception $e )
266
+		} catch( \Aimeos\MShop\Exception $e )
274 267
 		{
275 268
 			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
276 269
 			$view->errors = $view->get( 'errors', [] ) + $error;
277 270
 			$this->logException( $e );
278
-		}
279
-		catch( \Exception $e )
271
+		} catch( \Exception $e )
280 272
 		{
281 273
 			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
282 274
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -313,18 +305,15 @@  discard block
 block discarded – undo
313 305
 
314 306
 			$this->nextAction( $view, $view->param( 'next' ), 'customer', $view->item->getId(), 'save' );
315 307
 			return;
316
-		}
317
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
308
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
318 309
 		{
319 310
 			// fall through to create
320
-		}
321
-		catch( \Aimeos\MShop\Exception $e )
311
+		} catch( \Aimeos\MShop\Exception $e )
322 312
 		{
323 313
 			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
324 314
 			$view->errors = $view->get( 'errors', [] ) + $error;
325 315
 			$this->logException( $e );
326
-		}
327
-		catch( \Exception $e )
316
+		} catch( \Exception $e )
328 317
 		{
329 318
 			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
330 319
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -363,14 +352,12 @@  discard block
 block discarded – undo
363 352
 			foreach( $this->getSubClients() as $client ) {
364 353
 				$view->itemBody .= $client->search();
365 354
 			}
366
-		}
367
-		catch( \Aimeos\MShop\Exception $e )
355
+		} catch( \Aimeos\MShop\Exception $e )
368 356
 		{
369 357
 			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
370 358
 			$view->errors = $view->get( 'errors', [] ) + $error;
371 359
 			$this->logException( $e );
372
-		}
373
-		catch( \Exception $e )
360
+		} catch( \Exception $e )
374 361
 		{
375 362
 			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
376 363
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +112 added lines, -112 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\Customer;
12 12
 
13
-sprintf( 'customer' ); // for translation
13
+sprintf('customer'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,38 +35,38 @@  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\Factory::createManager( $context, 'customer' );
43
-			$view->item = $manager->getItem( $id, $this->getDomains() );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
43
+			$view->item = $manager->getItem($id, $this->getDomains());
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->itemGroups = $this->getGroupItems();
48 48
 			$view->itemBody = '';
49 49
 
50
-			foreach( $this->getSubClients() as $idx => $client )
50
+			foreach ($this->getSubClients() as $idx => $client)
51 51
 			{
52 52
 				$view->tabindex = ++$idx + 1;
53 53
 				$view->itemBody .= $client->copy();
54 54
 			}
55 55
 		}
56
-		catch( \Aimeos\MShop\Exception $e )
56
+		catch (\Aimeos\MShop\Exception $e)
57 57
 		{
58
-			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
59
-			$view->errors = $view->get( 'errors', [] ) + $error;
60
-			$this->logException( $e );
58
+			$error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
59
+			$view->errors = $view->get('errors', []) + $error;
60
+			$this->logException($e);
61 61
 		}
62
-		catch( \Exception $e )
62
+		catch (\Exception $e)
63 63
 		{
64
-			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
65
-			$view->errors = $view->get( 'errors', [] ) + $error;
66
-			$this->logException( $e );
64
+			$error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
65
+			$view->errors = $view->get('errors', []) + $error;
66
+			$this->logException($e);
67 67
 		}
68 68
 
69
-		return $this->render( $view );
69
+		return $this->render($view);
70 70
 	}
71 71
 
72 72
 
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 
83 83
 		try
84 84
 		{
85
-			$data = $view->param( 'item', [] );
85
+			$data = $view->param('item', []);
86 86
 
87
-			if( !isset( $view->item ) ) {
88
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'customer' )->createItem();
87
+			if (!isset($view->item)) {
88
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'customer')->createItem();
89 89
 			}
90 90
 
91 91
 			$data['customer.siteid'] = $view->item->getSiteId();
@@ -95,26 +95,26 @@  discard block
 block discarded – undo
95 95
 			$view->itemData = $data;
96 96
 			$view->itemBody = '';
97 97
 
98
-			foreach( $this->getSubClients() as $idx => $client )
98
+			foreach ($this->getSubClients() as $idx => $client)
99 99
 			{
100 100
 				$view->tabindex = ++$idx + 1;
101 101
 				$view->itemBody .= $client->create();
102 102
 			}
103 103
 		}
104
-		catch( \Aimeos\MShop\Exception $e )
104
+		catch (\Aimeos\MShop\Exception $e)
105 105
 		{
106
-			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
107
-			$view->errors = $view->get( 'errors', [] ) + $error;
108
-			$this->logException( $e );
106
+			$error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
107
+			$view->errors = $view->get('errors', []) + $error;
108
+			$this->logException($e);
109 109
 		}
110
-		catch( \Exception $e )
110
+		catch (\Exception $e)
111 111
 		{
112
-			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
113
-			$view->errors = $view->get( 'errors', [] ) + $error;
114
-			$this->logException( $e );
112
+			$error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
113
+			$view->errors = $view->get('errors', []) + $error;
114
+			$this->logException($e);
115 115
 		}
116 116
 
117
-		return $this->render( $view );
117
+		return $this->render($view);
118 118
 	}
119 119
 
120 120
 
@@ -128,39 +128,39 @@  discard block
 block discarded – undo
128 128
 		$view = $this->getView();
129 129
 		$context = $this->getContext();
130 130
 
131
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
131
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
132 132
 		$manager->begin();
133 133
 
134 134
 		try
135 135
 		{
136
-			if( ( $id = $view->param( 'id' ) ) === null ) {
137
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
136
+			if (($id = $view->param('id')) === null) {
137
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
138 138
 			}
139 139
 
140
-			$view->item = $manager->getItem( $id, $this->getDomains() );
140
+			$view->item = $manager->getItem($id, $this->getDomains());
141 141
 
142
-			foreach( $this->getSubClients() as $client ) {
142
+			foreach ($this->getSubClients() as $client) {
143 143
 				$client->delete();
144 144
 			}
145 145
 
146
-			$manager->saveItem( $view->item );
147
-			$manager->deleteItem( $id );
146
+			$manager->saveItem($view->item);
147
+			$manager->deleteItem($id);
148 148
 			$manager->commit();
149 149
 
150
-			$this->nextAction( $view, 'search', 'customer', null, 'delete' );
150
+			$this->nextAction($view, 'search', 'customer', null, 'delete');
151 151
 			return;
152 152
 		}
153
-		catch( \Aimeos\MShop\Exception $e )
153
+		catch (\Aimeos\MShop\Exception $e)
154 154
 		{
155
-			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
156
-			$view->errors = $view->get( 'errors', [] ) + $error;
157
-			$this->logException( $e );
155
+			$error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
156
+			$view->errors = $view->get('errors', []) + $error;
157
+			$this->logException($e);
158 158
 		}
159
-		catch( \Exception $e )
159
+		catch (\Exception $e)
160 160
 		{
161
-			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
162
-			$view->errors = $view->get( 'errors', [] ) + $error;
163
-			$this->logException( $e );
161
+			$error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
162
+			$view->errors = $view->get('errors', []) + $error;
163
+			$this->logException($e);
164 164
 		}
165 165
 
166 166
 		$manager->rollback();
@@ -181,38 +181,38 @@  discard block
 block discarded – undo
181 181
 
182 182
 		try
183 183
 		{
184
-			if( ( $id = $view->param( 'id' ) ) === null ) {
185
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
184
+			if (($id = $view->param('id')) === null) {
185
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
186 186
 			}
187 187
 
188
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
188
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
189 189
 
190
-			$view->item = $manager->getItem( $id, $this->getDomains() );
190
+			$view->item = $manager->getItem($id, $this->getDomains());
191 191
 			$view->itemSubparts = $this->getSubClientNames();
192
-			$view->itemData = $this->toArray( $view->item );
192
+			$view->itemData = $this->toArray($view->item);
193 193
 			$view->itemGroups = $this->getGroupItems();
194 194
 			$view->itemBody = '';
195 195
 
196
-			foreach( $this->getSubClients() as $idx => $client )
196
+			foreach ($this->getSubClients() as $idx => $client)
197 197
 			{
198 198
 				$view->tabindex = ++$idx + 1;
199 199
 				$view->itemBody .= $client->get();
200 200
 			}
201 201
 		}
202
-		catch( \Aimeos\MShop\Exception $e )
202
+		catch (\Aimeos\MShop\Exception $e)
203 203
 		{
204
-			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
205
-			$view->errors = $view->get( 'errors', [] ) + $error;
206
-			$this->logException( $e );
204
+			$error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
205
+			$view->errors = $view->get('errors', []) + $error;
206
+			$this->logException($e);
207 207
 		}
208
-		catch( \Exception $e )
208
+		catch (\Exception $e)
209 209
 		{
210
-			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
211
-			$view->errors = $view->get( 'errors', [] ) + $error;
212
-			$this->logException( $e );
210
+			$error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
211
+			$view->errors = $view->get('errors', []) + $error;
212
+			$this->logException($e);
213 213
 		}
214 214
 
215
-		return $this->render( $view );
215
+		return $this->render($view);
216 216
 	}
217 217
 
218 218
 
@@ -226,40 +226,40 @@  discard block
 block discarded – undo
226 226
 		$view = $this->getView();
227 227
 		$context = $this->getContext();
228 228
 
229
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
229
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
230 230
 		$manager->begin();
231 231
 
232 232
 		try
233 233
 		{
234
-			$item = $this->fromArray( $view->param( 'item', [] ) );
235
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
234
+			$item = $this->fromArray($view->param('item', []));
235
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
236 236
 			$view->itemBody = '';
237 237
 
238
-			foreach( $this->getSubClients() as $client ) {
238
+			foreach ($this->getSubClients() as $client) {
239 239
 				$view->itemBody .= $client->save();
240 240
 			}
241 241
 
242
-			$manager->saveItem( clone $view->item );
242
+			$manager->saveItem(clone $view->item);
243 243
 			$manager->commit();
244 244
 
245
-			$this->nextAction( $view, $view->param( 'next' ), 'customer', $view->item->getId(), 'save' );
245
+			$this->nextAction($view, $view->param('next'), 'customer', $view->item->getId(), 'save');
246 246
 			return;
247 247
 		}
248
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
248
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
249 249
 		{
250 250
 			// fall through to create
251 251
 		}
252
-		catch( \Aimeos\MShop\Exception $e )
252
+		catch (\Aimeos\MShop\Exception $e)
253 253
 		{
254
-			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
255
-			$view->errors = $view->get( 'errors', [] ) + $error;
256
-			$this->logException( $e );
254
+			$error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
255
+			$view->errors = $view->get('errors', []) + $error;
256
+			$this->logException($e);
257 257
 		}
258
-		catch( \Exception $e )
258
+		catch (\Exception $e)
259 259
 		{
260
-			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
261
-			$view->errors = $view->get( 'errors', [] ) + $error;
262
-			$this->logException( $e );
260
+			$error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
261
+			$view->errors = $view->get('errors', []) + $error;
262
+			$this->logException($e);
263 263
 		}
264 264
 
265 265
 		$manager->rollback();
@@ -281,31 +281,31 @@  discard block
 block discarded – undo
281 281
 		try
282 282
 		{
283 283
 			$total = 0;
284
-			$params = $this->storeSearchParams( $view->param(), 'customer' );
285
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
286
-			$search = $this->initCriteria( $manager->createSearch(), $params );
284
+			$params = $this->storeSearchParams($view->param(), 'customer');
285
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
286
+			$search = $this->initCriteria($manager->createSearch(), $params);
287 287
 
288
-			$view->items = $manager->searchItems( $search, $this->getDomains(), $total );
289
-			$view->filterAttributes = $manager->getSearchAttributes( true );
288
+			$view->items = $manager->searchItems($search, $this->getDomains(), $total);
289
+			$view->filterAttributes = $manager->getSearchAttributes(true);
290 290
 			$view->filterOperators = $search->getOperators();
291 291
 			$view->total = $total;
292 292
 			$view->itemBody = '';
293 293
 
294
-			foreach( $this->getSubClients() as $client ) {
294
+			foreach ($this->getSubClients() as $client) {
295 295
 				$view->itemBody .= $client->search();
296 296
 			}
297 297
 		}
298
-		catch( \Aimeos\MShop\Exception $e )
298
+		catch (\Aimeos\MShop\Exception $e)
299 299
 		{
300
-			$error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
301
-			$view->errors = $view->get( 'errors', [] ) + $error;
302
-			$this->logException( $e );
300
+			$error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
301
+			$view->errors = $view->get('errors', []) + $error;
302
+			$this->logException($e);
303 303
 		}
304
-		catch( \Exception $e )
304
+		catch (\Exception $e)
305 305
 		{
306
-			$error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
307
-			$view->errors = $view->get( 'errors', [] ) + $error;
308
-			$this->logException( $e );
306
+			$error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
307
+			$view->errors = $view->get('errors', []) + $error;
308
+			$this->logException($e);
309 309
 		}
310 310
 
311 311
 		/** admin/jqadm/customer/template-list
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 		$tplconf = 'admin/jqadm/customer/template-list';
331 331
 		$default = 'customer/list-standard.php';
332 332
 
333
-		return $view->render( $view->config( $tplconf, $default ) );
333
+		return $view->render($view->config($tplconf, $default));
334 334
 	}
335 335
 
336 336
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	 * @param string|null $name Name of the sub-client (Default if null)
342 342
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
343 343
 	 */
344
-	public function getSubClient( $type, $name = null )
344
+	public function getSubClient($type, $name = null)
345 345
 	{
346 346
 		/** admin/jqadm/customer/decorators/excludes
347 347
 		 * Excludes decorators added by the "common" option from the customer JQAdm client
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		 * @see admin/jqadm/customer/decorators/excludes
417 417
 		 * @see admin/jqadm/customer/decorators/global
418 418
 		 */
419
-		return $this->createSubClient( 'customer/' . $type, $name );
419
+		return $this->createSubClient('customer/' . $type, $name);
420 420
 	}
421 421
 
422 422
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 		 */
441 441
 		$domains = ['customer/address', 'customer/group', 'customer/property'];
442 442
 
443
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/domains', $domains );
443
+		return $this->getContext()->getConfig()->get('admin/jqadm/customer/domains', $domains);
444 444
 	}
445 445
 
446 446
 
@@ -452,20 +452,20 @@  discard block
 block discarded – undo
452 452
 	protected function getGroupItems()
453 453
 	{
454 454
 		$list = [];
455
-		$isSuper = $this->getView()->access( ['super'] );
456
-		$isAdmin = $this->getView()->access( ['admin'] );
455
+		$isSuper = $this->getView()->access(['super']);
456
+		$isAdmin = $this->getView()->access(['admin']);
457 457
 
458
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/group' );
458
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/group');
459 459
 		$search = $manager->createSearch();
460
-		$search->setSortations( [$search->sort( '+', 'customer.group.label' )] );
460
+		$search->setSortations([$search->sort('+', 'customer.group.label')]);
461 461
 
462
-		foreach( $manager->searchItems( $search ) as $groupId => $groupItem )
462
+		foreach ($manager->searchItems($search) as $groupId => $groupItem)
463 463
 		{
464
-			if( !$isSuper && in_array( $groupItem->getCode(), ['super'] ) ) {
464
+			if (!$isSuper && in_array($groupItem->getCode(), ['super'])) {
465 465
 				continue;
466 466
 			}
467 467
 
468
-			if( !$isSuper && !$isAdmin && in_array( $groupItem->getCode(), ['super', 'admin', 'editor'] ) ) {
468
+			if (!$isSuper && !$isAdmin && in_array($groupItem->getCode(), ['super', 'admin', 'editor'])) {
469 469
 				continue;
470 470
 			}
471 471
 
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 		 * @since 2017.07
517 517
 		 * @category Developer
518 518
 		 */
519
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/standard/subparts', [] );
519
+		return $this->getContext()->getConfig()->get('admin/jqadm/customer/standard/subparts', []);
520 520
 	}
521 521
 
522 522
 
@@ -527,21 +527,21 @@  discard block
 block discarded – undo
527 527
 	 * @param string[] Data array
528 528
 	 * @return \Aimeos\MShop\Customer\Item\Iface New customer item object
529 529
 	 */
530
-	protected function fromArray( array $data )
530
+	protected function fromArray(array $data)
531 531
 	{
532 532
 		$data['customer.label'] = $data['customer.firstname'] . ' ' . $data['customer.lastname'];
533 533
 		$data['customer.code'] = $data['customer.email'];
534 534
 
535
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
535
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
536 536
 
537
-		if( isset( $data['customer.id'] ) && $data['customer.id'] != '' ) {
538
-			$item = $manager->getItem( $data['customer.id'], $this->getDomains() );
537
+		if (isset($data['customer.id']) && $data['customer.id'] != '') {
538
+			$item = $manager->getItem($data['customer.id'], $this->getDomains());
539 539
 		} else {
540 540
 			$item = $manager->createItem();
541 541
 		}
542 542
 
543
-		$item->fromArray( $data );
544
-		$item->setGroups( array_intersect( array_keys( $this->getGroupItems() ), $item->getGroups() ) );
543
+		$item->fromArray($data);
544
+		$item->setGroups(array_intersect(array_keys($this->getGroupItems()), $item->getGroups()));
545 545
 
546 546
 		return $item;
547 547
 	}
@@ -553,11 +553,11 @@  discard block
 block discarded – undo
553 553
 	 * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object
554 554
 	 * @return string[] Multi-dimensional associative list of item data
555 555
 	 */
556
-	protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false )
556
+	protected function toArray(\Aimeos\MShop\Customer\Item\Iface $item, $copy = false)
557 557
 	{
558
-		$data = $item->toArray( true );
558
+		$data = $item->toArray(true);
559 559
 
560
-		if( $copy === true )
560
+		if ($copy === true)
561 561
 		{
562 562
 			$data['customer.siteid'] = $this->getContext()->getLocale()->getSiteId();
563 563
 			$data['customer.email'] = '';
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
575 575
 	 * @return string HTML output
576 576
 	 */
577
-	protected function render( \Aimeos\MW\View\Iface $view )
577
+	protected function render(\Aimeos\MW\View\Iface $view)
578 578
 	{
579 579
 		/** admin/jqadm/customer/template-item
580 580
 		 * Relative path to the HTML body template for the customer item.
@@ -598,6 +598,6 @@  discard block
 block discarded – undo
598 598
 		$tplconf = 'admin/jqadm/customer/template-item';
599 599
 		$default = 'customer/item-standard.php';
600 600
 
601
-		return $view->render( $view->config( $tplconf, $default ) );
601
+		return $view->render($view->config($tplconf, $default));
602 602
 	}
603 603
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Log/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,14 +84,12 @@
 block discarded – undo
84 84
 			foreach( $this->getSubClients() as $client ) {
85 85
 				$view->itemBody .= $client->search();
86 86
 			}
87
-		}
88
-		catch( \Aimeos\MAdmin\Exception $e )
87
+		} catch( \Aimeos\MAdmin\Exception $e )
89 88
 		{
90 89
 			$error = array( 'log-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
91 90
 			$view->errors = $view->get( 'errors', [] ) + $error;
92 91
 			$this->logException( $e );
93
-		}
94
-		catch( \Exception $e )
92
+		} catch( \Exception $e )
95 93
 		{
96 94
 			$error = array( 'log-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
97 95
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 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\Log;
12 12
 
13
-sprintf( 'log' ); // for translation
13
+sprintf('log'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -36,32 +36,32 @@  discard block
 block discarded – undo
36 36
 		try
37 37
 		{
38 38
 			$total = 0;
39
-			$params = $this->storeSearchParams( $view->param(), 'log' );
40
-			$manager = \Aimeos\MAdmin\Factory::createManager( $context, 'log' );
39
+			$params = $this->storeSearchParams($view->param(), 'log');
40
+			$manager = \Aimeos\MAdmin\Factory::createManager($context, 'log');
41 41
 
42 42
 			$search = $manager->createSearch();
43
-			$search->setSortations( [$search->sort( '-', 'log.timestamp')] );
44
-			$search = $this->initCriteria( $search, $params );
43
+			$search->setSortations([$search->sort('-', 'log.timestamp')]);
44
+			$search = $this->initCriteria($search, $params);
45 45
 
46
-			$view->items = $manager->searchItems( $search, [], $total );
46
+			$view->items = $manager->searchItems($search, [], $total);
47 47
 			$view->total = $total;
48 48
 			$view->itemBody = '';
49 49
 
50
-			foreach( $this->getSubClients() as $client ) {
50
+			foreach ($this->getSubClients() as $client) {
51 51
 				$view->itemBody .= $client->search();
52 52
 			}
53 53
 		}
54
-		catch( \Aimeos\MAdmin\Exception $e )
54
+		catch (\Aimeos\MAdmin\Exception $e)
55 55
 		{
56
-			$error = array( 'log-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
57
-			$view->errors = $view->get( 'errors', [] ) + $error;
58
-			$this->logException( $e );
56
+			$error = array('log-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
57
+			$view->errors = $view->get('errors', []) + $error;
58
+			$this->logException($e);
59 59
 		}
60
-		catch( \Exception $e )
60
+		catch (\Exception $e)
61 61
 		{
62
-			$error = array( 'log-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
63
-			$view->errors = $view->get( 'errors', [] ) + $error;
64
-			$this->logException( $e );
62
+			$error = array('log-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
63
+			$view->errors = $view->get('errors', []) + $error;
64
+			$this->logException($e);
65 65
 		}
66 66
 
67 67
 		/** admin/jqadm/log/template-list
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		$tplconf = 'admin/jqadm/log/template-list';
87 87
 		$default = 'log/list-standard.php';
88 88
 
89
-		return $view->render( $view->config( $tplconf, $default ) );
89
+		return $view->render($view->config($tplconf, $default));
90 90
 	}
91 91
 
92 92
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 * @param string|null $name Name of the sub-client (Default if null)
98 98
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
99 99
 	 */
100
-	public function getSubClient( $type, $name = null )
100
+	public function getSubClient($type, $name = null)
101 101
 	{
102 102
 		/** admin/jqadm/log/decorators/excludes
103 103
 		 * Excludes decorators added by the "common" option from the log JQAdm client
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		 * @see admin/jqadm/log/decorators/excludes
173 173
 		 * @see admin/jqadm/log/decorators/global
174 174
 		 */
175
-		return $this->createSubClient( 'log/' . $type, $name );
175
+		return $this->createSubClient('log/' . $type, $name);
176 176
 	}
177 177
 
178 178
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 		 * @since 2018.04
217 217
 		 * @category Developer
218 218
 		 */
219
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/log/standard/subparts', [] );
219
+		return $this->getContext()->getConfig()->get('admin/jqadm/log/standard/subparts', []);
220 220
 	}
221 221
 
222 222
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
227 227
 	 * @return string HTML output
228 228
 	 */
229
-	protected function render( \Aimeos\MW\View\Iface $view )
229
+	protected function render(\Aimeos\MW\View\Iface $view)
230 230
 	{
231 231
 		/** admin/jqadm/log/template-item
232 232
 		 * Relative path to the HTML body template for the log item.
@@ -250,6 +250,6 @@  discard block
 block discarded – undo
250 250
 		$tplconf = 'admin/jqadm/log/template-item';
251 251
 		$default = 'log/item-standard.php';
252 252
 
253
-		return $view->render( $view->config( $tplconf, $default ) );
253
+		return $view->render($view->config($tplconf, $default));
254 254
 	}
255 255
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Supplier/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -121,14 +121,12 @@  discard block
 block discarded – undo
121 121
 				$view->tabindex = ++$idx + 1;
122 122
 				$view->itemBody .= $client->copy();
123 123
 			}
124
-		}
125
-		catch( \Aimeos\MShop\Exception $e )
124
+		} catch( \Aimeos\MShop\Exception $e )
126 125
 		{
127 126
 			$error = array( 'supplier-item' => $context->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( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
134 132
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -170,14 +168,12 @@  discard block
 block discarded – undo
170 168
 				$view->tabindex = ++$idx + 1;
171 169
 				$view->itemBody .= $client->create();
172 170
 			}
173
-		}
174
-		catch( \Aimeos\MShop\Exception $e )
171
+		} catch( \Aimeos\MShop\Exception $e )
175 172
 		{
176 173
 			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
177 174
 			$view->errors = $view->get( 'errors', [] ) + $error;
178 175
 			$this->logException( $e );
179
-		}
180
-		catch( \Exception $e )
176
+		} catch( \Exception $e )
181 177
 		{
182 178
 			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
183 179
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -218,14 +214,12 @@  discard block
 block discarded – undo
218 214
 
219 215
 			$this->nextAction( $view, 'search', 'supplier', null, 'delete' );
220 216
 			return;
221
-		}
222
-		catch( \Aimeos\MShop\Exception $e )
217
+		} catch( \Aimeos\MShop\Exception $e )
223 218
 		{
224 219
 			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
225 220
 			$view->errors = $view->get( 'errors', [] ) + $error;
226 221
 			$this->logException( $e );
227
-		}
228
-		catch( \Exception $e )
222
+		} catch( \Exception $e )
229 223
 		{
230 224
 			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
231 225
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -266,14 +260,12 @@  discard block
 block discarded – undo
266 260
 				$view->tabindex = ++$idx + 1;
267 261
 				$view->itemBody .= $client->get();
268 262
 			}
269
-		}
270
-		catch( \Aimeos\MShop\Exception $e )
263
+		} catch( \Aimeos\MShop\Exception $e )
271 264
 		{
272 265
 			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
273 266
 			$view->errors = $view->get( 'errors', [] ) + $error;
274 267
 			$this->logException( $e );
275
-		}
276
-		catch( \Exception $e )
268
+		} catch( \Exception $e )
277 269
 		{
278 270
 			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
279 271
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -310,18 +302,15 @@  discard block
 block discarded – undo
310 302
 
311 303
 			$this->nextAction( $view, $view->param( 'next' ), 'supplier', $view->item->getId(), 'save' );
312 304
 			return;
313
-		}
314
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
305
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
315 306
 		{
316 307
 			// fall through to create
317
-		}
318
-		catch( \Aimeos\MShop\Exception $e )
308
+		} catch( \Aimeos\MShop\Exception $e )
319 309
 		{
320 310
 			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
321 311
 			$view->errors = $view->get( 'errors', [] ) + $error;
322 312
 			$this->logException( $e );
323
-		}
324
-		catch( \Exception $e )
313
+		} catch( \Exception $e )
325 314
 		{
326 315
 			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
327 316
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -360,14 +349,12 @@  discard block
 block discarded – undo
360 349
 			foreach( $this->getSubClients() as $client ) {
361 350
 				$view->itemBody .= $client->search();
362 351
 			}
363
-		}
364
-		catch( \Aimeos\MShop\Exception $e )
352
+		} catch( \Aimeos\MShop\Exception $e )
365 353
 		{
366 354
 			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
367 355
 			$view->errors = $view->get( 'errors', [] ) + $error;
368 356
 			$this->logException( $e );
369
-		}
370
-		catch( \Exception $e )
357
+		} catch( \Exception $e )
371 358
 		{
372 359
 			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
373 360
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 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\Supplier;
12 12
 
13
-sprintf( 'supplier' ); // for translation
13
+sprintf('supplier'); // 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\Factory::createManager( $context, 'supplier' );
43
-			$view->item = $manager->getItem( $id, $this->getDomains() );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'supplier');
43
+			$view->item = $manager->getItem($id, $this->getDomains());
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( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
58
-			$view->errors = $view->get( 'errors', [] ) + $error;
59
-			$this->logException( $e );
57
+			$error = array('supplier-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( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
64
-			$view->errors = $view->get( 'errors', [] ) + $error;
65
-			$this->logException( $e );
63
+			$error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
64
+			$view->errors = $view->get('errors', []) + $error;
65
+			$this->logException($e);
66 66
 		}
67 67
 
68
-		return $this->render( $view );
68
+		return $this->render($view);
69 69
 	}
70 70
 
71 71
 
@@ -81,10 +81,10 @@  discard block
 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\Factory::createManager( $context, 'supplier' )->createItem();
86
+			if (!isset($view->item)) {
87
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'supplier')->createItem();
88 88
 			}
89 89
 
90 90
 			$data['supplier.siteid'] = $view->item->getSiteId();
@@ -93,26 +93,26 @@  discard block
 block discarded – undo
93 93
 			$view->itemData = $data;
94 94
 			$view->itemBody = '';
95 95
 
96
-			foreach( $this->getSubClients() as $idx => $client )
96
+			foreach ($this->getSubClients() as $idx => $client)
97 97
 			{
98 98
 				$view->tabindex = ++$idx + 1;
99 99
 				$view->itemBody .= $client->create();
100 100
 			}
101 101
 		}
102
-		catch( \Aimeos\MShop\Exception $e )
102
+		catch (\Aimeos\MShop\Exception $e)
103 103
 		{
104
-			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
105
-			$view->errors = $view->get( 'errors', [] ) + $error;
106
-			$this->logException( $e );
104
+			$error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
105
+			$view->errors = $view->get('errors', []) + $error;
106
+			$this->logException($e);
107 107
 		}
108
-		catch( \Exception $e )
108
+		catch (\Exception $e)
109 109
 		{
110
-			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
111
-			$view->errors = $view->get( 'errors', [] ) + $error;
112
-			$this->logException( $e );
110
+			$error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
111
+			$view->errors = $view->get('errors', []) + $error;
112
+			$this->logException($e);
113 113
 		}
114 114
 
115
-		return $this->render( $view );
115
+		return $this->render($view);
116 116
 	}
117 117
 
118 118
 
@@ -126,39 +126,39 @@  discard block
 block discarded – undo
126 126
 		$view = $this->getView();
127 127
 		$context = $this->getContext();
128 128
 
129
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier' );
129
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'supplier');
130 130
 		$manager->begin();
131 131
 
132 132
 		try
133 133
 		{
134
-			if( ( $id = $view->param( 'id' ) ) === null ) {
135
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
134
+			if (($id = $view->param('id')) === null) {
135
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
136 136
 			}
137 137
 
138
-			$view->item = $manager->getItem( $id, $this->getDomains() );
138
+			$view->item = $manager->getItem($id, $this->getDomains());
139 139
 
140
-			foreach( $this->getSubClients() as $client ) {
140
+			foreach ($this->getSubClients() as $client) {
141 141
 				$client->delete();
142 142
 			}
143 143
 
144
-			$manager->saveItem( $view->item );
145
-			$manager->deleteItem( $id );
144
+			$manager->saveItem($view->item);
145
+			$manager->deleteItem($id);
146 146
 			$manager->commit();
147 147
 
148
-			$this->nextAction( $view, 'search', 'supplier', null, 'delete' );
148
+			$this->nextAction($view, 'search', 'supplier', null, 'delete');
149 149
 			return;
150 150
 		}
151
-		catch( \Aimeos\MShop\Exception $e )
151
+		catch (\Aimeos\MShop\Exception $e)
152 152
 		{
153
-			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
154
-			$view->errors = $view->get( 'errors', [] ) + $error;
155
-			$this->logException( $e );
153
+			$error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
154
+			$view->errors = $view->get('errors', []) + $error;
155
+			$this->logException($e);
156 156
 		}
157
-		catch( \Exception $e )
157
+		catch (\Exception $e)
158 158
 		{
159
-			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
160
-			$view->errors = $view->get( 'errors', [] ) + $error;
161
-			$this->logException( $e );
159
+			$error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
160
+			$view->errors = $view->get('errors', []) + $error;
161
+			$this->logException($e);
162 162
 		}
163 163
 
164 164
 		$manager->rollback();
@@ -179,37 +179,37 @@  discard block
 block discarded – undo
179 179
 
180 180
 		try
181 181
 		{
182
-			if( ( $id = $view->param( 'id' ) ) === null ) {
183
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
182
+			if (($id = $view->param('id')) === null) {
183
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
184 184
 			}
185 185
 
186
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier' );
186
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'supplier');
187 187
 
188
-			$view->item = $manager->getItem( $id, $this->getDomains() );
188
+			$view->item = $manager->getItem($id, $this->getDomains());
189 189
 			$view->itemSubparts = $this->getSubClientNames();
190
-			$view->itemData = $this->toArray( $view->item );
190
+			$view->itemData = $this->toArray($view->item);
191 191
 			$view->itemBody = '';
192 192
 
193
-			foreach( $this->getSubClients() as $idx => $client )
193
+			foreach ($this->getSubClients() as $idx => $client)
194 194
 			{
195 195
 				$view->tabindex = ++$idx + 1;
196 196
 				$view->itemBody .= $client->get();
197 197
 			}
198 198
 		}
199
-		catch( \Aimeos\MShop\Exception $e )
199
+		catch (\Aimeos\MShop\Exception $e)
200 200
 		{
201
-			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
202
-			$view->errors = $view->get( 'errors', [] ) + $error;
203
-			$this->logException( $e );
201
+			$error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
202
+			$view->errors = $view->get('errors', []) + $error;
203
+			$this->logException($e);
204 204
 		}
205
-		catch( \Exception $e )
205
+		catch (\Exception $e)
206 206
 		{
207
-			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
208
-			$view->errors = $view->get( 'errors', [] ) + $error;
209
-			$this->logException( $e );
207
+			$error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
208
+			$view->errors = $view->get('errors', []) + $error;
209
+			$this->logException($e);
210 210
 		}
211 211
 
212
-		return $this->render( $view );
212
+		return $this->render($view);
213 213
 	}
214 214
 
215 215
 
@@ -223,40 +223,40 @@  discard block
 block discarded – undo
223 223
 		$view = $this->getView();
224 224
 		$context = $this->getContext();
225 225
 
226
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier' );
226
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'supplier');
227 227
 		$manager->begin();
228 228
 
229 229
 		try
230 230
 		{
231
-			$item = $this->fromArray( $view->param( 'item', [] ) );
232
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
231
+			$item = $this->fromArray($view->param('item', []));
232
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
233 233
 			$view->itemBody = '';
234 234
 
235
-			foreach( $this->getSubClients() as $client ) {
235
+			foreach ($this->getSubClients() as $client) {
236 236
 				$view->itemBody .= $client->save();
237 237
 			}
238 238
 
239
-			$manager->saveItem( clone $view->item );
239
+			$manager->saveItem(clone $view->item);
240 240
 			$manager->commit();
241 241
 
242
-			$this->nextAction( $view, $view->param( 'next' ), 'supplier', $view->item->getId(), 'save' );
242
+			$this->nextAction($view, $view->param('next'), 'supplier', $view->item->getId(), 'save');
243 243
 			return;
244 244
 		}
245
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
245
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
246 246
 		{
247 247
 			// fall through to create
248 248
 		}
249
-		catch( \Aimeos\MShop\Exception $e )
249
+		catch (\Aimeos\MShop\Exception $e)
250 250
 		{
251
-			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
252
-			$view->errors = $view->get( 'errors', [] ) + $error;
253
-			$this->logException( $e );
251
+			$error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
252
+			$view->errors = $view->get('errors', []) + $error;
253
+			$this->logException($e);
254 254
 		}
255
-		catch( \Exception $e )
255
+		catch (\Exception $e)
256 256
 		{
257
-			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
258
-			$view->errors = $view->get( 'errors', [] ) + $error;
259
-			$this->logException( $e );
257
+			$error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
258
+			$view->errors = $view->get('errors', []) + $error;
259
+			$this->logException($e);
260 260
 		}
261 261
 
262 262
 		$manager->rollback();
@@ -278,31 +278,31 @@  discard block
 block discarded – undo
278 278
 		try
279 279
 		{
280 280
 			$total = 0;
281
-			$params = $this->storeSearchParams( $view->param(), 'supplier' );
282
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier' );
283
-			$search = $this->initCriteria( $manager->createSearch(), $params );
281
+			$params = $this->storeSearchParams($view->param(), 'supplier');
282
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'supplier');
283
+			$search = $this->initCriteria($manager->createSearch(), $params);
284 284
 
285
-			$view->items = $manager->searchItems( $search, $this->getDomains(), $total );
286
-			$view->filterAttributes = $manager->getSearchAttributes( true );
285
+			$view->items = $manager->searchItems($search, $this->getDomains(), $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( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
298
-			$view->errors = $view->get( 'errors', [] ) + $error;
299
-			$this->logException( $e );
297
+			$error = array('supplier-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( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
304
-			$view->errors = $view->get( 'errors', [] ) + $error;
305
-			$this->logException( $e );
303
+			$error = array('supplier-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/supplier/template-list
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$tplconf = 'admin/jqadm/supplier/template-list';
328 328
 		$default = 'supplier/list-standard.php';
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/supplier/decorators/excludes
344 344
 		 * Excludes decorators added by the "common" option from the supplier JQAdm client
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 		 * @see admin/jqadm/supplier/decorators/excludes
414 414
 		 * @see admin/jqadm/supplier/decorators/global
415 415
 		 */
416
-		return $this->createSubClient( 'supplier/' . $type, $name );
416
+		return $this->createSubClient('supplier/' . $type, $name);
417 417
 	}
418 418
 
419 419
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 		 */
438 438
 		$domains = ['media', 'supplier/address', 'text'];
439 439
 
440
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/domains', $domains );
440
+		return $this->getContext()->getConfig()->get('admin/jqadm/supplier/domains', $domains);
441 441
 	}
442 442
 
443 443
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		 * @since 2017.10
482 482
 		 * @category Developer
483 483
 		 */
484
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/standard/subparts', [] );
484
+		return $this->getContext()->getConfig()->get('admin/jqadm/supplier/standard/subparts', []);
485 485
 	}
486 486
 
487 487
 
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
 	 * @param string[] Data array
493 493
 	 * @return \Aimeos\MShop\Supplier\Item\Iface New supplier item object
494 494
 	 */
495
-	protected function fromArray( array $data )
495
+	protected function fromArray(array $data)
496 496
 	{
497
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier' );
497
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier');
498 498
 
499
-		if( isset( $data['supplier.id'] ) && $data['supplier.id'] != '' ) {
500
-			$item = $manager->getItem( $data['supplier.id'], $this->getDomains() );
499
+		if (isset($data['supplier.id']) && $data['supplier.id'] != '') {
500
+			$item = $manager->getItem($data['supplier.id'], $this->getDomains());
501 501
 		} else {
502 502
 			$item = $manager->createItem();
503 503
 		}
504 504
 
505
-		$item->fromArray( $data );
505
+		$item->fromArray($data);
506 506
 
507 507
 		return $item;
508 508
 	}
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
 	 * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object
515 515
 	 * @return string[] Multi-dimensional associative list of item data
516 516
 	 */
517
-	protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, $copy = false )
517
+	protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, $copy = false)
518 518
 	{
519
-		$data = $item->toArray( true );
519
+		$data = $item->toArray(true);
520 520
 
521
-		if( $copy === true )
521
+		if ($copy === true)
522 522
 		{
523 523
 			$data['supplier.siteid'] = $this->getContext()->getLocale()->getSiteId();
524 524
 			$data['supplier.code'] = $data['supplier.code'] . '_copy';
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
536 536
 	 * @return string HTML output
537 537
 	 */
538
-	protected function render( \Aimeos\MW\View\Iface $view )
538
+	protected function render(\Aimeos\MW\View\Iface $view)
539 539
 	{
540 540
 		/** admin/jqadm/supplier/template-item
541 541
 		 * Relative path to the HTML body template for the supplier item.
@@ -559,6 +559,6 @@  discard block
 block discarded – undo
559 559
 		$tplconf = 'admin/jqadm/supplier/template-item';
560 560
 		$default = 'supplier/item-standard.php';
561 561
 
562
-		return $view->render( $view->config( $tplconf, $default ) );
562
+		return $view->render($view->config($tplconf, $default));
563 563
 	}
564 564
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Attribute/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -133,14 +133,12 @@  discard block
 block discarded – undo
133 133
 				$view->tabindex = ++$idx + 1;
134 134
 				$view->itemBody .= $client->copy();
135 135
 			}
136
-		}
137
-		catch( \Aimeos\MShop\Exception $e )
136
+		} catch( \Aimeos\MShop\Exception $e )
138 137
 		{
139 138
 			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
140 139
 			$view->errors = $view->get( 'errors', [] ) + $error;
141 140
 			$this->logException( $e );
142
-		}
143
-		catch( \Exception $e )
141
+		} catch( \Exception $e )
144 142
 		{
145 143
 			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
146 144
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -183,14 +181,12 @@  discard block
 block discarded – undo
183 181
 				$view->tabindex = ++$idx + 1;
184 182
 				$view->itemBody .= $client->create();
185 183
 			}
186
-		}
187
-		catch( \Aimeos\MShop\Exception $e )
184
+		} catch( \Aimeos\MShop\Exception $e )
188 185
 		{
189 186
 			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
190 187
 			$view->errors = $view->get( 'errors', [] ) + $error;
191 188
 			$this->logException( $e );
192
-		}
193
-		catch( \Exception $e )
189
+		} catch( \Exception $e )
194 190
 		{
195 191
 			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
196 192
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -231,14 +227,12 @@  discard block
 block discarded – undo
231 227
 
232 228
 			$this->nextAction( $view, 'search', 'attribute', null, 'delete' );
233 229
 			return;
234
-		}
235
-		catch( \Aimeos\MShop\Exception $e )
230
+		} catch( \Aimeos\MShop\Exception $e )
236 231
 		{
237 232
 			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
238 233
 			$view->errors = $view->get( 'errors', [] ) + $error;
239 234
 			$this->logException( $e );
240
-		}
241
-		catch( \Exception $e )
235
+		} catch( \Exception $e )
242 236
 		{
243 237
 			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
244 238
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -280,14 +274,12 @@  discard block
 block discarded – undo
280 274
 				$view->tabindex = ++$idx + 1;
281 275
 				$view->itemBody .= $client->get();
282 276
 			}
283
-		}
284
-		catch( \Aimeos\MShop\Exception $e )
277
+		} catch( \Aimeos\MShop\Exception $e )
285 278
 		{
286 279
 			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
287 280
 			$view->errors = $view->get( 'errors', [] ) + $error;
288 281
 			$this->logException( $e );
289
-		}
290
-		catch( \Exception $e )
282
+		} catch( \Exception $e )
291 283
 		{
292 284
 			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
293 285
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -324,18 +316,15 @@  discard block
 block discarded – undo
324 316
 
325 317
 			$this->nextAction( $view, $view->param( 'next' ), 'attribute', $view->item->getId(), 'save' );
326 318
 			return;
327
-		}
328
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
319
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
329 320
 		{
330 321
 			// fall through to create
331
-		}
332
-		catch( \Aimeos\MShop\Exception $e )
322
+		} catch( \Aimeos\MShop\Exception $e )
333 323
 		{
334 324
 			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
335 325
 			$view->errors = $view->get( 'errors', [] ) + $error;
336 326
 			$this->logException( $e );
337
-		}
338
-		catch( \Exception $e )
327
+		} catch( \Exception $e )
339 328
 		{
340 329
 			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
341 330
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -375,14 +364,12 @@  discard block
 block discarded – undo
375 364
 			foreach( $this->getSubClients() as $client ) {
376 365
 				$view->itemBody .= $client->search();
377 366
 			}
378
-		}
379
-		catch( \Aimeos\MShop\Exception $e )
367
+		} catch( \Aimeos\MShop\Exception $e )
380 368
 		{
381 369
 			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
382 370
 			$view->errors = $view->get( 'errors', [] ) + $error;
383 371
 			$this->logException( $e );
384
-		}
385
-		catch( \Exception $e )
372
+		} catch( \Exception $e )
386 373
 		{
387 374
 			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
388 375
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +111 added lines, -111 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\Attribute;
12 12
 
13
-sprintf( 'attribute' ); // for translation
13
+sprintf('attribute'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,38 +35,38 @@  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\Factory::createManager( $context, 'attribute' );
43
-			$view->item = $manager->getItem( $id, $this->getDomains() );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'attribute');
43
+			$view->item = $manager->getItem($id, $this->getDomains());
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->itemTypes = $this->getTypeItems();
48 48
 			$view->itemBody = '';
49 49
 
50
-			foreach( $this->getSubClients() as $idx => $client )
50
+			foreach ($this->getSubClients() as $idx => $client)
51 51
 			{
52 52
 				$view->tabindex = ++$idx + 1;
53 53
 				$view->itemBody .= $client->copy();
54 54
 			}
55 55
 		}
56
-		catch( \Aimeos\MShop\Exception $e )
56
+		catch (\Aimeos\MShop\Exception $e)
57 57
 		{
58
-			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
59
-			$view->errors = $view->get( 'errors', [] ) + $error;
60
-			$this->logException( $e );
58
+			$error = array('attribute-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
59
+			$view->errors = $view->get('errors', []) + $error;
60
+			$this->logException($e);
61 61
 		}
62
-		catch( \Exception $e )
62
+		catch (\Exception $e)
63 63
 		{
64
-			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
65
-			$view->errors = $view->get( 'errors', [] ) + $error;
66
-			$this->logException( $e );
64
+			$error = array('attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
65
+			$view->errors = $view->get('errors', []) + $error;
66
+			$this->logException($e);
67 67
 		}
68 68
 
69
-		return $this->render( $view );
69
+		return $this->render($view);
70 70
 	}
71 71
 
72 72
 
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 
83 83
 		try
84 84
 		{
85
-			$data = $view->param( 'item', [] );
85
+			$data = $view->param('item', []);
86 86
 
87
-			if( !isset( $view->item ) ) {
88
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'attribute' )->createItem();
87
+			if (!isset($view->item)) {
88
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'attribute')->createItem();
89 89
 			}
90 90
 
91 91
 			$data['attribute.siteid'] = $view->item->getSiteId();
@@ -95,26 +95,26 @@  discard block
 block discarded – undo
95 95
 			$view->itemData = $data;
96 96
 			$view->itemBody = '';
97 97
 
98
-			foreach( $this->getSubClients() as $idx => $client )
98
+			foreach ($this->getSubClients() as $idx => $client)
99 99
 			{
100 100
 				$view->tabindex = ++$idx + 1;
101 101
 				$view->itemBody .= $client->create();
102 102
 			}
103 103
 		}
104
-		catch( \Aimeos\MShop\Exception $e )
104
+		catch (\Aimeos\MShop\Exception $e)
105 105
 		{
106
-			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
107
-			$view->errors = $view->get( 'errors', [] ) + $error;
108
-			$this->logException( $e );
106
+			$error = array('attribute-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
107
+			$view->errors = $view->get('errors', []) + $error;
108
+			$this->logException($e);
109 109
 		}
110
-		catch( \Exception $e )
110
+		catch (\Exception $e)
111 111
 		{
112
-			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
113
-			$view->errors = $view->get( 'errors', [] ) + $error;
114
-			$this->logException( $e );
112
+			$error = array('attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
113
+			$view->errors = $view->get('errors', []) + $error;
114
+			$this->logException($e);
115 115
 		}
116 116
 
117
-		return $this->render( $view );
117
+		return $this->render($view);
118 118
 	}
119 119
 
120 120
 
@@ -128,39 +128,39 @@  discard block
 block discarded – undo
128 128
 		$view = $this->getView();
129 129
 		$context = $this->getContext();
130 130
 
131
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' );
131
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'attribute');
132 132
 		$manager->begin();
133 133
 
134 134
 		try
135 135
 		{
136
-			if( ( $id = $view->param( 'id' ) ) === null ) {
137
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
136
+			if (($id = $view->param('id')) === null) {
137
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
138 138
 			}
139 139
 
140
-			$view->item = $manager->getItem( $id, $this->getDomains() );
140
+			$view->item = $manager->getItem($id, $this->getDomains());
141 141
 
142
-			foreach( $this->getSubClients() as $client ) {
142
+			foreach ($this->getSubClients() as $client) {
143 143
 				$client->delete();
144 144
 			}
145 145
 
146
-			$manager->saveItem( $view->item );
147
-			$manager->deleteItem( $id );
146
+			$manager->saveItem($view->item);
147
+			$manager->deleteItem($id);
148 148
 			$manager->commit();
149 149
 
150
-			$this->nextAction( $view, 'search', 'attribute', null, 'delete' );
150
+			$this->nextAction($view, 'search', 'attribute', null, 'delete');
151 151
 			return;
152 152
 		}
153
-		catch( \Aimeos\MShop\Exception $e )
153
+		catch (\Aimeos\MShop\Exception $e)
154 154
 		{
155
-			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
156
-			$view->errors = $view->get( 'errors', [] ) + $error;
157
-			$this->logException( $e );
155
+			$error = array('attribute-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
156
+			$view->errors = $view->get('errors', []) + $error;
157
+			$this->logException($e);
158 158
 		}
159
-		catch( \Exception $e )
159
+		catch (\Exception $e)
160 160
 		{
161
-			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
162
-			$view->errors = $view->get( 'errors', [] ) + $error;
163
-			$this->logException( $e );
161
+			$error = array('attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
162
+			$view->errors = $view->get('errors', []) + $error;
163
+			$this->logException($e);
164 164
 		}
165 165
 
166 166
 		$manager->rollback();
@@ -181,38 +181,38 @@  discard block
 block discarded – undo
181 181
 
182 182
 		try
183 183
 		{
184
-			if( ( $id = $view->param( 'id' ) ) === null ) {
185
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
184
+			if (($id = $view->param('id')) === null) {
185
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
186 186
 			}
187 187
 
188
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' );
188
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'attribute');
189 189
 
190
-			$view->item = $manager->getItem( $id, $this->getDomains() );
190
+			$view->item = $manager->getItem($id, $this->getDomains());
191 191
 			$view->itemSubparts = $this->getSubClientNames();
192
-			$view->itemData = $this->toArray( $view->item );
192
+			$view->itemData = $this->toArray($view->item);
193 193
 			$view->itemTypes = $this->getTypeItems();
194 194
 			$view->itemBody = '';
195 195
 
196
-			foreach( $this->getSubClients() as $idx => $client )
196
+			foreach ($this->getSubClients() as $idx => $client)
197 197
 			{
198 198
 				$view->tabindex = ++$idx + 1;
199 199
 				$view->itemBody .= $client->get();
200 200
 			}
201 201
 		}
202
-		catch( \Aimeos\MShop\Exception $e )
202
+		catch (\Aimeos\MShop\Exception $e)
203 203
 		{
204
-			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
205
-			$view->errors = $view->get( 'errors', [] ) + $error;
206
-			$this->logException( $e );
204
+			$error = array('attribute-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
205
+			$view->errors = $view->get('errors', []) + $error;
206
+			$this->logException($e);
207 207
 		}
208
-		catch( \Exception $e )
208
+		catch (\Exception $e)
209 209
 		{
210
-			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
211
-			$view->errors = $view->get( 'errors', [] ) + $error;
212
-			$this->logException( $e );
210
+			$error = array('attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
211
+			$view->errors = $view->get('errors', []) + $error;
212
+			$this->logException($e);
213 213
 		}
214 214
 
215
-		return $this->render( $view );
215
+		return $this->render($view);
216 216
 	}
217 217
 
218 218
 
@@ -226,40 +226,40 @@  discard block
 block discarded – undo
226 226
 		$view = $this->getView();
227 227
 		$context = $this->getContext();
228 228
 
229
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' );
229
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'attribute');
230 230
 		$manager->begin();
231 231
 
232 232
 		try
233 233
 		{
234
-			$item = $this->fromArray( $view->param( 'item', [] ) );
235
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
234
+			$item = $this->fromArray($view->param('item', []));
235
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
236 236
 			$view->itemBody = '';
237 237
 
238
-			foreach( $this->getSubClients() as $client ) {
238
+			foreach ($this->getSubClients() as $client) {
239 239
 				$view->itemBody .= $client->save();
240 240
 			}
241 241
 
242
-			$manager->saveItem( clone $view->item );
242
+			$manager->saveItem(clone $view->item);
243 243
 			$manager->commit();
244 244
 
245
-			$this->nextAction( $view, $view->param( 'next' ), 'attribute', $view->item->getId(), 'save' );
245
+			$this->nextAction($view, $view->param('next'), 'attribute', $view->item->getId(), 'save');
246 246
 			return;
247 247
 		}
248
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
248
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
249 249
 		{
250 250
 			// fall through to create
251 251
 		}
252
-		catch( \Aimeos\MShop\Exception $e )
252
+		catch (\Aimeos\MShop\Exception $e)
253 253
 		{
254
-			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
255
-			$view->errors = $view->get( 'errors', [] ) + $error;
256
-			$this->logException( $e );
254
+			$error = array('attribute-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
255
+			$view->errors = $view->get('errors', []) + $error;
256
+			$this->logException($e);
257 257
 		}
258
-		catch( \Exception $e )
258
+		catch (\Exception $e)
259 259
 		{
260
-			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
261
-			$view->errors = $view->get( 'errors', [] ) + $error;
262
-			$this->logException( $e );
260
+			$error = array('attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
261
+			$view->errors = $view->get('errors', []) + $error;
262
+			$this->logException($e);
263 263
 		}
264 264
 
265 265
 		$manager->rollback();
@@ -281,32 +281,32 @@  discard block
 block discarded – undo
281 281
 		try
282 282
 		{
283 283
 			$total = 0;
284
-			$params = $this->storeSearchParams( $view->param(), 'attribute' );
285
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' );
286
-			$search = $this->initCriteria( $manager->createSearch(), $params );
284
+			$params = $this->storeSearchParams($view->param(), 'attribute');
285
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'attribute');
286
+			$search = $this->initCriteria($manager->createSearch(), $params);
287 287
 
288
-			$view->items = $manager->searchItems( $search, $this->getDomains(), $total );
289
-			$view->filterAttributes = $manager->getSearchAttributes( true );
288
+			$view->items = $manager->searchItems($search, $this->getDomains(), $total);
289
+			$view->filterAttributes = $manager->getSearchAttributes(true);
290 290
 			$view->filterOperators = $search->getOperators();
291 291
 			$view->itemTypes = $this->getTypeItems();
292 292
 			$view->total = $total;
293 293
 			$view->itemBody = '';
294 294
 
295
-			foreach( $this->getSubClients() as $client ) {
295
+			foreach ($this->getSubClients() as $client) {
296 296
 				$view->itemBody .= $client->search();
297 297
 			}
298 298
 		}
299
-		catch( \Aimeos\MShop\Exception $e )
299
+		catch (\Aimeos\MShop\Exception $e)
300 300
 		{
301
-			$error = array( 'attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
302
-			$view->errors = $view->get( 'errors', [] ) + $error;
303
-			$this->logException( $e );
301
+			$error = array('attribute-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
302
+			$view->errors = $view->get('errors', []) + $error;
303
+			$this->logException($e);
304 304
 		}
305
-		catch( \Exception $e )
305
+		catch (\Exception $e)
306 306
 		{
307
-			$error = array( 'attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
308
-			$view->errors = $view->get( 'errors', [] ) + $error;
309
-			$this->logException( $e );
307
+			$error = array('attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
308
+			$view->errors = $view->get('errors', []) + $error;
309
+			$this->logException($e);
310 310
 		}
311 311
 
312 312
 		/** admin/jqadm/attribute/template-list
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 		$tplconf = 'admin/jqadm/attribute/template-list';
332 332
 		$default = 'attribute/list-standard.php';
333 333
 
334
-		return $view->render( $view->config( $tplconf, $default ) );
334
+		return $view->render($view->config($tplconf, $default));
335 335
 	}
336 336
 
337 337
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	 * @param string|null $name Name of the sub-client (Default if null)
343 343
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
344 344
 	 */
345
-	public function getSubClient( $type, $name = null )
345
+	public function getSubClient($type, $name = null)
346 346
 	{
347 347
 		/** admin/jqadm/attribute/decorators/excludes
348 348
 		 * Excludes decorators added by the "common" option from the attribute JQAdm client
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 		 * @see admin/jqadm/attribute/decorators/excludes
418 418
 		 * @see admin/jqadm/attribute/decorators/global
419 419
 		 */
420
-		return $this->createSubClient( 'attribute/' . $type, $name );
420
+		return $this->createSubClient('attribute/' . $type, $name);
421 421
 	}
422 422
 
423 423
 
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 		 * @since 2017.07
440 440
 		 * @category Developer
441 441
 		 */
442
-		$domains = array( 'attribute/property', 'media', 'price', 'text' );
442
+		$domains = array('attribute/property', 'media', 'price', 'text');
443 443
 
444
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/domains', $domains );
444
+		return $this->getContext()->getConfig()->get('admin/jqadm/attribute/domains', $domains);
445 445
 	}
446 446
 
447 447
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 		 * @since 2017.07
486 486
 		 * @category Developer
487 487
 		 */
488
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/standard/subparts', [] );
488
+		return $this->getContext()->getConfig()->get('admin/jqadm/attribute/standard/subparts', []);
489 489
 	}
490 490
 
491 491
 
@@ -496,12 +496,12 @@  discard block
 block discarded – undo
496 496
 	 */
497 497
 	protected function getTypeItems()
498 498
 	{
499
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute/type' );
499
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute/type');
500 500
 
501
-		$search = $typeManager->createSearch()->setSlice( 0, 0x7fffffff );
502
-		$search->setSortations( array( $search->sort( '+', 'attribute.type.code' ) ) );
501
+		$search = $typeManager->createSearch()->setSlice(0, 0x7fffffff);
502
+		$search->setSortations(array($search->sort('+', 'attribute.type.code')));
503 503
 
504
-		return $typeManager->searchItems( $search );
504
+		return $typeManager->searchItems($search);
505 505
 	}
506 506
 
507 507
 
@@ -511,18 +511,18 @@  discard block
 block discarded – undo
511 511
 	 * @param string[] Data array
512 512
 	 * @return \Aimeos\MShop\Attribute\Item\Iface New attribute item object
513 513
 	 */
514
-	protected function fromArray( array $data )
514
+	protected function fromArray(array $data)
515 515
 	{
516
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' );
516
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute');
517 517
 
518
-		if( isset( $data['attribute.id'] ) && $data['attribute.id'] != '' ) {
519
-			$item = $manager->getItem( $data['attribute.id'], $this->getDomains() );
518
+		if (isset($data['attribute.id']) && $data['attribute.id'] != '') {
519
+			$item = $manager->getItem($data['attribute.id'], $this->getDomains());
520 520
 		} else {
521
-			$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute/type' );
522
-			$item = $manager->createItem( $typeManager->getItem( $data['attribute.typeid'] )->getCode(), $data['attribute.domain'] );
521
+			$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute/type');
522
+			$item = $manager->createItem($typeManager->getItem($data['attribute.typeid'])->getCode(), $data['attribute.domain']);
523 523
 		}
524 524
 
525
-		$item->fromArray( $data );
525
+		$item->fromArray($data);
526 526
 
527 527
 		return $item;
528 528
 	}
@@ -534,11 +534,11 @@  discard block
 block discarded – undo
534 534
 	 * @param \Aimeos\MShop\Attribute\Item\Iface $item Attribute item object
535 535
 	 * @return string[] Multi-dimensional associative list of item data
536 536
 	 */
537
-	protected function toArray( \Aimeos\MShop\Attribute\Item\Iface $item, $copy = false )
537
+	protected function toArray(\Aimeos\MShop\Attribute\Item\Iface $item, $copy = false)
538 538
 	{
539
-		$data = $item->toArray( true );
539
+		$data = $item->toArray(true);
540 540
 
541
-		if( $copy === true )
541
+		if ($copy === true)
542 542
 		{
543 543
 			$data['attribute.siteid'] = $this->getContext()->getLocale()->getSiteId();
544 544
 			$data['attribute.code'] = $data['attribute.code'] . '_copy';
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
556 556
 	 * @return string HTML output
557 557
 	 */
558
-	protected function render( \Aimeos\MW\View\Iface $view )
558
+	protected function render(\Aimeos\MW\View\Iface $view)
559 559
 	{
560 560
 		/** admin/jqadm/attribute/template-item
561 561
 		 * Relative path to the HTML body template for the attribute item.
@@ -579,6 +579,6 @@  discard block
 block discarded – undo
579 579
 		$tplconf = 'admin/jqadm/attribute/template-item';
580 580
 		$default = 'attribute/item-standard.php';
581 581
 
582
-		return $view->render( $view->config( $tplconf, $default ) );
582
+		return $view->render($view->config($tplconf, $default));
583 583
 	}
584 584
 }
Please login to merge, or discard this patch.