Completed
Push — master ( 06a6c1...f03436 )
by Aimeos
03:56
created
admin/jqadm/templates/product/item-text-standard.php 2 patches
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,9 +112,12 @@  discard block
 block discarded – undo
112 112
 								<?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?>
113 113
 							</div>
114 114
 						</div>
115
-					<?php else : ?>
115
+					<?php else {
116
+	: ?>
116 117
 						<input class="text-langid" type="hidden"
117
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)"
118
+							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) );
119
+}
120
+?>'.replace('idx', idx)"
118 121
 							value="<?= $enc->attr( key( $languages ) ); ?>" />
119 122
 					<?php endif; ?>
120 123
 
@@ -143,9 +146,12 @@  discard block
 block discarded – undo
143 146
 								<?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?>
144 147
 							</div>
145 148
 						</div>
146
-					<?php else : ?>
149
+					<?php else {
150
+	: ?>
147 151
 						<input class="item-typeid" type="hidden"
148
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)"
152
+							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) );
153
+}
154
+?>'.replace('idx', idx)"
149 155
 							value="<?= $enc->attr( key( $textTypes ) ); ?>" />
150 156
 					<?php endif; ?>
151 157
 
@@ -198,9 +204,12 @@  discard block
 block discarded – undo
198 204
 								<?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?>
199 205
 							</div>
200 206
 						</div>
201
-					<?php else : ?>
207
+					<?php else {
208
+	: ?>
202 209
 						<input class="listitem-typeid" type="hidden"
203
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'product.lists.typeid' ) ) ); ?>'.replace('idx', idx)"
210
+							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'product.lists.typeid' ) ) );
211
+}
212
+?>'.replace('idx', idx)"
204 213
 							value="<?= $enc->attr( key( $listTypes ) ); ?>"
205 214
 							v-model="items[idx]['product.lists.typeid']" />
206 215
 					<?php endif; ?>
Please login to merge, or discard this patch.
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 ?>
18 18
 <div id="text" class="item-text content-block tab-pane fade" role="tablist" aria-labelledby="text">
19 19
 	<div id="item-text-group" role="tablist" aria-multiselectable="true"
20
-		data-items="<?= $enc->attr( json_encode( $this->get( 'textData', [] ) ) ); ?>"
21
-		data-listtypeid="<?= key( $this->get( 'textListTypes', [] ) ) ?>"
22
-		data-keys="<?= $enc->attr( json_encode( $keys ) ) ?>"
20
+		data-items="<?= $enc->attr(json_encode($this->get('textData', []))); ?>"
21
+		data-listtypeid="<?= key($this->get('textListTypes', [])) ?>"
22
+		data-keys="<?= $enc->attr(json_encode($keys)) ?>"
23 23
 		data-siteid="<?= $this->site()->siteid() ?>" >
24 24
 
25 25
 		<div v-for="(entry, idx) in items" class="group-item card">
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 				v-bind:data-target="'#item-text-group-data-' + idx" data-toggle="collapse" role="tab" class="card-header header"
29 29
 				v-bind:aria-controls="'item-text-group-data-' + idx" aria-expanded="false">
30 30
 				<div class="card-tools-left">
31
-					<div class="btn btn-card-header act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
32
-						title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide this entry') ); ?>">
31
+					<div class="btn btn-card-header act-show fa" tabindex="<?= $this->get('tabindex'); ?>"
32
+						title="<?= $enc->attr($this->translate('admin', 'Show/hide this entry')); ?>">
33 33
 					</div>
34 34
 				</div>
35 35
 				<span class="item-label header-label" v-html="getLabel(idx)"></span>
36 36
 				&nbsp;
37 37
 				<div class="card-tools-right">
38 38
 					<div v-if="!checkSite('product.lists.siteid', idx)"
39
-						class="btn btn-card-header act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
40
-						title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>"
39
+						class="btn btn-card-header act-delete fa" tabindex="<?= $this->get('tabindex'); ?>"
40
+						title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>"
41 41
 						v-on:click.stop="removeItem(idx)">
42 42
 					</div>
43 43
 				</div>
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 				v-bind:aria-labelledby="'item-text-group-item-' + idx" role="tabpanel" class="card-block collapse row">
48 48
 
49 49
 				<input type="hidden" v-model="items[idx]['text.id']"
50
-					v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.id' ) ) ); ?>'.replace('idx', idx)" />
50
+					v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.id'))); ?>'.replace('idx', idx)" />
51 51
 
52 52
 				<div class="col-xl-6">
53 53
 
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 							<textarea is="html-editor" class="form-control item-content" required="required" v-once
57 57
 								v-model="items[idx]['text.content']"
58 58
 								v-bind:value="items[idx]['text.content']"
59
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.content' ) ) ); ?>'.replace('idx', idx)"
59
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.content'))); ?>'.replace('idx', idx)"
60 60
 								v-bind:readonly="checkSite('text.siteid', idx)"
61
-								v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>"
61
+								v-bind:tabindex="<?= $this->get('tabindex'); ?>"
62 62
 							></textarea>
63 63
 						</div>
64 64
 					</div>
@@ -68,101 +68,101 @@  discard block
 block discarded – undo
68 68
 				<div class="col-xl-6">
69 69
 
70 70
 					<div class="form-group row mandatory">
71
-						<label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label>
71
+						<label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label>
72 72
 						<div class="col-sm-8">
73
-							<select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
74
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.status' ) ) ); ?>'.replace('idx', idx)"
73
+							<select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get('tabindex'); ?>"
74
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.status'))); ?>'.replace('idx', idx)"
75 75
 								v-bind:readonly="checkSite('text.siteid', idx)"
76 76
 								v-model="items[idx]['text.status']" >
77 77
 								<option value="1" v-bind:selected="entry['text.status'] == 1" >
78
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?>
78
+									<?= $enc->html($this->translate('mshop/code', 'status:1')); ?>
79 79
 								</option>
80 80
 								<option value="0" v-bind:selected="entry['text.status'] == 0" >
81
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?>
81
+									<?= $enc->html($this->translate('mshop/code', 'status:0')); ?>
82 82
 								</option>
83 83
 								<option value="-1" v-bind:selected="entry['text.status'] == -1" >
84
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?>
84
+									<?= $enc->html($this->translate('mshop/code', 'status:-1')); ?>
85 85
 								</option>
86 86
 								<option value="-2" v-bind:selected="entry['text.status'] == -2" >
87
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?>
87
+									<?= $enc->html($this->translate('mshop/code', 'status:-2')); ?>
88 88
 								</option>
89 89
 							</select>
90 90
 						</div>
91 91
 					</div>
92 92
 
93
-					<?php $languages = $this->get( 'pageLangItems', [] ); ?>
94
-					<?php if( count( $languages ) > 1 ) : ?>
93
+					<?php $languages = $this->get('pageLangItems', []); ?>
94
+					<?php if (count($languages) > 1) : ?>
95 95
 						<div class="form-group row mandatory">
96
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label>
96
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Language')); ?></label>
97 97
 							<div class="col-sm-8">
98
-								<select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
99
-									v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)"
98
+								<select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get('tabindex'); ?>"
99
+									v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)"
100 100
 									v-bind:readonly="checkSite('text.siteid', idx)"
101 101
 									v-model="items[idx]['text.languageid']" >
102 102
 
103 103
 									<option value="" disable >
104
-										<?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?>
104
+										<?= $enc->attr($this->translate('admin', 'Please select')); ?>
105 105
 									</option>
106 106
 
107
-									<?php foreach( $languages as $langId => $langItem ) : ?>
108
-										<option value="<?= $enc->attr( $langId ); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr( $langId ) ?>'" >
109
-											<?= $enc->html( $langItem->getLabel() ); ?>
107
+									<?php foreach ($languages as $langId => $langItem) : ?>
108
+										<option value="<?= $enc->attr($langId); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr($langId) ?>'" >
109
+											<?= $enc->html($langItem->getLabel()); ?>
110 110
 										</option>
111 111
 									<?php endforeach; ?>
112 112
 								</select>
113 113
 							</div>
114 114
 							<div class="col-sm-12 form-text text-muted help-text">
115
-								<?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?>
115
+								<?= $enc->html($this->translate('admin', 'Language of the entered text')); ?>
116 116
 							</div>
117 117
 						</div>
118 118
 					<?php else : ?>
119 119
 						<input class="text-langid" type="hidden"
120
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)"
121
-							value="<?= $enc->attr( key( $languages ) ); ?>" />
120
+							v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)"
121
+							value="<?= $enc->attr(key($languages)); ?>" />
122 122
 					<?php endif; ?>
123 123
 
124
-					<?php $textTypes = $this->get( 'textTypes', [] ); ?>
125
-					<?php if( count( $textTypes ) > 1 ) : ?>
124
+					<?php $textTypes = $this->get('textTypes', []); ?>
125
+					<?php if (count($textTypes) > 1) : ?>
126 126
 						<div class="form-group row mandatory">
127
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Type' ) ); ?></label>
127
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Type')); ?></label>
128 128
 							<div class="col-sm-8">
129
-								<select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
130
-									v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)"
129
+								<select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>"
130
+									v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)"
131 131
 									v-bind:readonly="checkSite('text.siteid', idx)"
132 132
 									v-model="items[idx]['text.typeid']" >
133 133
 
134 134
 									<option value="" disable >
135
-										<?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?>
135
+										<?= $enc->attr($this->translate('admin', 'Please select')); ?>
136 136
 									</option>
137 137
 
138
-									<?php foreach( (array) $textTypes as $typeId => $typeItem ) : ?>
139
-										<option value="<?= $enc->attr( $typeId ); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr( $typeId ) ?>'" >
140
-											<?= $enc->html( $typeItem->getLabel() ); ?>
138
+									<?php foreach ((array) $textTypes as $typeId => $typeItem) : ?>
139
+										<option value="<?= $enc->attr($typeId); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr($typeId) ?>'" >
140
+											<?= $enc->html($typeItem->getLabel()); ?>
141 141
 										</option>
142 142
 									<?php endforeach; ?>
143 143
 								</select>
144 144
 							</div>
145 145
 							<div class="col-sm-12 form-text text-muted help-text">
146
-								<?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?>
146
+								<?= $enc->html($this->translate('admin', 'Types for additional texts like per one lb/kg or per month')); ?>
147 147
 							</div>
148 148
 						</div>
149 149
 					<?php else : ?>
150 150
 						<input class="item-typeid" type="hidden"
151
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)"
152
-							value="<?= $enc->attr( key( $textTypes ) ); ?>" />
151
+							v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)"
152
+							value="<?= $enc->attr(key($textTypes)); ?>" />
153 153
 					<?php endif; ?>
154 154
 
155 155
 					<div class="form-group row optional">
156
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Label' ) ); ?></label>
156
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Label')); ?></label>
157 157
 						<div class="col-sm-8">
158
-							<input class="form-control item-label" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>"
159
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.label' ) ) ); ?>'.replace('idx', idx)"
160
-								placeholder="<?= $enc->attr( $this->translate( 'admin', 'Label' ) ); ?>"
158
+							<input class="form-control item-label" type="text" tabindex="<?= $this->get('tabindex'); ?>"
159
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.label'))); ?>'.replace('idx', idx)"
160
+								placeholder="<?= $enc->attr($this->translate('admin', 'Label')); ?>"
161 161
 								v-bind:readonly="checkSite('text.siteid', idx)"
162 162
 								v-model="items[idx]['text.label']" />
163 163
 						</div>
164 164
 						<div class="col-sm-12 form-text text-muted help-text">
165
-							<?= $enc->html( $this->translate( 'admin', 'Description of the text content if it\'s in a foreign language' ) ); ?>
165
+							<?= $enc->html($this->translate('admin', 'Description of the text content if it\'s in a foreign language')); ?>
166 166
 						</div>
167 167
 					</div>
168 168
 
@@ -171,70 +171,70 @@  discard block
 block discarded – undo
171 171
 
172 172
 				<div v-on:click="toggle(idx)" class="col-xl-12 advanced" v-bind:class="{ 'collapsed': !advanced[idx] }">
173 173
 					<div class="card-tools-left">
174
-						<div class="btn act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
175
-							title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide advanced data') ); ?>">
174
+						<div class="btn act-show fa" tabindex="<?= $this->get('tabindex'); ?>"
175
+							title="<?= $enc->attr($this->translate('admin', 'Show/hide advanced data')); ?>">
176 176
 						</div>
177 177
 					</div>
178
-					<span class="header-label"><?= $enc->html( $this->translate( 'admin', 'Advanced' ) ); ?></span>
178
+					<span class="header-label"><?= $enc->html($this->translate('admin', 'Advanced')); ?></span>
179 179
 				</div>
180 180
 
181 181
 				<div v-show="advanced[idx]" class="col-xl-6 content-block secondary">
182 182
 
183 183
 					<input type="hidden" v-model="items[idx]['product.lists.type']"
184
-						v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'product.lists.type' ) ) ); ?>'.replace( 'idx', idx )" />
184
+						v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'product.lists.type'))); ?>'.replace( 'idx', idx )" />
185 185
 
186
-					<?php $listTypes = $this->get( 'textListTypes', [] ); ?>
187
-					<?php if( count( $listTypes ) > 1 ) : ?>
186
+					<?php $listTypes = $this->get('textListTypes', []); ?>
187
+					<?php if (count($listTypes) > 1) : ?>
188 188
 						<div class="form-group row mandatory">
189
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'List type' ) ); ?></label>
189
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'List type')); ?></label>
190 190
 							<div class="col-sm-8">
191
-								<select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
192
-									v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'product.lists.typeid' ) ) ); ?>'.replace('idx', idx)"
191
+								<select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>"
192
+									v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'product.lists.typeid'))); ?>'.replace('idx', idx)"
193 193
 									v-bind:readonly="checkSite('product.lists.siteid', idx)"
194 194
 									v-model="items[idx]['product.lists.typeid']" >
195 195
 
196
-									<?php foreach( $this->get( 'textListTypes', [] ) as $id => $typeItem ) : ?>
197
-										<option value="<?= $enc->attr( $id ); ?>" v-bind:selected="entry['product.lists.typeid'] == '<?= $enc->attr( $id ) ?>'" >
198
-											<?= $enc->html( $typeItem->getLabel() ); ?>
196
+									<?php foreach ($this->get('textListTypes', []) as $id => $typeItem) : ?>
197
+										<option value="<?= $enc->attr($id); ?>" v-bind:selected="entry['product.lists.typeid'] == '<?= $enc->attr($id) ?>'" >
198
+											<?= $enc->html($typeItem->getLabel()); ?>
199 199
 										</option>
200 200
 									<?php endforeach; ?>
201 201
 								</select>
202 202
 							</div>
203 203
 							<div class="col-sm-12 form-text text-muted help-text">
204
-								<?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?>
204
+								<?= $enc->html($this->translate('admin', 'Second level type for grouping items')); ?>
205 205
 							</div>
206 206
 						</div>
207 207
 					<?php else : ?>
208 208
 						<input class="listitem-typeid" type="hidden"
209
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'product.lists.typeid' ) ) ); ?>'.replace('idx', idx)"
210
-							value="<?= $enc->attr( key( $listTypes ) ); ?>"
209
+							v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'product.lists.typeid'))); ?>'.replace('idx', idx)"
210
+							value="<?= $enc->attr(key($listTypes)); ?>"
211 211
 							v-model="items[idx]['product.lists.typeid']" />
212 212
 					<?php endif; ?>
213 213
 
214 214
 					<div class="form-group row optional">
215
-						<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Start date' ) ); ?></label>
215
+						<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Start date')); ?></label>
216 216
 						<div class="col-sm-8">
217
-							<input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>"
218
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'product.lists.datestart' ) ) ); ?>'.replace('idx', idx)"
219
-								placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>"
217
+							<input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>"
218
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'product.lists.datestart'))); ?>'.replace('idx', idx)"
219
+								placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>"
220 220
 								v-bind:readonly="checkSite('product.lists.siteid', idx)"
221 221
 								v-model="items[idx]['product.lists.datestart']" />
222 222
 						</div>
223 223
 						<div class="col-sm-12 form-text text-muted help-text">
224
-							<?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site after that date and time' ) ); ?>
224
+							<?= $enc->html($this->translate('admin', 'The item is only shown on the web site after that date and time')); ?>
225 225
 						</div>
226 226
 					</div>
227 227
 					<div class="form-group row optional">
228
-						<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'End date' ) ); ?></label>
228
+						<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'End date')); ?></label>
229 229
 						<div class="col-sm-8">
230
-							<input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>"
231
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'product.lists.dateend' ) ) ); ?>'.replace('idx', idx)"
232
-								placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>"
230
+							<input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>"
231
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'product.lists.dateend'))); ?>'.replace('idx', idx)"
232
+								placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>"
233 233
 								v-bind:readonly="checkSite('product.lists.siteid', idx)"
234 234
 								v-model="items[idx]['product.lists.dateend']" />
235 235
 						</div>
236 236
 						<div class="col-sm-12 form-text text-muted help-text">
237
-							<?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site until that date and time' ) ); ?>
237
+							<?= $enc->html($this->translate('admin', 'The item is only shown on the web site until that date and time')); ?>
238 238
 						</div>
239 239
 					</div>
240 240
 				</div>
@@ -244,17 +244,17 @@  discard block
 block discarded – undo
244 244
 						<thead>
245 245
 							<tr>
246 246
 								<th>
247
-									<span class="help"><?= $enc->html( $this->translate( 'admin', 'Option' ) ); ?></span>
247
+									<span class="help"><?= $enc->html($this->translate('admin', 'Option')); ?></span>
248 248
 									<div class="form-text text-muted help-text">
249
-										<?= $enc->html( $this->translate( 'admin', 'Configuration options, will be available as key/value pairs in the list item' ) ); ?>
249
+										<?= $enc->html($this->translate('admin', 'Configuration options, will be available as key/value pairs in the list item')); ?>
250 250
 									</div>
251 251
 								</th>
252 252
 								<th>
253
-									<?= $enc->html( $this->translate( 'admin', 'Value' ) ); ?>
253
+									<?= $enc->html($this->translate('admin', 'Value')); ?>
254 254
 								</th>
255 255
 								<th class="actions">
256
-									<div class="btn act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
257
-										title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>"
256
+									<div class="btn act-add fa" tabindex="<?= $this->get('tabindex'); ?>"
257
+										title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>"
258 258
 										v-bind:readonly="checkSite('product.lists.siteid', idx)"
259 259
 										v-on:click="addConfig(idx)" >
260 260
 									</div>
@@ -267,21 +267,21 @@  discard block
 block discarded – undo
267 267
 								<td>
268 268
 									<input is="auto-complete"
269 269
 										v-model="items[idx]['config']['key'][pos]"
270
-										v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'key', '' ) ) ); ?>'.replace('idx', idx)"
270
+										v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'key', ''))); ?>'.replace('idx', idx)"
271 271
 										v-bind:readonly="checkSite('product.lists.siteid', idx)"
272
-										v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>"
272
+										v-bind:tabindex="<?= $this->get('tabindex'); ?>"
273 273
 										v-bind:keys="[]" />
274 274
 								</td>
275 275
 								<td>
276
-									<input type="text" class="form-control" tabindex="<?= $this->get( 'tabindex' ); ?>"
277
-										v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'val', '' ) ) ); ?>'.replace('idx', idx)"
276
+									<input type="text" class="form-control" tabindex="<?= $this->get('tabindex'); ?>"
277
+										v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'val', ''))); ?>'.replace('idx', idx)"
278 278
 										v-bind:readonly="checkSite('product.lists.siteid', idx)"
279 279
 										v-model="items[idx]['config']['val'][pos]" />
280 280
 								</td>
281 281
 								<td class="actions">
282 282
 									<div v-if="!checkSite('product.lists.siteid', idx)" v-on:click="removeConfig(idx, pos)"
283
-										class="btn act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
284
-										title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>">
283
+										class="btn act-delete fa" tabindex="<?= $this->get('tabindex'); ?>"
284
+										title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>">
285 285
 									</div>
286 286
 								</td>
287 287
 							</tr>
@@ -290,14 +290,14 @@  discard block
 block discarded – undo
290 290
 					</table>
291 291
 				</div>
292 292
 
293
-				<?= $this->get( 'textBody' ); ?>
293
+				<?= $this->get('textBody'); ?>
294 294
 
295 295
 			</div>
296 296
 		</div>
297 297
 
298 298
 		<div class="card-tools-more">
299
-			<div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
300
-				title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>"
299
+			<div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get('tabindex'); ?>"
300
+				title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>"
301 301
 				v-on:click="addItem('product.lists.')" >
302 302
 			</div>
303 303
 		</div>
Please login to merge, or discard this patch.
admin/jqadm/templates/attribute/item-text-standard.php 2 patches
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,9 +112,12 @@  discard block
 block discarded – undo
112 112
 								<?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?>
113 113
 							</div>
114 114
 						</div>
115
-					<?php else : ?>
115
+					<?php else {
116
+	: ?>
116 117
 						<input class="text-langid" type="hidden"
117
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)"
118
+							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) );
119
+}
120
+?>'.replace('idx', idx)"
118 121
 							value="<?= $enc->attr( key( $languages ) ); ?>" />
119 122
 					<?php endif; ?>
120 123
 
@@ -143,9 +146,12 @@  discard block
 block discarded – undo
143 146
 								<?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?>
144 147
 							</div>
145 148
 						</div>
146
-					<?php else : ?>
149
+					<?php else {
150
+	: ?>
147 151
 						<input class="item-typeid" type="hidden"
148
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)"
152
+							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) );
153
+}
154
+?>'.replace('idx', idx)"
149 155
 							value="<?= $enc->attr( key( $textTypes ) ); ?>" />
150 156
 					<?php endif; ?>
151 157
 
@@ -198,9 +204,12 @@  discard block
 block discarded – undo
198 204
 								<?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?>
199 205
 							</div>
200 206
 						</div>
201
-					<?php else : ?>
207
+					<?php else {
208
+	: ?>
202 209
 						<input class="listitem-typeid" type="hidden"
203
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'attribute.lists.typeid' ) ) ); ?>'.replace('idx', idx)"
210
+							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'attribute.lists.typeid' ) ) );
211
+}
212
+?>'.replace('idx', idx)"
204 213
 							value="<?= $enc->attr( key( $listTypes ) ); ?>"
205 214
 							v-model="items[idx]['attribute.lists.typeid']" />
206 215
 					<?php endif; ?>
Please login to merge, or discard this patch.
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 ?>
18 18
 <div id="text" class="item-text content-block tab-pane fade" role="tablist" aria-labelledby="text">
19 19
 	<div id="item-text-group" role="tablist" aria-multiselectable="true"
20
-		data-items="<?= $enc->attr( json_encode( $this->get( 'textData', [] ) ) ); ?>"
21
-		data-listtypeid="<?= key( $this->get( 'textListTypes', [] ) ) ?>"
22
-		data-keys="<?= $enc->attr( json_encode( $keys ) ) ?>"
20
+		data-items="<?= $enc->attr(json_encode($this->get('textData', []))); ?>"
21
+		data-listtypeid="<?= key($this->get('textListTypes', [])) ?>"
22
+		data-keys="<?= $enc->attr(json_encode($keys)) ?>"
23 23
 		data-siteid="<?= $this->site()->siteid() ?>" >
24 24
 
25 25
 		<div v-for="(entry, idx) in items" class="group-item card">
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 				v-bind:data-target="'#item-text-group-data-' + idx" data-toggle="collapse" role="tab" class="card-header header"
29 29
 				v-bind:aria-controls="'item-text-group-data-' + idx" aria-expanded="false">
30 30
 				<div class="card-tools-left">
31
-					<div class="btn btn-card-header act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
32
-						title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide this entry') ); ?>">
31
+					<div class="btn btn-card-header act-show fa" tabindex="<?= $this->get('tabindex'); ?>"
32
+						title="<?= $enc->attr($this->translate('admin', 'Show/hide this entry')); ?>">
33 33
 					</div>
34 34
 				</div>
35 35
 				<span class="item-label header-label" v-html="getLabel(idx)"></span>
36 36
 				&nbsp;
37 37
 				<div class="card-tools-right">
38 38
 					<div v-if="!checkSite('attribute.lists.siteid', idx)"
39
-						class="btn btn-card-header act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
40
-						title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>"
39
+						class="btn btn-card-header act-delete fa" tabindex="<?= $this->get('tabindex'); ?>"
40
+						title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>"
41 41
 						v-on:click.stop="removeItem(idx)">
42 42
 					</div>
43 43
 				</div>
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 				v-bind:aria-labelledby="'item-text-group-item-' + idx" role="tabpanel" class="card-block collapse row">
48 48
 
49 49
 				<input type="hidden" v-model="items[idx]['text.id']"
50
-					v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.id' ) ) ); ?>'.replace('idx', idx)" />
50
+					v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.id'))); ?>'.replace('idx', idx)" />
51 51
 
52 52
 				<div class="col-xl-6">
53 53
 
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 							<textarea is="html-editor" class="form-control item-content" required="required" v-once
57 57
 								v-model="items[idx]['text.content']"
58 58
 								v-bind:value="items[idx]['text.content']"
59
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.content' ) ) ); ?>'.replace('idx', idx)"
59
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.content'))); ?>'.replace('idx', idx)"
60 60
 								v-bind:readonly="checkSite('text.siteid', idx)"
61
-								v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>"
61
+								v-bind:tabindex="<?= $this->get('tabindex'); ?>"
62 62
 							></textarea>
63 63
 						</div>
64 64
 					</div>
@@ -68,101 +68,101 @@  discard block
 block discarded – undo
68 68
 				<div class="col-xl-6">
69 69
 
70 70
 					<div class="form-group row mandatory">
71
-						<label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label>
71
+						<label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label>
72 72
 						<div class="col-sm-8">
73
-							<select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
74
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.status' ) ) ); ?>'.replace('idx', idx)"
73
+							<select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get('tabindex'); ?>"
74
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.status'))); ?>'.replace('idx', idx)"
75 75
 								v-bind:readonly="checkSite('text.siteid', idx)"
76 76
 								v-model="items[idx]['text.status']" >
77 77
 								<option value="1" v-bind:selected="entry['text.status'] == 1" >
78
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?>
78
+									<?= $enc->html($this->translate('mshop/code', 'status:1')); ?>
79 79
 								</option>
80 80
 								<option value="0" v-bind:selected="entry['text.status'] == 0" >
81
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?>
81
+									<?= $enc->html($this->translate('mshop/code', 'status:0')); ?>
82 82
 								</option>
83 83
 								<option value="-1" v-bind:selected="entry['text.status'] == -1" >
84
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?>
84
+									<?= $enc->html($this->translate('mshop/code', 'status:-1')); ?>
85 85
 								</option>
86 86
 								<option value="-2" v-bind:selected="entry['text.status'] == -2" >
87
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?>
87
+									<?= $enc->html($this->translate('mshop/code', 'status:-2')); ?>
88 88
 								</option>
89 89
 							</select>
90 90
 						</div>
91 91
 					</div>
92 92
 
93
-					<?php $languages = $this->get( 'pageLangItems', [] ); ?>
94
-					<?php if( count( $languages ) > 1 ) : ?>
93
+					<?php $languages = $this->get('pageLangItems', []); ?>
94
+					<?php if (count($languages) > 1) : ?>
95 95
 						<div class="form-group row mandatory">
96
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label>
96
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Language')); ?></label>
97 97
 							<div class="col-sm-8">
98
-								<select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
99
-									v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)"
98
+								<select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get('tabindex'); ?>"
99
+									v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)"
100 100
 									v-bind:readonly="checkSite('text.siteid', idx)"
101 101
 									v-model="items[idx]['text.languageid']" >
102 102
 
103 103
 									<option value="" disable >
104
-										<?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?>
104
+										<?= $enc->attr($this->translate('admin', 'Please select')); ?>
105 105
 									</option>
106 106
 
107
-									<?php foreach( $languages as $langId => $langItem ) : ?>
108
-										<option value="<?= $enc->attr( $langId ); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr( $langId ) ?>'" >
109
-											<?= $enc->html( $langItem->getLabel() ); ?>
107
+									<?php foreach ($languages as $langId => $langItem) : ?>
108
+										<option value="<?= $enc->attr($langId); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr($langId) ?>'" >
109
+											<?= $enc->html($langItem->getLabel()); ?>
110 110
 										</option>
111 111
 									<?php endforeach; ?>
112 112
 								</select>
113 113
 							</div>
114 114
 							<div class="col-sm-12 form-text text-muted help-text">
115
-								<?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?>
115
+								<?= $enc->html($this->translate('admin', 'Language of the entered text')); ?>
116 116
 							</div>
117 117
 						</div>
118 118
 					<?php else : ?>
119 119
 						<input class="text-langid" type="hidden"
120
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)"
121
-							value="<?= $enc->attr( key( $languages ) ); ?>" />
120
+							v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)"
121
+							value="<?= $enc->attr(key($languages)); ?>" />
122 122
 					<?php endif; ?>
123 123
 
124
-					<?php $textTypes = $this->get( 'textTypes', [] ); ?>
125
-					<?php if( count( $textTypes ) > 1 ) : ?>
124
+					<?php $textTypes = $this->get('textTypes', []); ?>
125
+					<?php if (count($textTypes) > 1) : ?>
126 126
 						<div class="form-group row mandatory">
127
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Type' ) ); ?></label>
127
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Type')); ?></label>
128 128
 							<div class="col-sm-8">
129
-								<select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
130
-									v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)"
129
+								<select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>"
130
+									v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)"
131 131
 									v-bind:readonly="checkSite('text.siteid', idx)"
132 132
 									v-model="items[idx]['text.typeid']" >
133 133
 
134 134
 									<option value="" disable >
135
-										<?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?>
135
+										<?= $enc->attr($this->translate('admin', 'Please select')); ?>
136 136
 									</option>
137 137
 
138
-									<?php foreach( (array) $textTypes as $typeId => $typeItem ) : ?>
139
-										<option value="<?= $enc->attr( $typeId ); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr( $typeId ) ?>'" >
140
-											<?= $enc->html( $typeItem->getLabel() ); ?>
138
+									<?php foreach ((array) $textTypes as $typeId => $typeItem) : ?>
139
+										<option value="<?= $enc->attr($typeId); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr($typeId) ?>'" >
140
+											<?= $enc->html($typeItem->getLabel()); ?>
141 141
 										</option>
142 142
 									<?php endforeach; ?>
143 143
 								</select>
144 144
 							</div>
145 145
 							<div class="col-sm-12 form-text text-muted help-text">
146
-								<?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?>
146
+								<?= $enc->html($this->translate('admin', 'Types for additional texts like per one lb/kg or per month')); ?>
147 147
 							</div>
148 148
 						</div>
149 149
 					<?php else : ?>
150 150
 						<input class="item-typeid" type="hidden"
151
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)"
152
-							value="<?= $enc->attr( key( $textTypes ) ); ?>" />
151
+							v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)"
152
+							value="<?= $enc->attr(key($textTypes)); ?>" />
153 153
 					<?php endif; ?>
154 154
 
155 155
 					<div class="form-group row optional">
156
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Label' ) ); ?></label>
156
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Label')); ?></label>
157 157
 						<div class="col-sm-8">
158
-							<input class="form-control item-label" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>"
159
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.label' ) ) ); ?>'.replace('idx', idx)"
160
-								placeholder="<?= $enc->attr( $this->translate( 'admin', 'Label' ) ); ?>"
158
+							<input class="form-control item-label" type="text" tabindex="<?= $this->get('tabindex'); ?>"
159
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.label'))); ?>'.replace('idx', idx)"
160
+								placeholder="<?= $enc->attr($this->translate('admin', 'Label')); ?>"
161 161
 								v-bind:readonly="checkSite('text.siteid', idx)"
162 162
 								v-model="items[idx]['text.label']" />
163 163
 						</div>
164 164
 						<div class="col-sm-12 form-text text-muted help-text">
165
-							<?= $enc->html( $this->translate( 'admin', 'Description of the text content if it\'s in a foreign language' ) ); ?>
165
+							<?= $enc->html($this->translate('admin', 'Description of the text content if it\'s in a foreign language')); ?>
166 166
 						</div>
167 167
 					</div>
168 168
 
@@ -171,70 +171,70 @@  discard block
 block discarded – undo
171 171
 
172 172
 				<div v-on:click="toggle(idx)" class="col-xl-12 advanced" v-bind:class="{ 'collapsed': !advanced[idx] }">
173 173
 					<div class="card-tools-left">
174
-						<div class="btn act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
175
-							title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide advanced data') ); ?>">
174
+						<div class="btn act-show fa" tabindex="<?= $this->get('tabindex'); ?>"
175
+							title="<?= $enc->attr($this->translate('admin', 'Show/hide advanced data')); ?>">
176 176
 						</div>
177 177
 					</div>
178
-					<span class="header-label"><?= $enc->html( $this->translate( 'admin', 'Advanced' ) ); ?></span>
178
+					<span class="header-label"><?= $enc->html($this->translate('admin', 'Advanced')); ?></span>
179 179
 				</div>
180 180
 
181 181
 				<div v-show="advanced[idx]" class="col-xl-6 content-block secondary">
182 182
 
183 183
 					<input type="hidden" v-model="items[idx]['attribute.lists.type']"
184
-						v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'attribute.lists.type' ) ) ); ?>'.replace( 'idx', idx )" />
184
+						v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'attribute.lists.type'))); ?>'.replace( 'idx', idx )" />
185 185
 
186
-					<?php $listTypes = $this->get( 'textListTypes', [] ); ?>
187
-					<?php if( count( $listTypes ) > 1 ) : ?>
186
+					<?php $listTypes = $this->get('textListTypes', []); ?>
187
+					<?php if (count($listTypes) > 1) : ?>
188 188
 						<div class="form-group row mandatory">
189
-							<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'List type' ) ); ?></label>
189
+							<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'List type')); ?></label>
190 190
 							<div class="col-sm-8">
191
-								<select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>"
192
-									v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'attribute.lists.typeid' ) ) ); ?>'.replace('idx', idx)"
191
+								<select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>"
192
+									v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'attribute.lists.typeid'))); ?>'.replace('idx', idx)"
193 193
 									v-bind:readonly="checkSite('attribute.lists.siteid', idx)"
194 194
 									v-model="items[idx]['attribute.lists.typeid']" >
195 195
 
196
-									<?php foreach( $this->get( 'textListTypes', [] ) as $id => $typeItem ) : ?>
197
-										<option value="<?= $enc->attr( $id ); ?>" v-bind:selected="entry['attribute.lists.typeid'] == '<?= $enc->attr( $id ) ?>'" >
198
-											<?= $enc->html( $typeItem->getLabel() ); ?>
196
+									<?php foreach ($this->get('textListTypes', []) as $id => $typeItem) : ?>
197
+										<option value="<?= $enc->attr($id); ?>" v-bind:selected="entry['attribute.lists.typeid'] == '<?= $enc->attr($id) ?>'" >
198
+											<?= $enc->html($typeItem->getLabel()); ?>
199 199
 										</option>
200 200
 									<?php endforeach; ?>
201 201
 								</select>
202 202
 							</div>
203 203
 							<div class="col-sm-12 form-text text-muted help-text">
204
-								<?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?>
204
+								<?= $enc->html($this->translate('admin', 'Second level type for grouping items')); ?>
205 205
 							</div>
206 206
 						</div>
207 207
 					<?php else : ?>
208 208
 						<input class="listitem-typeid" type="hidden"
209
-							v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'attribute.lists.typeid' ) ) ); ?>'.replace('idx', idx)"
210
-							value="<?= $enc->attr( key( $listTypes ) ); ?>"
209
+							v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'attribute.lists.typeid'))); ?>'.replace('idx', idx)"
210
+							value="<?= $enc->attr(key($listTypes)); ?>"
211 211
 							v-model="items[idx]['attribute.lists.typeid']" />
212 212
 					<?php endif; ?>
213 213
 
214 214
 					<div class="form-group row optional">
215
-						<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Start date' ) ); ?></label>
215
+						<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Start date')); ?></label>
216 216
 						<div class="col-sm-8">
217
-							<input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>"
218
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'attribute.lists.datestart' ) ) ); ?>'.replace('idx', idx)"
219
-								placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>"
217
+							<input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>"
218
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'attribute.lists.datestart'))); ?>'.replace('idx', idx)"
219
+								placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>"
220 220
 								v-bind:readonly="checkSite('attribute.lists.siteid', idx)"
221 221
 								v-model="items[idx]['attribute.lists.datestart']" />
222 222
 						</div>
223 223
 						<div class="col-sm-12 form-text text-muted help-text">
224
-							<?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site after that date and time' ) ); ?>
224
+							<?= $enc->html($this->translate('admin', 'The item is only shown on the web site after that date and time')); ?>
225 225
 						</div>
226 226
 					</div>
227 227
 					<div class="form-group row optional">
228
-						<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'End date' ) ); ?></label>
228
+						<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'End date')); ?></label>
229 229
 						<div class="col-sm-8">
230
-							<input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>"
231
-								v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'attribute.lists.dateend' ) ) ); ?>'.replace('idx', idx)"
232
-								placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>"
230
+							<input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>"
231
+								v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'attribute.lists.dateend'))); ?>'.replace('idx', idx)"
232
+								placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>"
233 233
 								v-bind:readonly="checkSite('attribute.lists.siteid', idx)"
234 234
 								v-model="items[idx]['attribute.lists.dateend']" />
235 235
 						</div>
236 236
 						<div class="col-sm-12 form-text text-muted help-text">
237
-							<?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site until that date and time' ) ); ?>
237
+							<?= $enc->html($this->translate('admin', 'The item is only shown on the web site until that date and time')); ?>
238 238
 						</div>
239 239
 					</div>
240 240
 				</div>
@@ -244,17 +244,17 @@  discard block
 block discarded – undo
244 244
 						<thead>
245 245
 							<tr>
246 246
 								<th>
247
-									<span class="help"><?= $enc->html( $this->translate( 'admin', 'Option' ) ); ?></span>
247
+									<span class="help"><?= $enc->html($this->translate('admin', 'Option')); ?></span>
248 248
 									<div class="form-text text-muted help-text">
249
-										<?= $enc->html( $this->translate( 'admin', 'Configuration options, will be available as key/value pairs in the list item' ) ); ?>
249
+										<?= $enc->html($this->translate('admin', 'Configuration options, will be available as key/value pairs in the list item')); ?>
250 250
 									</div>
251 251
 								</th>
252 252
 								<th>
253
-									<?= $enc->html( $this->translate( 'admin', 'Value' ) ); ?>
253
+									<?= $enc->html($this->translate('admin', 'Value')); ?>
254 254
 								</th>
255 255
 								<th class="actions">
256
-									<div class="btn act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
257
-										title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>"
256
+									<div class="btn act-add fa" tabindex="<?= $this->get('tabindex'); ?>"
257
+										title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>"
258 258
 										v-bind:readonly="checkSite('attribute.lists.siteid', idx)"
259 259
 										v-on:click="addConfig(idx)" >
260 260
 									</div>
@@ -267,21 +267,21 @@  discard block
 block discarded – undo
267 267
 								<td>
268 268
 									<input is="auto-complete"
269 269
 										v-model="items[idx]['config']['key'][pos]"
270
-										v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'key', '' ) ) ); ?>'.replace('idx', idx)"
270
+										v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'key', ''))); ?>'.replace('idx', idx)"
271 271
 										v-bind:readonly="checkSite('attribute.lists.siteid', idx)"
272
-										v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>"
272
+										v-bind:tabindex="<?= $this->get('tabindex'); ?>"
273 273
 										v-bind:keys="[]" />
274 274
 								</td>
275 275
 								<td>
276
-									<input type="text" class="form-control" tabindex="<?= $this->get( 'tabindex' ); ?>"
277
-										v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'val', '' ) ) ); ?>'.replace('idx', idx)"
276
+									<input type="text" class="form-control" tabindex="<?= $this->get('tabindex'); ?>"
277
+										v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'val', ''))); ?>'.replace('idx', idx)"
278 278
 										v-bind:readonly="checkSite('attribute.lists.siteid', idx)"
279 279
 										v-model="items[idx]['config']['val'][pos]" />
280 280
 								</td>
281 281
 								<td class="actions">
282 282
 									<div v-if="!checkSite('attribute.lists.siteid', idx)" v-on:click="removeConfig(idx, pos)"
283
-										class="btn act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
284
-										title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>">
283
+										class="btn act-delete fa" tabindex="<?= $this->get('tabindex'); ?>"
284
+										title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>">
285 285
 									</div>
286 286
 								</td>
287 287
 							</tr>
@@ -290,14 +290,14 @@  discard block
 block discarded – undo
290 290
 					</table>
291 291
 				</div>
292 292
 
293
-				<?= $this->get( 'textBody' ); ?>
293
+				<?= $this->get('textBody'); ?>
294 294
 
295 295
 			</div>
296 296
 		</div>
297 297
 
298 298
 		<div class="card-tools-more">
299
-			<div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>"
300
-				title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>"
299
+			<div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get('tabindex'); ?>"
300
+				title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>"
301 301
 				v-on:click="addItem('attribute.lists.')" >
302 302
 			</div>
303 303
 		</div>
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Attribute/Text/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,14 +160,12 @@
 block discarded – undo
160 160
 			}
161 161
 
162 162
 			return;
163
-		}
164
-		catch( \Aimeos\MShop\Exception $e )
163
+		} catch( \Aimeos\MShop\Exception $e )
165 164
 		{
166 165
 			$error = array( 'attribute-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
167 166
 			$view->errors = $view->get( 'errors', [] ) + $error;
168 167
 			$this->logException( $e );
169
-		}
170
-		catch( \Exception $e )
168
+		} catch( \Exception $e )
171 169
 		{
172 170
 			$error = array( 'attribute-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
173 171
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 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\Text;
12 12
 
13
-sprintf( 'text' ); // for translation
13
+sprintf('text'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		$view = $this->addViewData( $this->getView() );
45
+		$view = $this->addViewData($this->getView());
46 46
 
47
-		$view->textData = $this->toArray( $view->item, true );
47
+		$view->textData = $this->toArray($view->item, true);
48 48
 		$view->textBody = '';
49 49
 
50
-		foreach( $this->getSubClients() as $client ) {
50
+		foreach ($this->getSubClients() as $client) {
51 51
 			$view->textBody .= $client->copy();
52 52
 		}
53 53
 
54
-		return $this->render( $view );
54
+		return $this->render($view);
55 55
 	}
56 56
 
57 57
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function create()
64 64
 	{
65
-		$view = $this->addViewData( $this->getView() );
65
+		$view = $this->addViewData($this->getView());
66 66
 		$siteid = $this->getContext()->getLocale()->getSiteId();
67
-		$data = $view->param( 'text', [] );
67
+		$data = $view->param('text', []);
68 68
 
69
-		foreach( $data as $idx => $entry )
69
+		foreach ($data as $idx => $entry)
70 70
 		{
71 71
 			$data[$idx]['attribute.lists.siteid'] = $siteid;
72 72
 			$data[$idx]['text.siteid'] = $siteid;
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$view->textData = $data;
76 76
 		$view->textBody = '';
77 77
 
78
-		foreach( $this->getSubClients() as $client ) {
78
+		foreach ($this->getSubClients() as $client) {
79 79
 			$view->textBody .= $client->create();
80 80
 		}
81 81
 
82
-		return $this->render( $view );
82
+		return $this->render($view);
83 83
 	}
84 84
 
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		parent::delete();
92 92
 
93 93
 		$item = $this->getView()->item;
94
-		$item->deleteListItems( $item->getListItems( 'text', null, null, false ), true );
94
+		$item->deleteListItems($item->getListItems('text', null, null, false), true);
95 95
 	}
96 96
 
97 97
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get()
104 104
 	{
105
-		$view = $this->addViewData( $this->getView() );
105
+		$view = $this->addViewData($this->getView());
106 106
 
107
-		$view->textData = $this->toArray( $view->item );
107
+		$view->textData = $this->toArray($view->item);
108 108
 		$view->textBody = '';
109 109
 
110
-		foreach( $this->getSubClients() as $client ) {
110
+		foreach ($this->getSubClients() as $client) {
111 111
 			$view->textBody .= $client->get();
112 112
 		}
113 113
 
114
-		return $this->render( $view );
114
+		return $this->render($view);
115 115
 	}
116 116
 
117 117
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
 
125 125
 		try
126 126
 		{
127
-			$view->item = $this->fromArray( $view->item, $view->param( 'text', [] ) );
127
+			$view->item = $this->fromArray($view->item, $view->param('text', []));
128 128
 			$view->textBody = '';
129 129
 
130
-			foreach( $this->getSubClients() as $client ) {
130
+			foreach ($this->getSubClients() as $client) {
131 131
 				$view->textBody .= $client->save();
132 132
 			}
133 133
 
134 134
 			return;
135 135
 		}
136
-		catch( \Aimeos\MShop\Exception $e )
136
+		catch (\Aimeos\MShop\Exception $e)
137 137
 		{
138
-			$error = array( 'attribute-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
139
-			$view->errors = $view->get( 'errors', [] ) + $error;
140
-			$this->logException( $e );
138
+			$error = array('attribute-item-text' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
139
+			$view->errors = $view->get('errors', []) + $error;
140
+			$this->logException($e);
141 141
 		}
142
-		catch( \Exception $e )
142
+		catch (\Exception $e)
143 143
 		{
144
-			$error = array( 'attribute-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
145
-			$view->errors = $view->get( 'errors', [] ) + $error;
146
-			$this->logException( $e );
144
+			$error = array('attribute-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
145
+			$view->errors = $view->get('errors', []) + $error;
146
+			$this->logException($e);
147 147
 		}
148 148
 
149 149
 		throw new \Aimeos\Admin\JQAdm\Exception();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** admin/jqadm/attribute/text/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the attribute JQAdm client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see admin/jqadm/attribute/text/decorators/excludes
233 233
 		 * @see admin/jqadm/attribute/text/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'attribute/text/' . $type, $name );
235
+		return $this->createSubClient('attribute/text/' . $type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @since 2017.07
277 277
 		 * @category Developer
278 278
 		 */
279
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/text/standard/subparts', [] );
279
+		return $this->getContext()->getConfig()->get('admin/jqadm/attribute/text/standard/subparts', []);
280 280
 	}
281 281
 
282 282
 
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
 	 * @param \Aimeos\MW\View\Iface $view View object
287 287
 	 * @return \Aimeos\MW\View\Iface View object with assigned parameters
288 288
 	 */
289
-	protected function addViewData( \Aimeos\MW\View\Iface $view )
289
+	protected function addViewData(\Aimeos\MW\View\Iface $view)
290 290
 	{
291 291
 		$context = $this->getContext();
292 292
 
293
-		$textTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'text/type' );
294
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'attribute/lists/type' );
293
+		$textTypeManager = \Aimeos\MShop\Factory::createManager($context, 'text/type');
294
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'attribute/lists/type');
295 295
 
296
-		$search = $textTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
297
-		$search->setConditions( $search->compare( '==', 'text.type.domain', 'attribute' ) );
298
-		$search->setSortations( array( $search->sort( '+', 'text.type.label' ) ) );
296
+		$search = $textTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
297
+		$search->setConditions($search->compare('==', 'text.type.domain', 'attribute'));
298
+		$search->setSortations(array($search->sort('+', 'text.type.label')));
299 299
 
300
-		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
301
-		$listSearch->setConditions( $listSearch->compare( '==', 'attribute.lists.type.domain', 'text' ) );
302
-		$listSearch->setSortations( array( $listSearch->sort( '+', 'attribute.lists.type.label' ) ) );
300
+		$listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
301
+		$listSearch->setConditions($listSearch->compare('==', 'attribute.lists.type.domain', 'text'));
302
+		$listSearch->setSortations(array($listSearch->sort('+', 'attribute.lists.type.label')));
303 303
 
304
-		$view->textTypes = $textTypeManager->searchItems( $search );
305
-		$view->textListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) );
304
+		$view->textTypes = $textTypeManager->searchItems($search);
305
+		$view->textListTypes = $this->sortType($listTypeManager->searchItems($listSearch));
306 306
 
307 307
 		return $view;
308 308
 	}
@@ -314,50 +314,50 @@  discard block
 block discarded – undo
314 314
 	 * @param \Aimeos\MShop\Attribute\Item\Iface $item Attribute item object without referenced domain items
315 315
 	 * @param string[] $data Data array
316 316
 	 */
317
-	protected function fromArray( \Aimeos\MShop\Attribute\Item\Iface $item, array $data )
317
+	protected function fromArray(\Aimeos\MShop\Attribute\Item\Iface $item, array $data)
318 318
 	{
319 319
 		$context = $this->getContext();
320 320
 
321
-		$textManager = \Aimeos\MShop\Factory::createManager( $context, 'text' );
322
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'attribute/lists' );
321
+		$textManager = \Aimeos\MShop\Factory::createManager($context, 'text');
322
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'attribute/lists');
323 323
 
324
-		$listItems = $item->getListItems( 'text', null, null, false );
324
+		$listItems = $item->getListItems('text', null, null, false);
325 325
 
326 326
 
327
-		foreach( $data as $idx => $entry )
327
+		foreach ($data as $idx => $entry)
328 328
 		{
329
-			if( trim( $this->getValue( $entry, 'text.content', '' ) ) === '' ) {
329
+			if (trim($this->getValue($entry, 'text.content', '')) === '') {
330 330
 				continue;
331 331
 			}
332 332
 
333
-			if( ( $listItem = $item->getListItem( 'text', $entry['attribute.lists.type'], $entry['text.id'] ) ) === null ) {
333
+			if (($listItem = $item->getListItem('text', $entry['attribute.lists.type'], $entry['text.id'])) === null) {
334 334
 				$listItem = $listManager->createItem();
335 335
 			}
336 336
 
337
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
337
+			if (($refItem = $listItem->getRefItem()) === null) {
338 338
 				$refItem = $textManager->createItem();
339 339
 			}
340 340
 
341
-			$refItem->fromArray( $entry );
341
+			$refItem->fromArray($entry);
342 342
 			$conf = [];
343 343
 
344
-			foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key )
344
+			foreach ((array) $this->getValue($entry, 'config/key') as $num => $key)
345 345
 			{
346
-				if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) {
347
-					$conf[$key] = trim( $val );
346
+				if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) {
347
+					$conf[$key] = trim($val);
348 348
 				}
349 349
 			}
350 350
 
351
-			$listItem->fromArray( $entry );
352
-			$listItem->setPosition( $idx );
353
-			$listItem->setConfig( $conf );
351
+			$listItem->fromArray($entry);
352
+			$listItem->setPosition($idx);
353
+			$listItem->setConfig($conf);
354 354
 
355
-			$item->addListItem( 'text', $listItem, $refItem );
355
+			$item->addListItem('text', $listItem, $refItem);
356 356
 
357
-			unset( $listItems[$listItem->getId()] );
357
+			unset($listItems[$listItem->getId()]);
358 358
 		}
359 359
 
360
-		return $item->deleteListItems( $listItems, true );
360
+		return $item->deleteListItems($listItems, true);
361 361
 	}
362 362
 
363 363
 
@@ -368,20 +368,20 @@  discard block
 block discarded – undo
368 368
 	 * @param boolean $copy True if items should be copied, false if not
369 369
 	 * @return string[] Multi-dimensional associative list of item data
370 370
 	 */
371
-	protected function toArray( \Aimeos\MShop\Attribute\Item\Iface $item, $copy = false )
371
+	protected function toArray(\Aimeos\MShop\Attribute\Item\Iface $item, $copy = false)
372 372
 	{
373 373
 		$data = [];
374 374
 		$siteId = $this->getContext()->getLocale()->getSiteId();
375 375
 
376
-		foreach( $item->getListItems( 'text', null, null, false ) as $listItem )
376
+		foreach ($item->getListItems('text', null, null, false) as $listItem)
377 377
 		{
378
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
378
+			if (($refItem = $listItem->getRefItem()) === null) {
379 379
 				continue;
380 380
 			}
381 381
 
382
-			$list = $listItem->toArray( true ) + $refItem->toArray( true );
382
+			$list = $listItem->toArray(true) + $refItem->toArray(true);
383 383
 
384
-			if( $copy === true )
384
+			if ($copy === true)
385 385
 			{
386 386
 				$list['attribute.lists.siteid'] = $siteId;
387 387
 				$list['attribute.lists.id'] = '';
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
 				$list['text.id'] = null;
390 390
 			}
391 391
 
392
-			$list['attribute.lists.datestart'] = str_replace( ' ', 'T', $list['attribute.lists.datestart'] );
393
-			$list['attribute.lists.dateend'] = str_replace( ' ', 'T', $list['attribute.lists.dateend'] );
392
+			$list['attribute.lists.datestart'] = str_replace(' ', 'T', $list['attribute.lists.datestart']);
393
+			$list['attribute.lists.dateend'] = str_replace(' ', 'T', $list['attribute.lists.dateend']);
394 394
 
395
-			foreach( $list['attribute.lists.config'] as $key => $val )
395
+			foreach ($list['attribute.lists.config'] as $key => $val)
396 396
 			{
397 397
 				$list['config']['key'][] = $key;
398 398
 				$list['config']['val'][] = $val;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
412 412
 	 * @return string HTML output
413 413
 	 */
414
-	protected function render( \Aimeos\MW\View\Iface $view )
414
+	protected function render(\Aimeos\MW\View\Iface $view)
415 415
 	{
416 416
 		/** admin/jqadm/attribute/text/template-item
417 417
 		 * Relative path to the HTML body template of the text subpart for attributes.
@@ -435,6 +435,6 @@  discard block
 block discarded – undo
435 435
 		$tplconf = 'admin/jqadm/attribute/text/template-item';
436 436
 		$default = 'attribute/item-text-standard.php';
437 437
 
438
-		return $view->render( $view->config( $tplconf, $default ) );
438
+		return $view->render($view->config($tplconf, $default));
439 439
 	}
440 440
 }
441 441
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Product/Text/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,14 +160,12 @@
 block discarded – undo
160 160
 			}
161 161
 
162 162
 			return;
163
-		}
164
-		catch( \Aimeos\MShop\Exception $e )
163
+		} catch( \Aimeos\MShop\Exception $e )
165 164
 		{
166 165
 			$error = array( 'product-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
167 166
 			$view->errors = $view->get( 'errors', [] ) + $error;
168 167
 			$this->logException( $e );
169
-		}
170
-		catch( \Exception $e )
168
+		} catch( \Exception $e )
171 169
 		{
172 170
 			$error = array( 'product-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
173 171
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 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\Product\Text;
12 12
 
13
-sprintf( 'text' ); // for translation
13
+sprintf('text'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		$view = $this->addViewData( $this->getView() );
45
+		$view = $this->addViewData($this->getView());
46 46
 
47
-		$view->textData = $this->toArray( $view->item, true );
47
+		$view->textData = $this->toArray($view->item, true);
48 48
 		$view->textBody = '';
49 49
 
50
-		foreach( $this->getSubClients() as $client ) {
50
+		foreach ($this->getSubClients() as $client) {
51 51
 			$view->textBody .= $client->copy();
52 52
 		}
53 53
 
54
-		return $this->render( $view );
54
+		return $this->render($view);
55 55
 	}
56 56
 
57 57
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function create()
64 64
 	{
65
-		$view = $this->addViewData( $this->getView() );
65
+		$view = $this->addViewData($this->getView());
66 66
 		$siteid = $this->getContext()->getLocale()->getSiteId();
67
-		$data = $view->param( 'text', [] );
67
+		$data = $view->param('text', []);
68 68
 
69
-		foreach( $data as $idx => $entry )
69
+		foreach ($data as $idx => $entry)
70 70
 		{
71 71
 			$data[$idx]['product.lists.siteid'] = $siteid;
72 72
 			$data[$idx]['text.siteid'] = $siteid;
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$view->textData = $data;
76 76
 		$view->textBody = '';
77 77
 
78
-		foreach( $this->getSubClients() as $client ) {
78
+		foreach ($this->getSubClients() as $client) {
79 79
 			$view->textBody .= $client->create();
80 80
 		}
81 81
 
82
-		return $this->render( $view );
82
+		return $this->render($view);
83 83
 	}
84 84
 
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		parent::delete();
92 92
 
93 93
 		$item = $this->getView()->item;
94
-		$item->deleteListItems( $item->getListItems( 'text', null, null, false ), true );
94
+		$item->deleteListItems($item->getListItems('text', null, null, false), true);
95 95
 	}
96 96
 
97 97
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get()
104 104
 	{
105
-		$view = $this->addViewData( $this->getView() );
105
+		$view = $this->addViewData($this->getView());
106 106
 
107
-		$view->textData = $this->toArray( $view->item );
107
+		$view->textData = $this->toArray($view->item);
108 108
 		$view->textBody = '';
109 109
 
110
-		foreach( $this->getSubClients() as $client ) {
110
+		foreach ($this->getSubClients() as $client) {
111 111
 			$view->textBody .= $client->get();
112 112
 		}
113 113
 
114
-		return $this->render( $view );
114
+		return $this->render($view);
115 115
 	}
116 116
 
117 117
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
 
125 125
 		try
126 126
 		{
127
-			$view->item = $this->fromArray( $view->item, $view->param( 'text', [] ) );
127
+			$view->item = $this->fromArray($view->item, $view->param('text', []));
128 128
 			$view->textBody = '';
129 129
 
130
-			foreach( $this->getSubClients() as $client ) {
130
+			foreach ($this->getSubClients() as $client) {
131 131
 				$view->textBody .= $client->save();
132 132
 			}
133 133
 
134 134
 			return;
135 135
 		}
136
-		catch( \Aimeos\MShop\Exception $e )
136
+		catch (\Aimeos\MShop\Exception $e)
137 137
 		{
138
-			$error = array( 'product-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
139
-			$view->errors = $view->get( 'errors', [] ) + $error;
140
-			$this->logException( $e );
138
+			$error = array('product-item-text' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
139
+			$view->errors = $view->get('errors', []) + $error;
140
+			$this->logException($e);
141 141
 		}
142
-		catch( \Exception $e )
142
+		catch (\Exception $e)
143 143
 		{
144
-			$error = array( 'product-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
145
-			$view->errors = $view->get( 'errors', [] ) + $error;
146
-			$this->logException( $e );
144
+			$error = array('product-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
145
+			$view->errors = $view->get('errors', []) + $error;
146
+			$this->logException($e);
147 147
 		}
148 148
 
149 149
 		throw new \Aimeos\Admin\JQAdm\Exception();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** admin/jqadm/product/text/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the product JQAdm client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see admin/jqadm/product/text/decorators/excludes
233 233
 		 * @see admin/jqadm/product/text/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'product/text/' . $type, $name );
235
+		return $this->createSubClient('product/text/' . $type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @since 2017.07
277 277
 		 * @category Developer
278 278
 		 */
279
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/product/text/standard/subparts', [] );
279
+		return $this->getContext()->getConfig()->get('admin/jqadm/product/text/standard/subparts', []);
280 280
 	}
281 281
 
282 282
 
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
 	 * @param \Aimeos\MW\View\Iface $view View object
287 287
 	 * @return \Aimeos\MW\View\Iface View object with assigned parameters
288 288
 	 */
289
-	protected function addViewData( \Aimeos\MW\View\Iface $view )
289
+	protected function addViewData(\Aimeos\MW\View\Iface $view)
290 290
 	{
291 291
 		$context = $this->getContext();
292 292
 
293
-		$textTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'text/type' );
294
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'product/lists/type' );
293
+		$textTypeManager = \Aimeos\MShop\Factory::createManager($context, 'text/type');
294
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'product/lists/type');
295 295
 
296
-		$search = $textTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
297
-		$search->setConditions( $search->compare( '==', 'text.type.domain', 'product' ) );
298
-		$search->setSortations( array( $search->sort( '+', 'text.type.label' ) ) );
296
+		$search = $textTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
297
+		$search->setConditions($search->compare('==', 'text.type.domain', 'product'));
298
+		$search->setSortations(array($search->sort('+', 'text.type.label')));
299 299
 
300
-		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
301
-		$listSearch->setConditions( $listSearch->compare( '==', 'product.lists.type.domain', 'text' ) );
302
-		$listSearch->setSortations( array( $listSearch->sort( '+', 'product.lists.type.label' ) ) );
300
+		$listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
301
+		$listSearch->setConditions($listSearch->compare('==', 'product.lists.type.domain', 'text'));
302
+		$listSearch->setSortations(array($listSearch->sort('+', 'product.lists.type.label')));
303 303
 
304
-		$view->textTypes = $textTypeManager->searchItems( $search );
305
-		$view->textListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) );
304
+		$view->textTypes = $textTypeManager->searchItems($search);
305
+		$view->textListTypes = $this->sortType($listTypeManager->searchItems($listSearch));
306 306
 
307 307
 		return $view;
308 308
 	}
@@ -314,55 +314,55 @@  discard block
 block discarded – undo
314 314
 	 * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items
315 315
 	 * @param string[] $data Data array
316 316
 	 */
317
-	protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data )
317
+	protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data)
318 318
 	{
319 319
 		$context = $this->getContext();
320 320
 
321
-		$textManager = \Aimeos\MShop\Factory::createManager( $context, 'text' );
322
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'product/lists' );
323
-		$textTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'text/type' );
324
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'product/lists/type' );
321
+		$textManager = \Aimeos\MShop\Factory::createManager($context, 'text');
322
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'product/lists');
323
+		$textTypeManager = \Aimeos\MShop\Factory::createManager($context, 'text/type');
324
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'product/lists/type');
325 325
 
326
-		$listItems = $item->getListItems( 'text', null, null, false );
326
+		$listItems = $item->getListItems('text', null, null, false);
327 327
 
328 328
 
329
-		foreach( $data as $idx => $entry )
329
+		foreach ($data as $idx => $entry)
330 330
 		{
331
-			if( trim( $this->getValue( $entry, 'text.content', '' ) ) === '' ) {
331
+			if (trim($this->getValue($entry, 'text.content', '')) === '') {
332 332
 				continue;
333 333
 			}
334 334
 
335
-			$type = $textTypeManager->getItem( $entry['text.typeid'] )->getCode();
336
-			$listType = $listTypeManager->getItem( $entry['product.lists.typeid'] )->getCode();
335
+			$type = $textTypeManager->getItem($entry['text.typeid'])->getCode();
336
+			$listType = $listTypeManager->getItem($entry['product.lists.typeid'])->getCode();
337 337
 
338
-			if( ( $listItem = $item->getListItem( 'text', $listType, $entry['text.id'] ) ) === null ) {
339
-				$listItem = $listManager->createItem( $listType, 'text' );
338
+			if (($listItem = $item->getListItem('text', $listType, $entry['text.id'])) === null) {
339
+				$listItem = $listManager->createItem($listType, 'text');
340 340
 			}
341 341
 
342
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
343
-				$refItem = $textManager->createItem( $type, 'product' );
342
+			if (($refItem = $listItem->getRefItem()) === null) {
343
+				$refItem = $textManager->createItem($type, 'product');
344 344
 			}
345 345
 
346
-			$refItem->fromArray( $entry );
346
+			$refItem->fromArray($entry);
347 347
 			$conf = [];
348 348
 
349
-			foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key )
349
+			foreach ((array) $this->getValue($entry, 'config/key') as $num => $key)
350 350
 			{
351
-				if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) {
352
-					$conf[$key] = trim( $val );
351
+				if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) {
352
+					$conf[$key] = trim($val);
353 353
 				}
354 354
 			}
355 355
 
356
-			$listItem->fromArray( $entry );
357
-			$listItem->setPosition( $idx );
358
-			$listItem->setConfig( $conf );
356
+			$listItem->fromArray($entry);
357
+			$listItem->setPosition($idx);
358
+			$listItem->setConfig($conf);
359 359
 
360
-			$item->addListItem( 'text', $listItem, $refItem );
360
+			$item->addListItem('text', $listItem, $refItem);
361 361
 
362
-			unset( $listItems[$listItem->getId()] );
362
+			unset($listItems[$listItem->getId()]);
363 363
 		}
364 364
 
365
-		return $item->deleteListItems( $listItems, true );
365
+		return $item->deleteListItems($listItems, true);
366 366
 	}
367 367
 
368 368
 
@@ -373,20 +373,20 @@  discard block
 block discarded – undo
373 373
 	 * @param boolean $copy True if items should be copied, false if not
374 374
 	 * @return string[] Multi-dimensional associative list of item data
375 375
 	 */
376
-	protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false )
376
+	protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false)
377 377
 	{
378 378
 		$data = [];
379 379
 		$siteId = $this->getContext()->getLocale()->getSiteId();
380 380
 
381
-		foreach( $item->getListItems( 'text', null, null, false ) as $listItem )
381
+		foreach ($item->getListItems('text', null, null, false) as $listItem)
382 382
 		{
383
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
383
+			if (($refItem = $listItem->getRefItem()) === null) {
384 384
 				continue;
385 385
 			}
386 386
 
387
-			$list = $listItem->toArray( true ) + $refItem->toArray( true );
387
+			$list = $listItem->toArray(true) + $refItem->toArray(true);
388 388
 
389
-			if( $copy === true )
389
+			if ($copy === true)
390 390
 			{
391 391
 				$list['product.lists.siteid'] = $siteId;
392 392
 				$list['product.lists.id'] = '';
@@ -394,10 +394,10 @@  discard block
 block discarded – undo
394 394
 				$list['text.id'] = null;
395 395
 			}
396 396
 
397
-			$list['product.lists.datestart'] = str_replace( ' ', 'T', $list['product.lists.datestart'] );
398
-			$list['product.lists.dateend'] = str_replace( ' ', 'T', $list['product.lists.dateend'] );
397
+			$list['product.lists.datestart'] = str_replace(' ', 'T', $list['product.lists.datestart']);
398
+			$list['product.lists.dateend'] = str_replace(' ', 'T', $list['product.lists.dateend']);
399 399
 
400
-			foreach( $list['product.lists.config'] as $key => $val )
400
+			foreach ($list['product.lists.config'] as $key => $val)
401 401
 			{
402 402
 				$list['config']['key'][] = $key;
403 403
 				$list['config']['val'][] = $val;
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
417 417
 	 * @return string HTML output
418 418
 	 */
419
-	protected function render( \Aimeos\MW\View\Iface $view )
419
+	protected function render(\Aimeos\MW\View\Iface $view)
420 420
 	{
421 421
 		/** admin/jqadm/product/text/template-item
422 422
 		 * Relative path to the HTML body template of the text subpart for products.
@@ -440,6 +440,6 @@  discard block
 block discarded – undo
440 440
 		$tplconf = 'admin/jqadm/product/text/template-item';
441 441
 		$default = 'product/item-text-standard.php';
442 442
 
443
-		return $view->render( $view->config( $tplconf, $default ) );
443
+		return $view->render($view->config($tplconf, $default));
444 444
 	}
445 445
 }
446 446
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Service/Text/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,14 +160,12 @@
 block discarded – undo
160 160
 			}
161 161
 
162 162
 			return;
163
-		}
164
-		catch( \Aimeos\MShop\Exception $e )
163
+		} catch( \Aimeos\MShop\Exception $e )
165 164
 		{
166 165
 			$error = array( 'service-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
167 166
 			$view->errors = $view->get( 'errors', [] ) + $error;
168 167
 			$this->logException( $e );
169
-		}
170
-		catch( \Exception $e )
168
+		} catch( \Exception $e )
171 169
 		{
172 170
 			$error = array( 'service-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
173 171
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 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\Text;
12 12
 
13
-sprintf( 'text' ); // for translation
13
+sprintf('text'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		$view = $this->addViewData( $this->getView() );
45
+		$view = $this->addViewData($this->getView());
46 46
 
47
-		$view->textData = $this->toArray( $view->item, true );
47
+		$view->textData = $this->toArray($view->item, true);
48 48
 		$view->textBody = '';
49 49
 
50
-		foreach( $this->getSubClients() as $client ) {
50
+		foreach ($this->getSubClients() as $client) {
51 51
 			$view->textBody .= $client->copy();
52 52
 		}
53 53
 
54
-		return $this->render( $view );
54
+		return $this->render($view);
55 55
 	}
56 56
 
57 57
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function create()
64 64
 	{
65
-		$view = $this->addViewData( $this->getView() );
65
+		$view = $this->addViewData($this->getView());
66 66
 		$siteid = $this->getContext()->getLocale()->getSiteId();
67
-		$data = $view->param( 'text', [] );
67
+		$data = $view->param('text', []);
68 68
 
69
-		foreach( $data as $idx => $entry )
69
+		foreach ($data as $idx => $entry)
70 70
 		{
71 71
 			$data[$idx]['service.lists.siteid'] = $siteid;
72 72
 			$data[$idx]['text.siteid'] = $siteid;
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$view->textData = $data;
76 76
 		$view->textBody = '';
77 77
 
78
-		foreach( $this->getSubClients() as $client ) {
78
+		foreach ($this->getSubClients() as $client) {
79 79
 			$view->textBody .= $client->create();
80 80
 		}
81 81
 
82
-		return $this->render( $view );
82
+		return $this->render($view);
83 83
 	}
84 84
 
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		parent::delete();
92 92
 
93 93
 		$item = $this->getView()->item;
94
-		$item->deleteListItems( $item->getListItems( 'text', null, null, false ), true );
94
+		$item->deleteListItems($item->getListItems('text', null, null, false), true);
95 95
 	}
96 96
 
97 97
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get()
104 104
 	{
105
-		$view = $this->addViewData( $this->getView() );
105
+		$view = $this->addViewData($this->getView());
106 106
 
107
-		$view->textData = $this->toArray( $view->item );
107
+		$view->textData = $this->toArray($view->item);
108 108
 		$view->textBody = '';
109 109
 
110
-		foreach( $this->getSubClients() as $client ) {
110
+		foreach ($this->getSubClients() as $client) {
111 111
 			$view->textBody .= $client->get();
112 112
 		}
113 113
 
114
-		return $this->render( $view );
114
+		return $this->render($view);
115 115
 	}
116 116
 
117 117
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
 
125 125
 		try
126 126
 		{
127
-			$view->item = $this->fromArray( $view->item, $view->param( 'text', [] ) );
127
+			$view->item = $this->fromArray($view->item, $view->param('text', []));
128 128
 			$view->textBody = '';
129 129
 
130
-			foreach( $this->getSubClients() as $client ) {
130
+			foreach ($this->getSubClients() as $client) {
131 131
 				$view->textBody .= $client->save();
132 132
 			}
133 133
 
134 134
 			return;
135 135
 		}
136
-		catch( \Aimeos\MShop\Exception $e )
136
+		catch (\Aimeos\MShop\Exception $e)
137 137
 		{
138
-			$error = array( 'service-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
139
-			$view->errors = $view->get( 'errors', [] ) + $error;
140
-			$this->logException( $e );
138
+			$error = array('service-item-text' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
139
+			$view->errors = $view->get('errors', []) + $error;
140
+			$this->logException($e);
141 141
 		}
142
-		catch( \Exception $e )
142
+		catch (\Exception $e)
143 143
 		{
144
-			$error = array( 'service-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
145
-			$view->errors = $view->get( 'errors', [] ) + $error;
146
-			$this->logException( $e );
144
+			$error = array('service-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
145
+			$view->errors = $view->get('errors', []) + $error;
146
+			$this->logException($e);
147 147
 		}
148 148
 
149 149
 		throw new \Aimeos\Admin\JQAdm\Exception();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** admin/jqadm/service/text/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the service JQAdm client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see admin/jqadm/service/text/decorators/excludes
233 233
 		 * @see admin/jqadm/service/text/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'service/text/' . $type, $name );
235
+		return $this->createSubClient('service/text/' . $type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @since 2017.07
277 277
 		 * @category Developer
278 278
 		 */
279
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/service/text/standard/subparts', [] );
279
+		return $this->getContext()->getConfig()->get('admin/jqadm/service/text/standard/subparts', []);
280 280
 	}
281 281
 
282 282
 
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
 	 * @param \Aimeos\MW\View\Iface $view View object
287 287
 	 * @return \Aimeos\MW\View\Iface View object with assigned parameters
288 288
 	 */
289
-	protected function addViewData( \Aimeos\MW\View\Iface $view )
289
+	protected function addViewData(\Aimeos\MW\View\Iface $view)
290 290
 	{
291 291
 		$context = $this->getContext();
292 292
 
293
-		$textTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'text/type' );
294
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'service/lists/type' );
293
+		$textTypeManager = \Aimeos\MShop\Factory::createManager($context, 'text/type');
294
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'service/lists/type');
295 295
 
296
-		$search = $textTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
297
-		$search->setConditions( $search->compare( '==', 'text.type.domain', 'service' ) );
298
-		$search->setSortations( array( $search->sort( '+', 'text.type.label' ) ) );
296
+		$search = $textTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
297
+		$search->setConditions($search->compare('==', 'text.type.domain', 'service'));
298
+		$search->setSortations(array($search->sort('+', 'text.type.label')));
299 299
 
300
-		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
301
-		$listSearch->setConditions( $listSearch->compare( '==', 'service.lists.type.domain', 'text' ) );
302
-		$listSearch->setSortations( array( $listSearch->sort( '+', 'service.lists.type.label' ) ) );
300
+		$listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
301
+		$listSearch->setConditions($listSearch->compare('==', 'service.lists.type.domain', 'text'));
302
+		$listSearch->setSortations(array($listSearch->sort('+', 'service.lists.type.label')));
303 303
 
304
-		$view->textTypes = $textTypeManager->searchItems( $search );
305
-		$view->textListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) );
304
+		$view->textTypes = $textTypeManager->searchItems($search);
305
+		$view->textListTypes = $this->sortType($listTypeManager->searchItems($listSearch));
306 306
 
307 307
 		return $view;
308 308
 	}
@@ -314,50 +314,50 @@  discard block
 block discarded – undo
314 314
 	 * @param \Aimeos\MShop\Service\Item\Iface $item Service item object without referenced domain items
315 315
 	 * @param string[] $data Data array
316 316
 	 */
317
-	protected function fromArray( \Aimeos\MShop\Service\Item\Iface $item, array $data )
317
+	protected function fromArray(\Aimeos\MShop\Service\Item\Iface $item, array $data)
318 318
 	{
319 319
 		$context = $this->getContext();
320 320
 
321
-		$textManager = \Aimeos\MShop\Factory::createManager( $context, 'text' );
322
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'service/lists' );
321
+		$textManager = \Aimeos\MShop\Factory::createManager($context, 'text');
322
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'service/lists');
323 323
 
324
-		$listItems = $item->getListItems( 'text', null, null, false );
324
+		$listItems = $item->getListItems('text', null, null, false);
325 325
 
326 326
 
327
-		foreach( $data as $idx => $entry )
327
+		foreach ($data as $idx => $entry)
328 328
 		{
329
-			if( trim( $this->getValue( $entry, 'text.content', '' ) ) === '' ) {
329
+			if (trim($this->getValue($entry, 'text.content', '')) === '') {
330 330
 				continue;
331 331
 			}
332 332
 
333
-			if( ( $listItem = $item->getListItem( 'text', $entry['service.lists.type'], $entry['text.id'] ) ) === null ) {
333
+			if (($listItem = $item->getListItem('text', $entry['service.lists.type'], $entry['text.id'])) === null) {
334 334
 				$listItem = $listManager->createItem();
335 335
 			}
336 336
 
337
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
337
+			if (($refItem = $listItem->getRefItem()) === null) {
338 338
 				$refItem = $textManager->createItem();
339 339
 			}
340 340
 
341
-			$refItem->fromArray( $entry );
341
+			$refItem->fromArray($entry);
342 342
 			$conf = [];
343 343
 
344
-			foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key )
344
+			foreach ((array) $this->getValue($entry, 'config/key') as $num => $key)
345 345
 			{
346
-				if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) {
347
-					$conf[$key] = trim( $val );
346
+				if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) {
347
+					$conf[$key] = trim($val);
348 348
 				}
349 349
 			}
350 350
 
351
-			$listItem->fromArray( $entry );
352
-			$listItem->setPosition( $idx );
353
-			$listItem->setConfig( $conf );
351
+			$listItem->fromArray($entry);
352
+			$listItem->setPosition($idx);
353
+			$listItem->setConfig($conf);
354 354
 
355
-			$item->addListItem( 'text', $listItem, $refItem );
355
+			$item->addListItem('text', $listItem, $refItem);
356 356
 
357
-			unset( $listItems[$listItem->getId()] );
357
+			unset($listItems[$listItem->getId()]);
358 358
 		}
359 359
 
360
-		return $item->deleteListItems( $listItems, true );
360
+		return $item->deleteListItems($listItems, true);
361 361
 	}
362 362
 
363 363
 
@@ -368,20 +368,20 @@  discard block
 block discarded – undo
368 368
 	 * @param boolean $copy True if items should be copied, false if not
369 369
 	 * @return string[] Multi-dimensional associative list of item data
370 370
 	 */
371
-	protected function toArray( \Aimeos\MShop\Service\Item\Iface $item, $copy = false )
371
+	protected function toArray(\Aimeos\MShop\Service\Item\Iface $item, $copy = false)
372 372
 	{
373 373
 		$data = [];
374 374
 		$siteId = $this->getContext()->getLocale()->getSiteId();
375 375
 
376
-		foreach( $item->getListItems( 'text', null, null, false ) as $listItem )
376
+		foreach ($item->getListItems('text', null, null, false) as $listItem)
377 377
 		{
378
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
378
+			if (($refItem = $listItem->getRefItem()) === null) {
379 379
 				continue;
380 380
 			}
381 381
 
382
-			$list = $listItem->toArray( true ) + $refItem->toArray( true );
382
+			$list = $listItem->toArray(true) + $refItem->toArray(true);
383 383
 
384
-			if( $copy === true )
384
+			if ($copy === true)
385 385
 			{
386 386
 				$list['service.lists.siteid'] = $siteId;
387 387
 				$list['service.lists.id'] = '';
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
 				$list['text.id'] = null;
390 390
 			}
391 391
 
392
-			$list['service.lists.datestart'] = str_replace( ' ', 'T', $list['service.lists.datestart'] );
393
-			$list['service.lists.dateend'] = str_replace( ' ', 'T', $list['service.lists.dateend'] );
392
+			$list['service.lists.datestart'] = str_replace(' ', 'T', $list['service.lists.datestart']);
393
+			$list['service.lists.dateend'] = str_replace(' ', 'T', $list['service.lists.dateend']);
394 394
 
395
-			foreach( $list['service.lists.config'] as $key => $val )
395
+			foreach ($list['service.lists.config'] as $key => $val)
396 396
 			{
397 397
 				$list['config']['key'][] = $key;
398 398
 				$list['config']['val'][] = $val;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
412 412
 	 * @return string HTML output
413 413
 	 */
414
-	protected function render( \Aimeos\MW\View\Iface $view )
414
+	protected function render(\Aimeos\MW\View\Iface $view)
415 415
 	{
416 416
 		/** admin/jqadm/service/text/template-item
417 417
 		 * Relative path to the HTML body template of the text subpart for services.
@@ -435,6 +435,6 @@  discard block
 block discarded – undo
435 435
 		$tplconf = 'admin/jqadm/service/text/template-item';
436 436
 		$default = 'service/item-text-standard.php';
437 437
 
438
-		return $view->render( $view->config( $tplconf, $default ) );
438
+		return $view->render($view->config($tplconf, $default));
439 439
 	}
440 440
 }
441 441
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Catalog/Text/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,14 +160,12 @@
 block discarded – undo
160 160
 			}
161 161
 
162 162
 			return;
163
-		}
164
-		catch( \Aimeos\MShop\Exception $e )
163
+		} catch( \Aimeos\MShop\Exception $e )
165 164
 		{
166 165
 			$error = array( 'catalog-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
167 166
 			$view->errors = $view->get( 'errors', [] ) + $error;
168 167
 			$this->logException( $e );
169
-		}
170
-		catch( \Exception $e )
168
+		} catch( \Exception $e )
171 169
 		{
172 170
 			$error = array( 'catalog-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
173 171
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 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\Catalog\Text;
12 12
 
13
-sprintf( 'text' ); // for translation
13
+sprintf('text'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		$view = $this->addViewData( $this->getView() );
45
+		$view = $this->addViewData($this->getView());
46 46
 
47
-		$view->textData = $this->toArray( $view->item, true );
47
+		$view->textData = $this->toArray($view->item, true);
48 48
 		$view->textBody = '';
49 49
 
50
-		foreach( $this->getSubClients() as $client ) {
50
+		foreach ($this->getSubClients() as $client) {
51 51
 			$view->textBody .= $client->copy();
52 52
 		}
53 53
 
54
-		return $this->render( $view );
54
+		return $this->render($view);
55 55
 	}
56 56
 
57 57
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function create()
64 64
 	{
65
-		$view = $this->addViewData( $this->getView() );
65
+		$view = $this->addViewData($this->getView());
66 66
 		$siteid = $this->getContext()->getLocale()->getSiteId();
67
-		$data = $view->param( 'text', [] );
67
+		$data = $view->param('text', []);
68 68
 
69
-		foreach( $data as $idx => $entry )
69
+		foreach ($data as $idx => $entry)
70 70
 		{
71 71
 			$data[$idx]['catalog.lists.siteid'] = $siteid;
72 72
 			$data[$idx]['text.siteid'] = $siteid;
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$view->textData = $data;
76 76
 		$view->textBody = '';
77 77
 
78
-		foreach( $this->getSubClients() as $client ) {
78
+		foreach ($this->getSubClients() as $client) {
79 79
 			$view->textBody .= $client->create();
80 80
 		}
81 81
 
82
-		return $this->render( $view );
82
+		return $this->render($view);
83 83
 	}
84 84
 
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		parent::delete();
92 92
 
93 93
 		$item = $this->getView()->item;
94
-		$item->deleteListItems( $item->getListItems( 'text', null, null, false ), true );
94
+		$item->deleteListItems($item->getListItems('text', null, null, false), true);
95 95
 	}
96 96
 
97 97
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get()
104 104
 	{
105
-		$view = $this->addViewData( $this->getView() );
105
+		$view = $this->addViewData($this->getView());
106 106
 
107
-		$view->textData = $this->toArray( $view->item );
107
+		$view->textData = $this->toArray($view->item);
108 108
 		$view->textBody = '';
109 109
 
110
-		foreach( $this->getSubClients() as $client ) {
110
+		foreach ($this->getSubClients() as $client) {
111 111
 			$view->textBody .= $client->get();
112 112
 		}
113 113
 
114
-		return $this->render( $view );
114
+		return $this->render($view);
115 115
 	}
116 116
 
117 117
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
 
125 125
 		try
126 126
 		{
127
-			$view->item = $this->fromArray( $view->item, $view->param( 'text', [] ) );
127
+			$view->item = $this->fromArray($view->item, $view->param('text', []));
128 128
 			$view->textBody = '';
129 129
 
130
-			foreach( $this->getSubClients() as $client ) {
130
+			foreach ($this->getSubClients() as $client) {
131 131
 				$view->textBody .= $client->save();
132 132
 			}
133 133
 
134 134
 			return;
135 135
 		}
136
-		catch( \Aimeos\MShop\Exception $e )
136
+		catch (\Aimeos\MShop\Exception $e)
137 137
 		{
138
-			$error = array( 'catalog-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
139
-			$view->errors = $view->get( 'errors', [] ) + $error;
140
-			$this->logException( $e );
138
+			$error = array('catalog-item-text' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
139
+			$view->errors = $view->get('errors', []) + $error;
140
+			$this->logException($e);
141 141
 		}
142
-		catch( \Exception $e )
142
+		catch (\Exception $e)
143 143
 		{
144
-			$error = array( 'catalog-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
145
-			$view->errors = $view->get( 'errors', [] ) + $error;
146
-			$this->logException( $e );
144
+			$error = array('catalog-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
145
+			$view->errors = $view->get('errors', []) + $error;
146
+			$this->logException($e);
147 147
 		}
148 148
 
149 149
 		throw new \Aimeos\Admin\JQAdm\Exception();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** admin/jqadm/catalog/text/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the catalog JQAdm client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see admin/jqadm/catalog/text/decorators/excludes
233 233
 		 * @see admin/jqadm/catalog/text/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'catalog/text/' . $type, $name );
235
+		return $this->createSubClient('catalog/text/' . $type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @since 2017.07
277 277
 		 * @category Developer
278 278
 		 */
279
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/text/standard/subparts', [] );
279
+		return $this->getContext()->getConfig()->get('admin/jqadm/catalog/text/standard/subparts', []);
280 280
 	}
281 281
 
282 282
 
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
 	 * @param \Aimeos\MW\View\Iface $view View object
287 287
 	 * @return \Aimeos\MW\View\Iface View object with assigned parameters
288 288
 	 */
289
-	protected function addViewData( \Aimeos\MW\View\Iface $view )
289
+	protected function addViewData(\Aimeos\MW\View\Iface $view)
290 290
 	{
291 291
 		$context = $this->getContext();
292 292
 
293
-		$textTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'text/type' );
294
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'catalog/lists/type' );
293
+		$textTypeManager = \Aimeos\MShop\Factory::createManager($context, 'text/type');
294
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'catalog/lists/type');
295 295
 
296
-		$search = $textTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
297
-		$search->setConditions( $search->compare( '==', 'text.type.domain', 'catalog' ) );
298
-		$search->setSortations( array( $search->sort( '+', 'text.type.label' ) ) );
296
+		$search = $textTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
297
+		$search->setConditions($search->compare('==', 'text.type.domain', 'catalog'));
298
+		$search->setSortations(array($search->sort('+', 'text.type.label')));
299 299
 
300
-		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
301
-		$listSearch->setConditions( $listSearch->compare( '==', 'catalog.lists.type.domain', 'text' ) );
302
-		$listSearch->setSortations( array( $listSearch->sort( '+', 'catalog.lists.type.label' ) ) );
300
+		$listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
301
+		$listSearch->setConditions($listSearch->compare('==', 'catalog.lists.type.domain', 'text'));
302
+		$listSearch->setSortations(array($listSearch->sort('+', 'catalog.lists.type.label')));
303 303
 
304
-		$view->textTypes = $textTypeManager->searchItems( $search );
305
-		$view->textListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) );
304
+		$view->textTypes = $textTypeManager->searchItems($search);
305
+		$view->textListTypes = $this->sortType($listTypeManager->searchItems($listSearch));
306 306
 
307 307
 		return $view;
308 308
 	}
@@ -314,50 +314,50 @@  discard block
 block discarded – undo
314 314
 	 * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item object without referenced domain items
315 315
 	 * @param string[] $data Data array
316 316
 	 */
317
-	protected function fromArray( \Aimeos\MShop\Catalog\Item\Iface $item, array $data )
317
+	protected function fromArray(\Aimeos\MShop\Catalog\Item\Iface $item, array $data)
318 318
 	{
319 319
 		$context = $this->getContext();
320 320
 
321
-		$textManager = \Aimeos\MShop\Factory::createManager( $context, 'text' );
322
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'catalog/lists' );
321
+		$textManager = \Aimeos\MShop\Factory::createManager($context, 'text');
322
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'catalog/lists');
323 323
 
324
-		$listItems = $item->getListItems( 'text', null, null, false );
324
+		$listItems = $item->getListItems('text', null, null, false);
325 325
 
326 326
 
327
-		foreach( $data as $idx => $entry )
327
+		foreach ($data as $idx => $entry)
328 328
 		{
329
-			if( trim( $this->getValue( $entry, 'text.content', '' ) ) === '' ) {
329
+			if (trim($this->getValue($entry, 'text.content', '')) === '') {
330 330
 				continue;
331 331
 			}
332 332
 
333
-			if( ( $listItem = $item->getListItem( 'text', $entry['catalog.lists.type'], $entry['text.id'] ) ) === null ) {
333
+			if (($listItem = $item->getListItem('text', $entry['catalog.lists.type'], $entry['text.id'])) === null) {
334 334
 				$listItem = $listManager->createItem();
335 335
 			}
336 336
 
337
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
337
+			if (($refItem = $listItem->getRefItem()) === null) {
338 338
 				$refItem = $textManager->createItem();
339 339
 			}
340 340
 
341
-			$refItem->fromArray( $entry );
341
+			$refItem->fromArray($entry);
342 342
 			$conf = [];
343 343
 
344
-			foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key )
344
+			foreach ((array) $this->getValue($entry, 'config/key') as $num => $key)
345 345
 			{
346
-				if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) {
347
-					$conf[$key] = trim( $val );
346
+				if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) {
347
+					$conf[$key] = trim($val);
348 348
 				}
349 349
 			}
350 350
 
351
-			$listItem->fromArray( $entry );
352
-			$listItem->setPosition( $idx );
353
-			$listItem->setConfig( $conf );
351
+			$listItem->fromArray($entry);
352
+			$listItem->setPosition($idx);
353
+			$listItem->setConfig($conf);
354 354
 
355
-			$item->addListItem( 'text', $listItem, $refItem );
355
+			$item->addListItem('text', $listItem, $refItem);
356 356
 
357
-			unset( $listItems[$listItem->getId()] );
357
+			unset($listItems[$listItem->getId()]);
358 358
 		}
359 359
 
360
-		return $item->deleteListItems( $listItems, true );
360
+		return $item->deleteListItems($listItems, true);
361 361
 	}
362 362
 
363 363
 
@@ -368,20 +368,20 @@  discard block
 block discarded – undo
368 368
 	 * @param boolean $copy True if items should be copied, false if not
369 369
 	 * @return string[] Multi-dimensional associative list of item data
370 370
 	 */
371
-	protected function toArray( \Aimeos\MShop\Catalog\Item\Iface $item, $copy = false )
371
+	protected function toArray(\Aimeos\MShop\Catalog\Item\Iface $item, $copy = false)
372 372
 	{
373 373
 		$data = [];
374 374
 		$siteId = $this->getContext()->getLocale()->getSiteId();
375 375
 
376
-		foreach( $item->getListItems( 'text', null, null, false ) as $listItem )
376
+		foreach ($item->getListItems('text', null, null, false) as $listItem)
377 377
 		{
378
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
378
+			if (($refItem = $listItem->getRefItem()) === null) {
379 379
 				continue;
380 380
 			}
381 381
 
382
-			$list = $listItem->toArray( true ) + $refItem->toArray( true );
382
+			$list = $listItem->toArray(true) + $refItem->toArray(true);
383 383
 
384
-			if( $copy === true )
384
+			if ($copy === true)
385 385
 			{
386 386
 				$list['catalog.lists.siteid'] = $siteId;
387 387
 				$list['catalog.lists.id'] = '';
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
 				$list['text.id'] = null;
390 390
 			}
391 391
 
392
-			$list['catalog.lists.datestart'] = str_replace( ' ', 'T', $list['catalog.lists.datestart'] );
393
-			$list['catalog.lists.dateend'] = str_replace( ' ', 'T', $list['catalog.lists.dateend'] );
392
+			$list['catalog.lists.datestart'] = str_replace(' ', 'T', $list['catalog.lists.datestart']);
393
+			$list['catalog.lists.dateend'] = str_replace(' ', 'T', $list['catalog.lists.dateend']);
394 394
 
395
-			foreach( $list['catalog.lists.config'] as $key => $val )
395
+			foreach ($list['catalog.lists.config'] as $key => $val)
396 396
 			{
397 397
 				$list['config']['key'][] = $key;
398 398
 				$list['config']['val'][] = $val;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
412 412
 	 * @return string HTML output
413 413
 	 */
414
-	protected function render( \Aimeos\MW\View\Iface $view )
414
+	protected function render(\Aimeos\MW\View\Iface $view)
415 415
 	{
416 416
 		/** admin/jqadm/catalog/text/template-item
417 417
 		 * Relative path to the HTML body template of the text subpart for catalogs.
@@ -435,6 +435,6 @@  discard block
 block discarded – undo
435 435
 		$tplconf = 'admin/jqadm/catalog/text/template-item';
436 436
 		$default = 'catalog/item-text-standard.php';
437 437
 
438
-		return $view->render( $view->config( $tplconf, $default ) );
438
+		return $view->render($view->config($tplconf, $default));
439 439
 	}
440 440
 }
441 441
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Supplier/Text/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,14 +160,12 @@
 block discarded – undo
160 160
 			}
161 161
 
162 162
 			return;
163
-		}
164
-		catch( \Aimeos\MShop\Exception $e )
163
+		} catch( \Aimeos\MShop\Exception $e )
165 164
 		{
166 165
 			$error = array( 'supplier-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
167 166
 			$view->errors = $view->get( 'errors', [] ) + $error;
168 167
 			$this->logException( $e );
169
-		}
170
-		catch( \Exception $e )
168
+		} catch( \Exception $e )
171 169
 		{
172 170
 			$error = array( 'supplier-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
173 171
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 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\Text;
12 12
 
13
-sprintf( 'text' ); // for translation
13
+sprintf('text'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		$view = $this->addViewData( $this->getView() );
45
+		$view = $this->addViewData($this->getView());
46 46
 
47
-		$view->textData = $this->toArray( $view->item, true );
47
+		$view->textData = $this->toArray($view->item, true);
48 48
 		$view->textBody = '';
49 49
 
50
-		foreach( $this->getSubClients() as $client ) {
50
+		foreach ($this->getSubClients() as $client) {
51 51
 			$view->textBody .= $client->copy();
52 52
 		}
53 53
 
54
-		return $this->render( $view );
54
+		return $this->render($view);
55 55
 	}
56 56
 
57 57
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function create()
64 64
 	{
65
-		$view = $this->addViewData( $this->getView() );
65
+		$view = $this->addViewData($this->getView());
66 66
 		$siteid = $this->getContext()->getLocale()->getSiteId();
67
-		$data = $view->param( 'text', [] );
67
+		$data = $view->param('text', []);
68 68
 
69
-		foreach( $data as $idx => $entry )
69
+		foreach ($data as $idx => $entry)
70 70
 		{
71 71
 			$data[$idx]['supplier.lists.siteid'] = $siteid;
72 72
 			$data[$idx]['text.siteid'] = $siteid;
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$view->textData = $data;
76 76
 		$view->textBody = '';
77 77
 
78
-		foreach( $this->getSubClients() as $client ) {
78
+		foreach ($this->getSubClients() as $client) {
79 79
 			$view->textBody .= $client->create();
80 80
 		}
81 81
 
82
-		return $this->render( $view );
82
+		return $this->render($view);
83 83
 	}
84 84
 
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		parent::delete();
92 92
 
93 93
 		$item = $this->getView()->item;
94
-		$item->deleteListItems( $item->getListItems( 'text', null, null, false ), true );
94
+		$item->deleteListItems($item->getListItems('text', null, null, false), true);
95 95
 	}
96 96
 
97 97
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get()
104 104
 	{
105
-		$view = $this->addViewData( $this->getView() );
105
+		$view = $this->addViewData($this->getView());
106 106
 
107
-		$view->textData = $this->toArray( $view->item );
107
+		$view->textData = $this->toArray($view->item);
108 108
 		$view->textBody = '';
109 109
 
110
-		foreach( $this->getSubClients() as $client ) {
110
+		foreach ($this->getSubClients() as $client) {
111 111
 			$view->textBody .= $client->get();
112 112
 		}
113 113
 
114
-		return $this->render( $view );
114
+		return $this->render($view);
115 115
 	}
116 116
 
117 117
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
 
125 125
 		try
126 126
 		{
127
-			$view->item = $this->fromArray( $view->item, $view->param( 'text', [] ) );
127
+			$view->item = $this->fromArray($view->item, $view->param('text', []));
128 128
 			$view->textBody = '';
129 129
 
130
-			foreach( $this->getSubClients() as $client ) {
130
+			foreach ($this->getSubClients() as $client) {
131 131
 				$view->textBody .= $client->save();
132 132
 			}
133 133
 
134 134
 			return;
135 135
 		}
136
-		catch( \Aimeos\MShop\Exception $e )
136
+		catch (\Aimeos\MShop\Exception $e)
137 137
 		{
138
-			$error = array( 'supplier-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
139
-			$view->errors = $view->get( 'errors', [] ) + $error;
140
-			$this->logException( $e );
138
+			$error = array('supplier-item-text' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
139
+			$view->errors = $view->get('errors', []) + $error;
140
+			$this->logException($e);
141 141
 		}
142
-		catch( \Exception $e )
142
+		catch (\Exception $e)
143 143
 		{
144
-			$error = array( 'supplier-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
145
-			$view->errors = $view->get( 'errors', [] ) + $error;
146
-			$this->logException( $e );
144
+			$error = array('supplier-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
145
+			$view->errors = $view->get('errors', []) + $error;
146
+			$this->logException($e);
147 147
 		}
148 148
 
149 149
 		throw new \Aimeos\Admin\JQAdm\Exception();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** admin/jqadm/supplier/text/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the supplier JQAdm client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see admin/jqadm/supplier/text/decorators/excludes
233 233
 		 * @see admin/jqadm/supplier/text/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'supplier/text/' . $type, $name );
235
+		return $this->createSubClient('supplier/text/' . $type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @since 2018.07
277 277
 		 * @category Developer
278 278
 		 */
279
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/text/standard/subparts', [] );
279
+		return $this->getContext()->getConfig()->get('admin/jqadm/supplier/text/standard/subparts', []);
280 280
 	}
281 281
 
282 282
 
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
 	 * @param \Aimeos\MW\View\Iface $view View object
287 287
 	 * @return \Aimeos\MW\View\Iface View object with assigned parameters
288 288
 	 */
289
-	protected function addViewData( \Aimeos\MW\View\Iface $view )
289
+	protected function addViewData(\Aimeos\MW\View\Iface $view)
290 290
 	{
291 291
 		$context = $this->getContext();
292 292
 
293
-		$textTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'text/type' );
294
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'supplier/lists/type' );
293
+		$textTypeManager = \Aimeos\MShop\Factory::createManager($context, 'text/type');
294
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'supplier/lists/type');
295 295
 
296
-		$search = $textTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
297
-		$search->setConditions( $search->compare( '==', 'text.type.domain', 'supplier' ) );
298
-		$search->setSortations( array( $search->sort( '+', 'text.type.label' ) ) );
296
+		$search = $textTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
297
+		$search->setConditions($search->compare('==', 'text.type.domain', 'supplier'));
298
+		$search->setSortations(array($search->sort('+', 'text.type.label')));
299 299
 
300
-		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
301
-		$listSearch->setConditions( $listSearch->compare( '==', 'supplier.lists.type.domain', 'text' ) );
302
-		$listSearch->setSortations( array( $listSearch->sort( '+', 'supplier.lists.type.label' ) ) );
300
+		$listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
301
+		$listSearch->setConditions($listSearch->compare('==', 'supplier.lists.type.domain', 'text'));
302
+		$listSearch->setSortations(array($listSearch->sort('+', 'supplier.lists.type.label')));
303 303
 
304
-		$view->textTypes = $textTypeManager->searchItems( $search );
305
-		$view->textListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) );
304
+		$view->textTypes = $textTypeManager->searchItems($search);
305
+		$view->textListTypes = $this->sortType($listTypeManager->searchItems($listSearch));
306 306
 
307 307
 		return $view;
308 308
 	}
@@ -314,50 +314,50 @@  discard block
 block discarded – undo
314 314
 	 * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object without referenced domain items
315 315
 	 * @param string[] $data Data array
316 316
 	 */
317
-	protected function fromArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data )
317
+	protected function fromArray(\Aimeos\MShop\Supplier\Item\Iface $item, array $data)
318 318
 	{
319 319
 		$context = $this->getContext();
320 320
 
321
-		$textManager = \Aimeos\MShop\Factory::createManager( $context, 'text' );
322
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'supplier/lists' );
321
+		$textManager = \Aimeos\MShop\Factory::createManager($context, 'text');
322
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'supplier/lists');
323 323
 
324
-		$listItems = $item->getListItems( 'text', null, null, false );
324
+		$listItems = $item->getListItems('text', null, null, false);
325 325
 
326 326
 
327
-		foreach( $data as $idx => $entry )
327
+		foreach ($data as $idx => $entry)
328 328
 		{
329
-			if( trim( $this->getValue( $entry, 'text.content', '' ) ) === '' ) {
329
+			if (trim($this->getValue($entry, 'text.content', '')) === '') {
330 330
 				continue;
331 331
 			}
332 332
 
333
-			if( ( $listItem = $item->getListItem( 'text', $entry['supplier.lists.type'], $entry['text.id'] ) ) === null ) {
333
+			if (($listItem = $item->getListItem('text', $entry['supplier.lists.type'], $entry['text.id'])) === null) {
334 334
 				$listItem = $listManager->createItem();
335 335
 			}
336 336
 
337
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
337
+			if (($refItem = $listItem->getRefItem()) === null) {
338 338
 				$refItem = $textManager->createItem();
339 339
 			}
340 340
 
341
-			$refItem->fromArray( $entry );
341
+			$refItem->fromArray($entry);
342 342
 			$conf = [];
343 343
 
344
-			foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key )
344
+			foreach ((array) $this->getValue($entry, 'config/key') as $num => $key)
345 345
 			{
346
-				if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) {
347
-					$conf[$key] = trim( $val );
346
+				if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) {
347
+					$conf[$key] = trim($val);
348 348
 				}
349 349
 			}
350 350
 
351
-			$listItem->fromArray( $entry );
352
-			$listItem->setPosition( $idx );
353
-			$listItem->setConfig( $conf );
351
+			$listItem->fromArray($entry);
352
+			$listItem->setPosition($idx);
353
+			$listItem->setConfig($conf);
354 354
 
355
-			$item->addListItem( 'text', $listItem, $refItem );
355
+			$item->addListItem('text', $listItem, $refItem);
356 356
 
357
-			unset( $listItems[$listItem->getId()] );
357
+			unset($listItems[$listItem->getId()]);
358 358
 		}
359 359
 
360
-		return $item->deleteListItems( $listItems, true );
360
+		return $item->deleteListItems($listItems, true);
361 361
 	}
362 362
 
363 363
 
@@ -368,20 +368,20 @@  discard block
 block discarded – undo
368 368
 	 * @param boolean $copy True if items should be copied, false if not
369 369
 	 * @return string[] Multi-dimensional associative list of item data
370 370
 	 */
371
-	protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, $copy = false )
371
+	protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, $copy = false)
372 372
 	{
373 373
 		$data = [];
374 374
 		$siteId = $this->getContext()->getLocale()->getSiteId();
375 375
 
376
-		foreach( $item->getListItems( 'text', null, null, false ) as $listItem )
376
+		foreach ($item->getListItems('text', null, null, false) as $listItem)
377 377
 		{
378
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
378
+			if (($refItem = $listItem->getRefItem()) === null) {
379 379
 				continue;
380 380
 			}
381 381
 
382
-			$list = $listItem->toArray( true ) + $refItem->toArray( true );
382
+			$list = $listItem->toArray(true) + $refItem->toArray(true);
383 383
 
384
-			if( $copy === true )
384
+			if ($copy === true)
385 385
 			{
386 386
 				$list['supplier.lists.siteid'] = $siteId;
387 387
 				$list['supplier.lists.id'] = '';
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
 				$list['text.id'] = null;
390 390
 			}
391 391
 
392
-			$list['supplier.lists.datestart'] = str_replace( ' ', 'T', $list['supplier.lists.datestart'] );
393
-			$list['supplier.lists.dateend'] = str_replace( ' ', 'T', $list['supplier.lists.dateend'] );
392
+			$list['supplier.lists.datestart'] = str_replace(' ', 'T', $list['supplier.lists.datestart']);
393
+			$list['supplier.lists.dateend'] = str_replace(' ', 'T', $list['supplier.lists.dateend']);
394 394
 
395
-			foreach( $list['supplier.lists.config'] as $key => $val )
395
+			foreach ($list['supplier.lists.config'] as $key => $val)
396 396
 			{
397 397
 				$list['config']['key'][] = $key;
398 398
 				$list['config']['val'][] = $val;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
412 412
 	 * @return string HTML output
413 413
 	 */
414
-	protected function render( \Aimeos\MW\View\Iface $view )
414
+	protected function render(\Aimeos\MW\View\Iface $view)
415 415
 	{
416 416
 		/** admin/jqadm/supplier/text/template-item
417 417
 		 * Relative path to the HTML body template of the text subpart for suppliers.
@@ -435,6 +435,6 @@  discard block
 block discarded – undo
435 435
 		$tplconf = 'admin/jqadm/supplier/text/template-item';
436 436
 		$default = 'supplier/item-text-standard.php';
437 437
 
438
-		return $view->render( $view->config( $tplconf, $default ) );
438
+		return $view->render($view->config($tplconf, $default));
439 439
 	}
440 440
 }
441 441
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Attribute/Price/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,14 +160,12 @@
 block discarded – undo
160 160
 			}
161 161
 
162 162
 			return;
163
-		}
164
-		catch( \Aimeos\MShop\Exception $e )
163
+		} catch( \Aimeos\MShop\Exception $e )
165 164
 		{
166 165
 			$error = array( 'attribute-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
167 166
 			$view->errors = $view->get( 'errors', [] ) + $error;
168 167
 			$this->logException( $e );
169
-		}
170
-		catch( \Exception $e )
168
+		} catch( \Exception $e )
171 169
 		{
172 170
 			$error = array( 'attribute-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
173 171
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 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\Price;
12 12
 
13
-sprintf( 'price' ); // for translation
13
+sprintf('price'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		$view = $this->addViewData( $this->getView() );
45
+		$view = $this->addViewData($this->getView());
46 46
 
47
-		$view->priceData = $this->toArray( $view->item, true );
47
+		$view->priceData = $this->toArray($view->item, true);
48 48
 		$view->priceBody = '';
49 49
 
50
-		foreach( $this->getSubClients() as $client ) {
50
+		foreach ($this->getSubClients() as $client) {
51 51
 			$view->priceBody .= $client->copy();
52 52
 		}
53 53
 
54
-		return $this->render( $view );
54
+		return $this->render($view);
55 55
 	}
56 56
 
57 57
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function create()
64 64
 	{
65
-		$view = $this->addViewData( $this->getView() );
65
+		$view = $this->addViewData($this->getView());
66 66
 		$siteid = $this->getContext()->getLocale()->getSiteId();
67
-		$data = $view->param( 'price', [] );
67
+		$data = $view->param('price', []);
68 68
 
69
-		foreach( $data as $idx => $entry )
69
+		foreach ($data as $idx => $entry)
70 70
 		{
71 71
 			$data[$idx]['attribute.lists.siteid'] = $siteid;
72 72
 			$data[$idx]['price.siteid'] = $siteid;
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$view->priceData = $data;
76 76
 		$view->priceBody = '';
77 77
 
78
-		foreach( $this->getSubClients() as $client ) {
78
+		foreach ($this->getSubClients() as $client) {
79 79
 			$view->priceBody .= $client->create();
80 80
 		}
81 81
 
82
-		return $this->render( $view );
82
+		return $this->render($view);
83 83
 	}
84 84
 
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		parent::delete();
92 92
 
93 93
 		$item = $this->getView()->item;
94
-		$item->deleteListItems( $item->getListItems( 'price', null, null, false ), true );
94
+		$item->deleteListItems($item->getListItems('price', null, null, false), true);
95 95
 	}
96 96
 
97 97
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get()
104 104
 	{
105
-		$view = $this->addViewData( $this->getView() );
105
+		$view = $this->addViewData($this->getView());
106 106
 
107
-		$view->priceData = $this->toArray( $view->item );
107
+		$view->priceData = $this->toArray($view->item);
108 108
 		$view->priceBody = '';
109 109
 
110
-		foreach( $this->getSubClients() as $client ) {
110
+		foreach ($this->getSubClients() as $client) {
111 111
 			$view->priceBody .= $client->get();
112 112
 		}
113 113
 
114
-		return $this->render( $view );
114
+		return $this->render($view);
115 115
 	}
116 116
 
117 117
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
 
125 125
 		try
126 126
 		{
127
-			$view->item = $this->fromArray( $view->item, $view->param( 'price', [] ) );
127
+			$view->item = $this->fromArray($view->item, $view->param('price', []));
128 128
 			$view->priceBody = '';
129 129
 
130
-			foreach( $this->getSubClients() as $client ) {
130
+			foreach ($this->getSubClients() as $client) {
131 131
 				$view->priceBody .= $client->save();
132 132
 			}
133 133
 
134 134
 			return;
135 135
 		}
136
-		catch( \Aimeos\MShop\Exception $e )
136
+		catch (\Aimeos\MShop\Exception $e)
137 137
 		{
138
-			$error = array( 'attribute-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
139
-			$view->errors = $view->get( 'errors', [] ) + $error;
140
-			$this->logException( $e );
138
+			$error = array('attribute-item-price' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
139
+			$view->errors = $view->get('errors', []) + $error;
140
+			$this->logException($e);
141 141
 		}
142
-		catch( \Exception $e )
142
+		catch (\Exception $e)
143 143
 		{
144
-			$error = array( 'attribute-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
145
-			$view->errors = $view->get( 'errors', [] ) + $error;
146
-			$this->logException( $e );
144
+			$error = array('attribute-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
145
+			$view->errors = $view->get('errors', []) + $error;
146
+			$this->logException($e);
147 147
 		}
148 148
 
149 149
 		throw new \Aimeos\Admin\JQAdm\Exception();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** admin/jqadm/attribute/price/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the attribute JQAdm client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see admin/jqadm/attribute/price/decorators/excludes
233 233
 		 * @see admin/jqadm/attribute/price/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'attribute/price/' . $type, $name );
235
+		return $this->createSubClient('attribute/price/' . $type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @since 2016.01
277 277
 		 * @category Developer
278 278
 		 */
279
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/price/standard/subparts', [] );
279
+		return $this->getContext()->getConfig()->get('admin/jqadm/attribute/price/standard/subparts', []);
280 280
 	}
281 281
 
282 282
 
@@ -286,28 +286,28 @@  discard block
 block discarded – undo
286 286
 	 * @param \Aimeos\MW\View\Iface $view View object
287 287
 	 * @return \Aimeos\MW\View\Iface View object with assigned parameters
288 288
 	 */
289
-	protected function addViewData( \Aimeos\MW\View\Iface $view )
289
+	protected function addViewData(\Aimeos\MW\View\Iface $view)
290 290
 	{
291 291
 		$context = $this->getContext();
292 292
 
293
-		$priceTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'price/type' );
294
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'attribute/lists/type' );
295
-		$currencyManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' );
293
+		$priceTypeManager = \Aimeos\MShop\Factory::createManager($context, 'price/type');
294
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'attribute/lists/type');
295
+		$currencyManager = \Aimeos\MShop\Factory::createManager($context, 'locale/currency');
296 296
 
297
-		$search = $priceTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
298
-		$search->setConditions( $search->compare( '==', 'price.type.domain', 'attribute' ) );
299
-		$search->setSortations( array( $search->sort( '+', 'price.type.label' ) ) );
297
+		$search = $priceTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
298
+		$search->setConditions($search->compare('==', 'price.type.domain', 'attribute'));
299
+		$search->setSortations(array($search->sort('+', 'price.type.label')));
300 300
 
301
-		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
302
-		$listSearch->setConditions( $listSearch->compare( '==', 'attribute.lists.type.domain', 'price' ) );
303
-		$listSearch->setSortations( array( $listSearch->sort( '+', 'attribute.lists.type.label' ) ) );
301
+		$listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
302
+		$listSearch->setConditions($listSearch->compare('==', 'attribute.lists.type.domain', 'price'));
303
+		$listSearch->setSortations(array($listSearch->sort('+', 'attribute.lists.type.label')));
304 304
 
305
-		$view->priceTypes = $priceTypeManager->searchItems( $search );
306
-		$view->priceListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) );
307
-		$view->priceCurrencies = $currencyManager->searchItems( $currencyManager->createSearch( true )->setSlice( 0, 0x7fffffff ) );
305
+		$view->priceTypes = $priceTypeManager->searchItems($search);
306
+		$view->priceListTypes = $this->sortType($listTypeManager->searchItems($listSearch));
307
+		$view->priceCurrencies = $currencyManager->searchItems($currencyManager->createSearch(true)->setSlice(0, 0x7fffffff));
308 308
 
309
-		if( $view->priceCurrencies === [] ) {
310
-			throw new \Aimeos\Admin\JQAdm\Exception( 'No currencies available. Please enable at least one currency' );
309
+		if ($view->priceCurrencies === []) {
310
+			throw new \Aimeos\Admin\JQAdm\Exception('No currencies available. Please enable at least one currency');
311 311
 		}
312 312
 
313 313
 		return $view;
@@ -320,46 +320,46 @@  discard block
 block discarded – undo
320 320
 	 * @param \Aimeos\MShop\Attribute\Item\Iface $item Attribute item object without referenced domain items
321 321
 	 * @param string[] $data Data array
322 322
 	 */
323
-	protected function fromArray( \Aimeos\MShop\Attribute\Item\Iface $item, array $data )
323
+	protected function fromArray(\Aimeos\MShop\Attribute\Item\Iface $item, array $data)
324 324
 	{
325 325
 		$context = $this->getContext();
326 326
 
327
-		$priceManager = \Aimeos\MShop\Factory::createManager( $context, 'price' );
328
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'attribute/lists' );
327
+		$priceManager = \Aimeos\MShop\Factory::createManager($context, 'price');
328
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'attribute/lists');
329 329
 
330
-		$listItems = $item->getListItems( 'price', null, null, false );
330
+		$listItems = $item->getListItems('price', null, null, false);
331 331
 
332 332
 
333
-		foreach( $data as $idx => $entry )
333
+		foreach ($data as $idx => $entry)
334 334
 		{
335
-			if( ( $listItem = $item->getListItem( 'price', $entry['attribute.lists.type'], $entry['price.id'] ) ) === null ) {
335
+			if (($listItem = $item->getListItem('price', $entry['attribute.lists.type'], $entry['price.id'])) === null) {
336 336
 				$listItem = $listManager->createItem();
337 337
 			}
338 338
 
339
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
339
+			if (($refItem = $listItem->getRefItem()) === null) {
340 340
 				$refItem = $priceManager->createItem();
341 341
 			}
342 342
 
343
-			$refItem->fromArray( $entry );
343
+			$refItem->fromArray($entry);
344 344
 			$conf = [];
345 345
 
346
-			foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key )
346
+			foreach ((array) $this->getValue($entry, 'config/key') as $num => $key)
347 347
 			{
348
-				if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) {
349
-					$conf[$key] = trim( $val );
348
+				if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) {
349
+					$conf[$key] = trim($val);
350 350
 				}
351 351
 			}
352 352
 
353
-			$listItem->fromArray( $entry );
354
-			$listItem->setPosition( $idx );
355
-			$listItem->setConfig( $conf );
353
+			$listItem->fromArray($entry);
354
+			$listItem->setPosition($idx);
355
+			$listItem->setConfig($conf);
356 356
 
357
-			$item->addListItem( 'price', $listItem, $refItem );
357
+			$item->addListItem('price', $listItem, $refItem);
358 358
 
359
-			unset( $listItems[$listItem->getId()] );
359
+			unset($listItems[$listItem->getId()]);
360 360
 		}
361 361
 
362
-		return $item->deleteListItems( $listItems, true );
362
+		return $item->deleteListItems($listItems, true);
363 363
 	}
364 364
 
365 365
 
@@ -370,20 +370,20 @@  discard block
 block discarded – undo
370 370
 	 * @param boolean $copy True if items should be copied, false if not
371 371
 	 * @return string[] Multi-dimensional associative list of item data
372 372
 	 */
373
-	protected function toArray( \Aimeos\MShop\Attribute\Item\Iface $item, $copy = false )
373
+	protected function toArray(\Aimeos\MShop\Attribute\Item\Iface $item, $copy = false)
374 374
 	{
375 375
 		$data = [];
376 376
 		$siteId = $this->getContext()->getLocale()->getSiteId();
377 377
 
378
-		foreach( $item->getListItems( 'price', null, null, false ) as $listItem )
378
+		foreach ($item->getListItems('price', null, null, false) as $listItem)
379 379
 		{
380
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
380
+			if (($refItem = $listItem->getRefItem()) === null) {
381 381
 				continue;
382 382
 			}
383 383
 
384
-			$list = $listItem->toArray( true ) + $refItem->toArray( true );
384
+			$list = $listItem->toArray(true) + $refItem->toArray(true);
385 385
 
386
-			if( $copy === true )
386
+			if ($copy === true)
387 387
 			{
388 388
 				$list['attribute.lists.siteid'] = $siteId;
389 389
 				$list['attribute.lists.id'] = '';
@@ -391,10 +391,10 @@  discard block
 block discarded – undo
391 391
 				$list['price.id'] = null;
392 392
 			}
393 393
 
394
-			$list['attribute.lists.datestart'] = str_replace( ' ', 'T', $list['attribute.lists.datestart'] );
395
-			$list['attribute.lists.dateend'] = str_replace( ' ', 'T', $list['attribute.lists.dateend'] );
394
+			$list['attribute.lists.datestart'] = str_replace(' ', 'T', $list['attribute.lists.datestart']);
395
+			$list['attribute.lists.dateend'] = str_replace(' ', 'T', $list['attribute.lists.dateend']);
396 396
 
397
-			foreach( $list['attribute.lists.config'] as $key => $val )
397
+			foreach ($list['attribute.lists.config'] as $key => $val)
398 398
 			{
399 399
 				$list['config']['key'][] = $key;
400 400
 				$list['config']['val'][] = $val;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
414 414
 	 * @return string HTML output
415 415
 	 */
416
-	protected function render( \Aimeos\MW\View\Iface $view )
416
+	protected function render(\Aimeos\MW\View\Iface $view)
417 417
 	{
418 418
 		/** admin/jqadm/attribute/price/template-item
419 419
 		 * Relative path to the HTML body template of the price subpart for attributes.
@@ -437,6 +437,6 @@  discard block
 block discarded – undo
437 437
 		$tplconf = 'admin/jqadm/attribute/price/template-item';
438 438
 		$default = 'attribute/item-price-standard.php';
439 439
 
440
-		return $view->render( $view->config( $tplconf, $default ) );
440
+		return $view->render($view->config($tplconf, $default));
441 441
 	}
442 442
 }
443 443
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Service/Price/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,14 +160,12 @@
 block discarded – undo
160 160
 			}
161 161
 
162 162
 			return;
163
-		}
164
-		catch( \Aimeos\MShop\Exception $e )
163
+		} catch( \Aimeos\MShop\Exception $e )
165 164
 		{
166 165
 			$error = array( 'service-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
167 166
 			$view->errors = $view->get( 'errors', [] ) + $error;
168 167
 			$this->logException( $e );
169
-		}
170
-		catch( \Exception $e )
168
+		} catch( \Exception $e )
171 169
 		{
172 170
 			$error = array( 'service-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
173 171
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 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\Price;
12 12
 
13
-sprintf( 'price' ); // for translation
13
+sprintf('price'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		$view = $this->addViewData( $this->getView() );
45
+		$view = $this->addViewData($this->getView());
46 46
 
47
-		$view->priceData = $this->toArray( $view->item, true );
47
+		$view->priceData = $this->toArray($view->item, true);
48 48
 		$view->priceBody = '';
49 49
 
50
-		foreach( $this->getSubClients() as $client ) {
50
+		foreach ($this->getSubClients() as $client) {
51 51
 			$view->priceBody .= $client->copy();
52 52
 		}
53 53
 
54
-		return $this->render( $view );
54
+		return $this->render($view);
55 55
 	}
56 56
 
57 57
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function create()
64 64
 	{
65
-		$view = $this->addViewData( $this->getView() );
65
+		$view = $this->addViewData($this->getView());
66 66
 		$siteid = $this->getContext()->getLocale()->getSiteId();
67
-		$data = $view->param( 'price', [] );
67
+		$data = $view->param('price', []);
68 68
 
69
-		foreach( $data as $idx => $entry )
69
+		foreach ($data as $idx => $entry)
70 70
 		{
71 71
 			$data[$idx]['service.lists.siteid'] = $siteid;
72 72
 			$data[$idx]['price.siteid'] = $siteid;
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$view->priceData = $data;
76 76
 		$view->priceBody = '';
77 77
 
78
-		foreach( $this->getSubClients() as $client ) {
78
+		foreach ($this->getSubClients() as $client) {
79 79
 			$view->priceBody .= $client->create();
80 80
 		}
81 81
 
82
-		return $this->render( $view );
82
+		return $this->render($view);
83 83
 	}
84 84
 
85 85
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		parent::delete();
92 92
 
93 93
 		$item = $this->getView()->item;
94
-		$item->deleteListItems( $item->getListItems( 'price', null, null, false ), true );
94
+		$item->deleteListItems($item->getListItems('price', null, null, false), true);
95 95
 	}
96 96
 
97 97
 
@@ -102,16 +102,16 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get()
104 104
 	{
105
-		$view = $this->addViewData( $this->getView() );
105
+		$view = $this->addViewData($this->getView());
106 106
 
107
-		$view->priceData = $this->toArray( $view->item );
107
+		$view->priceData = $this->toArray($view->item);
108 108
 		$view->priceBody = '';
109 109
 
110
-		foreach( $this->getSubClients() as $client ) {
110
+		foreach ($this->getSubClients() as $client) {
111 111
 			$view->priceBody .= $client->get();
112 112
 		}
113 113
 
114
-		return $this->render( $view );
114
+		return $this->render($view);
115 115
 	}
116 116
 
117 117
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
 
125 125
 		try
126 126
 		{
127
-			$view->item = $this->fromArray( $view->item, $view->param( 'price', [] ) );
127
+			$view->item = $this->fromArray($view->item, $view->param('price', []));
128 128
 			$view->priceBody = '';
129 129
 
130
-			foreach( $this->getSubClients() as $client ) {
130
+			foreach ($this->getSubClients() as $client) {
131 131
 				$view->priceBody .= $client->save();
132 132
 			}
133 133
 
134 134
 			return;
135 135
 		}
136
-		catch( \Aimeos\MShop\Exception $e )
136
+		catch (\Aimeos\MShop\Exception $e)
137 137
 		{
138
-			$error = array( 'service-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
139
-			$view->errors = $view->get( 'errors', [] ) + $error;
140
-			$this->logException( $e );
138
+			$error = array('service-item-price' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
139
+			$view->errors = $view->get('errors', []) + $error;
140
+			$this->logException($e);
141 141
 		}
142
-		catch( \Exception $e )
142
+		catch (\Exception $e)
143 143
 		{
144
-			$error = array( 'service-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
145
-			$view->errors = $view->get( 'errors', [] ) + $error;
146
-			$this->logException( $e );
144
+			$error = array('service-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
145
+			$view->errors = $view->get('errors', []) + $error;
146
+			$this->logException($e);
147 147
 		}
148 148
 
149 149
 		throw new \Aimeos\Admin\JQAdm\Exception();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** admin/jqadm/service/price/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the service JQAdm client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see admin/jqadm/service/price/decorators/excludes
233 233
 		 * @see admin/jqadm/service/price/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'service/price/' . $type, $name );
235
+		return $this->createSubClient('service/price/' . $type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		 * @since 2016.01
277 277
 		 * @category Developer
278 278
 		 */
279
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/service/price/standard/subparts', [] );
279
+		return $this->getContext()->getConfig()->get('admin/jqadm/service/price/standard/subparts', []);
280 280
 	}
281 281
 
282 282
 
@@ -286,28 +286,28 @@  discard block
 block discarded – undo
286 286
 	 * @param \Aimeos\MW\View\Iface $view View object
287 287
 	 * @return \Aimeos\MW\View\Iface View object with assigned parameters
288 288
 	 */
289
-	protected function addViewData( \Aimeos\MW\View\Iface $view )
289
+	protected function addViewData(\Aimeos\MW\View\Iface $view)
290 290
 	{
291 291
 		$context = $this->getContext();
292 292
 
293
-		$priceTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'price/type' );
294
-		$listTypeManager = \Aimeos\MShop\Factory::createManager( $context, 'service/lists/type' );
295
-		$currencyManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' );
293
+		$priceTypeManager = \Aimeos\MShop\Factory::createManager($context, 'price/type');
294
+		$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'service/lists/type');
295
+		$currencyManager = \Aimeos\MShop\Factory::createManager($context, 'locale/currency');
296 296
 
297
-		$search = $priceTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
298
-		$search->setConditions( $search->compare( '==', 'price.type.domain', 'service' ) );
299
-		$search->setSortations( array( $search->sort( '+', 'price.type.label' ) ) );
297
+		$search = $priceTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
298
+		$search->setConditions($search->compare('==', 'price.type.domain', 'service'));
299
+		$search->setSortations(array($search->sort('+', 'price.type.label')));
300 300
 
301
-		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff );
302
-		$listSearch->setConditions( $listSearch->compare( '==', 'service.lists.type.domain', 'price' ) );
303
-		$listSearch->setSortations( array( $listSearch->sort( '+', 'service.lists.type.label' ) ) );
301
+		$listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff);
302
+		$listSearch->setConditions($listSearch->compare('==', 'service.lists.type.domain', 'price'));
303
+		$listSearch->setSortations(array($listSearch->sort('+', 'service.lists.type.label')));
304 304
 
305
-		$view->priceTypes = $priceTypeManager->searchItems( $search );
306
-		$view->priceListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) );
307
-		$view->priceCurrencies = $currencyManager->searchItems( $currencyManager->createSearch( true )->setSlice( 0, 0x7fffffff ) );
305
+		$view->priceTypes = $priceTypeManager->searchItems($search);
306
+		$view->priceListTypes = $this->sortType($listTypeManager->searchItems($listSearch));
307
+		$view->priceCurrencies = $currencyManager->searchItems($currencyManager->createSearch(true)->setSlice(0, 0x7fffffff));
308 308
 
309
-		if( $view->priceCurrencies === [] ) {
310
-			throw new \Aimeos\Admin\JQAdm\Exception( 'No currencies available. Please enable at least one currency' );
309
+		if ($view->priceCurrencies === []) {
310
+			throw new \Aimeos\Admin\JQAdm\Exception('No currencies available. Please enable at least one currency');
311 311
 		}
312 312
 
313 313
 		return $view;
@@ -320,46 +320,46 @@  discard block
 block discarded – undo
320 320
 	 * @param \Aimeos\MShop\Service\Item\Iface $item Service item object without referenced domain items
321 321
 	 * @param string[] $data Data array
322 322
 	 */
323
-	protected function fromArray( \Aimeos\MShop\Service\Item\Iface $item, array $data )
323
+	protected function fromArray(\Aimeos\MShop\Service\Item\Iface $item, array $data)
324 324
 	{
325 325
 		$context = $this->getContext();
326 326
 
327
-		$priceManager = \Aimeos\MShop\Factory::createManager( $context, 'price' );
328
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'service/lists' );
327
+		$priceManager = \Aimeos\MShop\Factory::createManager($context, 'price');
328
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'service/lists');
329 329
 
330
-		$listItems = $item->getListItems( 'price', null, null, false );
330
+		$listItems = $item->getListItems('price', null, null, false);
331 331
 
332 332
 
333
-		foreach( $data as $idx => $entry )
333
+		foreach ($data as $idx => $entry)
334 334
 		{
335
-			if( ( $listItem = $item->getListItem( 'price', $entry['service.lists.type'], $entry['price.id'] ) ) === null ) {
335
+			if (($listItem = $item->getListItem('price', $entry['service.lists.type'], $entry['price.id'])) === null) {
336 336
 				$listItem = $listManager->createItem();
337 337
 			}
338 338
 
339
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
339
+			if (($refItem = $listItem->getRefItem()) === null) {
340 340
 				$refItem = $priceManager->createItem();
341 341
 			}
342 342
 
343
-			$refItem->fromArray( $entry );
343
+			$refItem->fromArray($entry);
344 344
 			$conf = [];
345 345
 
346
-			foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key )
346
+			foreach ((array) $this->getValue($entry, 'config/key') as $num => $key)
347 347
 			{
348
-				if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) {
349
-					$conf[$key] = trim( $val );
348
+				if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) {
349
+					$conf[$key] = trim($val);
350 350
 				}
351 351
 			}
352 352
 
353
-			$listItem->fromArray( $entry );
354
-			$listItem->setPosition( $idx );
355
-			$listItem->setConfig( $conf );
353
+			$listItem->fromArray($entry);
354
+			$listItem->setPosition($idx);
355
+			$listItem->setConfig($conf);
356 356
 
357
-			$item->addListItem( 'price', $listItem, $refItem );
357
+			$item->addListItem('price', $listItem, $refItem);
358 358
 
359
-			unset( $listItems[$listItem->getId()] );
359
+			unset($listItems[$listItem->getId()]);
360 360
 		}
361 361
 
362
-		return $item->deleteListItems( $listItems, true );
362
+		return $item->deleteListItems($listItems, true);
363 363
 	}
364 364
 
365 365
 
@@ -370,20 +370,20 @@  discard block
 block discarded – undo
370 370
 	 * @param boolean $copy True if items should be copied, false if not
371 371
 	 * @return string[] Multi-dimensional associative list of item data
372 372
 	 */
373
-	protected function toArray( \Aimeos\MShop\Service\Item\Iface $item, $copy = false )
373
+	protected function toArray(\Aimeos\MShop\Service\Item\Iface $item, $copy = false)
374 374
 	{
375 375
 		$data = [];
376 376
 		$siteId = $this->getContext()->getLocale()->getSiteId();
377 377
 
378
-		foreach( $item->getListItems( 'price', null, null, false ) as $listItem )
378
+		foreach ($item->getListItems('price', null, null, false) as $listItem)
379 379
 		{
380
-			if( ( $refItem = $listItem->getRefItem() ) === null ) {
380
+			if (($refItem = $listItem->getRefItem()) === null) {
381 381
 				continue;
382 382
 			}
383 383
 
384
-			$list = $listItem->toArray( true ) + $refItem->toArray( true );
384
+			$list = $listItem->toArray(true) + $refItem->toArray(true);
385 385
 
386
-			if( $copy === true )
386
+			if ($copy === true)
387 387
 			{
388 388
 				$list['service.lists.siteid'] = $siteId;
389 389
 				$list['service.lists.id'] = '';
@@ -391,10 +391,10 @@  discard block
 block discarded – undo
391 391
 				$list['price.id'] = null;
392 392
 			}
393 393
 
394
-			$list['service.lists.datestart'] = str_replace( ' ', 'T', $list['service.lists.datestart'] );
395
-			$list['service.lists.dateend'] = str_replace( ' ', 'T', $list['service.lists.dateend'] );
394
+			$list['service.lists.datestart'] = str_replace(' ', 'T', $list['service.lists.datestart']);
395
+			$list['service.lists.dateend'] = str_replace(' ', 'T', $list['service.lists.dateend']);
396 396
 
397
-			foreach( $list['service.lists.config'] as $key => $val )
397
+			foreach ($list['service.lists.config'] as $key => $val)
398 398
 			{
399 399
 				$list['config']['key'][] = $key;
400 400
 				$list['config']['val'][] = $val;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
414 414
 	 * @return string HTML output
415 415
 	 */
416
-	protected function render( \Aimeos\MW\View\Iface $view )
416
+	protected function render(\Aimeos\MW\View\Iface $view)
417 417
 	{
418 418
 		/** admin/jqadm/service/price/template-item
419 419
 		 * Relative path to the HTML body template of the price subpart for services.
@@ -437,6 +437,6 @@  discard block
 block discarded – undo
437 437
 		$tplconf = 'admin/jqadm/service/price/template-item';
438 438
 		$default = 'service/item-price-standard.php';
439 439
 
440
-		return $view->render( $view->config( $tplconf, $default ) );
440
+		return $view->render($view->config($tplconf, $default));
441 441
 	}
442 442
 }
443 443
\ No newline at end of file
Please login to merge, or discard this patch.