@@ -161,7 +161,6 @@ |
||
161 | 161 | * |
162 | 162 | * You can add, remove or reorder the links in the navigation bar by |
163 | 163 | * setting a new list of client resource names. |
164 | - |
|
165 | 164 | * In the configuration files of extensions, you should only add entries using |
166 | 165 | * one of these lines: |
167 | 166 | * |
@@ -262,8 +262,11 @@ discard block |
||
262 | 262 | <?php foreach( $this->pageSiteList as $siteItem ) : ?> |
263 | 263 | <?php if( $siteItem->getId() === $this->pageSiteTree->getId() ) : ?> |
264 | 264 | <?php $siteFcn( $this->pageSiteTree ); ?> |
265 | - <?php else : ?> |
|
266 | - <?php $siteFcn( $siteItem ); ?> |
|
265 | + <?php else { |
|
266 | + : ?> |
|
267 | + <?php $siteFcn( $siteItem ); |
|
268 | +} |
|
269 | +?> |
|
267 | 270 | <?php endif; ?> |
268 | 271 | <?php endforeach; ?> |
269 | 272 | </ul> |
@@ -295,9 +298,12 @@ discard block |
||
295 | 298 | </li> |
296 | 299 | |
297 | 300 | <?php endif; ?> |
298 | - <?php else : ?> |
|
301 | + <?php else { |
|
302 | + : ?> |
|
299 | 303 | <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $navitem . '/groups', [] ) ) ) : ?> |
300 | - <?php $key = $this->config( 'admin/jqadm/resource/' . $navitem . '/key' ); ?> |
|
304 | + <?php $key = $this->config( 'admin/jqadm/resource/' . $navitem . '/key' ); |
|
305 | +} |
|
306 | +?> |
|
301 | 307 | |
302 | 308 | <li class="<?= $enc->attr( $navitem ); ?> <?= $this->param( 'resource', $navfirst ) === $navitem ? 'active' : '' ?>"> |
303 | 309 | <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, array( 'resource' => $navitem ) + $params, [], $config ) ); ?>" |
@@ -344,10 +350,13 @@ discard block |
||
344 | 350 | </li> |
345 | 351 | |
346 | 352 | <?php endif; ?> |
347 | - <?php else : ?> |
|
353 | + <?php else { |
|
354 | + : ?> |
|
348 | 355 | <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $navitem . '/groups', [] ) ) ) : ?> |
349 | 356 | |
350 | - <?php $key = $this->config( 'admin/jqadm/resource/' . $navitem . '/key' ); ?> |
|
357 | + <?php $key = $this->config( 'admin/jqadm/resource/' . $navitem . '/key' ); |
|
358 | +} |
|
359 | +?> |
|
351 | 360 | <li class="<?= $enc->attr( $navitem ); ?> <?= $this->param( 'resource', $navfirst ) === $navitem ? 'active' : '' ?>"> |
352 | 361 | <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, array( 'resource' => $navitem ) + $params, [], $config ) ); ?>" |
353 | 362 | title="<?= $enc->attr( sprintf( $title, $this->translate( 'admin', $navitem ), $key ) ); ?>" |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | $target = $this->request()->getTarget(); |
11 | -$searchTarget = $this->config( 'admin/jqadm/url/search/target' ); |
|
12 | -$cntl = $this->config( 'admin/jqadm/url/search/controller', 'Jqadm' ); |
|
13 | -$action = $this->config( 'admin/jqadm/url/search/action', 'search' ); |
|
14 | -$config = $this->config( 'admin/jqadm/url/search/config', [] ); |
|
11 | +$searchTarget = $this->config('admin/jqadm/url/search/target'); |
|
12 | +$cntl = $this->config('admin/jqadm/url/search/controller', 'Jqadm'); |
|
13 | +$action = $this->config('admin/jqadm/url/search/action', 'search'); |
|
14 | +$config = $this->config('admin/jqadm/url/search/config', []); |
|
15 | 15 | |
16 | 16 | |
17 | 17 | /** admin/jsonadm/url/options/target |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @see admin/jsonadm/url/options/action |
29 | 29 | * @see admin/jsonadm/url/options/config |
30 | 30 | */ |
31 | -$jsonTarget = $this->config( 'admin/jsonadm/url/options/target' ); |
|
31 | +$jsonTarget = $this->config('admin/jsonadm/url/options/target'); |
|
32 | 32 | |
33 | 33 | /** admin/jsonadm/url/options/controller |
34 | 34 | * Name of the controller whose action should be called |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @see admin/jsonadm/url/options/action |
45 | 45 | * @see admin/jsonadm/url/options/config |
46 | 46 | */ |
47 | -$jsonCntl = $this->config( 'admin/jsonadm/url/options/controller', 'Jsonadm' ); |
|
47 | +$jsonCntl = $this->config('admin/jsonadm/url/options/controller', 'Jsonadm'); |
|
48 | 48 | |
49 | 49 | /** admin/jsonadm/url/options/action |
50 | 50 | * Name of the action that should create the output |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @see admin/jsonadm/url/options/controller |
61 | 61 | * @see admin/jsonadm/url/options/config |
62 | 62 | */ |
63 | -$jsonAction = $this->config( 'admin/jsonadm/url/options/action', 'options' ); |
|
63 | +$jsonAction = $this->config('admin/jsonadm/url/options/action', 'options'); |
|
64 | 64 | |
65 | 65 | /** admin/jsonadm/url/options/config |
66 | 66 | * Associative list of configuration options used for generating the URL |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @see admin/jsonadm/url/options/controller |
83 | 83 | * @see admin/jsonadm/url/options/action |
84 | 84 | */ |
85 | -$jsonConfig = $this->config( 'admin/jsonadm/url/options/config', [] ); |
|
85 | +$jsonConfig = $this->config('admin/jsonadm/url/options/config', []); |
|
86 | 86 | |
87 | 87 | |
88 | 88 | /** admin/jqadm/navbar |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @category Developer |
107 | 107 | * @see admin/jqadm/navbar-limit |
108 | 108 | */ |
109 | -$navlist = $this->config( 'admin/jqadm/navbar', [] ); |
|
109 | +$navlist = $this->config('admin/jqadm/navbar', []); |
|
110 | 110 | |
111 | 111 | /** admin/jqadm/navbar-limit |
112 | 112 | * Number of JQAdm client links in the navigation bar shown by default |
@@ -122,26 +122,26 @@ discard block |
||
122 | 122 | * @category Developer |
123 | 123 | * @see admin/jqadm/navbar |
124 | 124 | */ |
125 | -$navlimit = $this->config( 'admin/jqadm/navbar-limit', 7 ); |
|
125 | +$navlimit = $this->config('admin/jqadm/navbar-limit', 7); |
|
126 | 126 | |
127 | 127 | |
128 | -$navfirst = reset( $navlist ); |
|
129 | -if( is_array( $navfirst ) ) { |
|
130 | - $navfirst = key( $navlist ); |
|
128 | +$navfirst = reset($navlist); |
|
129 | +if (is_array($navfirst)) { |
|
130 | + $navfirst = key($navlist); |
|
131 | 131 | } |
132 | 132 | |
133 | -$resource = $this->param( 'resource', 'dashboard' ); |
|
134 | -$site = $this->param( 'site', 'default' ); |
|
135 | -$lang = $this->param( 'lang' ); |
|
133 | +$resource = $this->param('resource', 'dashboard'); |
|
134 | +$site = $this->param('site', 'default'); |
|
135 | +$lang = $this->param('lang'); |
|
136 | 136 | |
137 | 137 | $params = ['resource' => $resource, 'site' => $site]; |
138 | 138 | $extParams = ['site' => $site]; |
139 | 139 | |
140 | -if( $lang ) { |
|
140 | +if ($lang) { |
|
141 | 141 | $params['lang'] = $extParams['lang'] = $lang; |
142 | 142 | } |
143 | 143 | |
144 | -$title = $this->translate( 'admin', '%1$s (Ctrl+Alt+%2$s)' ); |
|
144 | +$title = $this->translate('admin', '%1$s (Ctrl+Alt+%2$s)'); |
|
145 | 145 | |
146 | 146 | |
147 | 147 | /** admin/jqadm/partial/confirm |
@@ -211,82 +211,82 @@ discard block |
||
211 | 211 | */ |
212 | 212 | |
213 | 213 | |
214 | -$infoMsgs = $this->get( 'info', [] ); |
|
214 | +$infoMsgs = $this->get('info', []); |
|
215 | 215 | |
216 | -switch( $this->param( 'act' ) ) |
|
216 | +switch ($this->param('act')) |
|
217 | 217 | { |
218 | 218 | case 'save': |
219 | - $infoMsgs[] = $this->translate( 'admin', 'Item saved successfully' ); break; |
|
219 | + $infoMsgs[] = $this->translate('admin', 'Item saved successfully'); break; |
|
220 | 220 | case 'delete': |
221 | - $infoMsgs[] = $this->translate( 'admin', 'Item deleted successfully' ); break; |
|
221 | + $infoMsgs[] = $this->translate('admin', 'Item deleted successfully'); break; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
225 | 225 | ?> |
226 | -<div class="aimeos" lang="<?= $this->param( 'lang' ); ?>" data-url="<?= $enc->attr( $this->url( $jsonTarget, $jsonCntl, $jsonAction, array( 'site' => $site ), [], $jsonConfig ) ); ?>"> |
|
226 | +<div class="aimeos" lang="<?= $this->param('lang'); ?>" data-url="<?= $enc->attr($this->url($jsonTarget, $jsonCntl, $jsonAction, array('site' => $site), [], $jsonConfig)); ?>"> |
|
227 | 227 | |
228 | 228 | <nav class="main-sidebar"> |
229 | 229 | <div class="sidebar-wrapper"> |
230 | 230 | |
231 | - <a class="logo" target="_blank" href="https://aimeos.org/update/?type=<?= $this->get( 'aimeosType' ) ?>&version=<?= $this->get( 'aimeosVersion' ) ?>"> |
|
232 | - <img src="https://aimeos.org/check/?type=<?= $this->get( 'aimeosType' ) ?>&version=<?= $this->get( 'aimeosVersion' ) ?>&extensions=<?= $this->get( 'aimeosExtensions' ) ?>" alt="Aimeos update" title="Aimeos update"> |
|
231 | + <a class="logo" target="_blank" href="https://aimeos.org/update/?type=<?= $this->get('aimeosType') ?>&version=<?= $this->get('aimeosVersion') ?>"> |
|
232 | + <img src="https://aimeos.org/check/?type=<?= $this->get('aimeosType') ?>&version=<?= $this->get('aimeosVersion') ?>&extensions=<?= $this->get('aimeosExtensions') ?>" alt="Aimeos update" title="Aimeos update"> |
|
233 | 233 | </a> |
234 | 234 | |
235 | 235 | <ul class="sidebar-menu basic"> |
236 | 236 | |
237 | - <?php if( ( count( $this->get( 'pageSiteList', [] ) ) > 1 || $this->pageSiteTree->getChildren() !== [] || count( $this->get( 'pageSitePath', [] ) ) > 1 ) && $this->access( $this->config( 'admin/jqadm/resource/site/groups', [] ) ) ) : ?> |
|
237 | + <?php if ((count($this->get('pageSiteList', [])) > 1 || $this->pageSiteTree->getChildren() !== [] || count($this->get('pageSitePath', [])) > 1) && $this->access($this->config('admin/jqadm/resource/site/groups', []))) : ?> |
|
238 | 238 | <li class="site treeview"> |
239 | 239 | <a href="#"> |
240 | 240 | <i class="icon"></i> |
241 | - <span class="title"><?= $enc->html( $this->site()->label() ); ?></span> |
|
241 | + <span class="title"><?= $enc->html($this->site()->label()); ?></span> |
|
242 | 242 | </a> |
243 | 243 | <ul class="tree-menu"> |
244 | - <li class="menu-header"><strong><?= $enc->html( $this->translate( 'admin', 'Site' ) ); ?></strong></li> |
|
244 | + <li class="menu-header"><strong><?= $enc->html($this->translate('admin', 'Site')); ?></strong></li> |
|
245 | 245 | |
246 | - <?php $siteFcn = function( \Aimeos\MShop\Locale\Item\Site\Iface $site ) use ( &$siteFcn, $enc, $searchTarget, $cntl, $action, $params, $config ) { ?> |
|
246 | + <?php $siteFcn = function(\Aimeos\MShop\Locale\Item\Site\Iface $site) use (&$siteFcn, $enc, $searchTarget, $cntl, $action, $params, $config) { ?> |
|
247 | 247 | |
248 | - <li class="site-<?= $enc->attr( $site->getCode() ) ?>"> |
|
249 | - <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, array( 'site' => $site->getCode() ) + $params, [], $config ) ); ?>"> |
|
250 | - <span class="name"><?= $enc->html( $site->getLabel() ); ?></span> |
|
248 | + <li class="site-<?= $enc->attr($site->getCode()) ?>"> |
|
249 | + <a href="<?= $enc->attr($this->url($searchTarget, $cntl, $action, array('site' => $site->getCode()) + $params, [], $config)); ?>"> |
|
250 | + <span class="name"><?= $enc->html($site->getLabel()); ?></span> |
|
251 | 251 | </a> |
252 | 252 | |
253 | - <?php if( $site->getChildren() !== [] ) : ?> |
|
253 | + <?php if ($site->getChildren() !== []) : ?> |
|
254 | 254 | <ul class="menu-sub"> |
255 | - <?php foreach( $site->getChildren() as $site ) { $siteFcn( $site ); } ?> |
|
255 | + <?php foreach ($site->getChildren() as $site) { $siteFcn($site); } ?> |
|
256 | 256 | </ul> |
257 | 257 | <?php endif; ?> |
258 | 258 | </li> |
259 | 259 | |
260 | 260 | <?php }; ?> |
261 | 261 | |
262 | - <?php foreach( $this->pageSiteList as $siteItem ) : ?> |
|
263 | - <?php if( $siteItem->getId() === $this->pageSiteTree->getId() ) : ?> |
|
264 | - <?php $siteFcn( $this->pageSiteTree ); ?> |
|
262 | + <?php foreach ($this->pageSiteList as $siteItem) : ?> |
|
263 | + <?php if ($siteItem->getId() === $this->pageSiteTree->getId()) : ?> |
|
264 | + <?php $siteFcn($this->pageSiteTree); ?> |
|
265 | 265 | <?php else : ?> |
266 | - <?php $siteFcn( $siteItem ); ?> |
|
266 | + <?php $siteFcn($siteItem); ?> |
|
267 | 267 | <?php endif; ?> |
268 | 268 | <?php endforeach; ?> |
269 | 269 | </ul> |
270 | 270 | </li> |
271 | 271 | <?php endif; ?> |
272 | 272 | |
273 | - <?php foreach( array_splice( $navlist, 0, $navlimit ) as $nav => $navitem ) : ?> |
|
274 | - <?php if( is_array( $navitem ) ) : ?> |
|
275 | - <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $nav . '/groups', [] ) ) ) : ?> |
|
273 | + <?php foreach (array_splice($navlist, 0, $navlimit) as $nav => $navitem) : ?> |
|
274 | + <?php if (is_array($navitem)) : ?> |
|
275 | + <?php if ($this->access($this->config('admin/jqadm/resource/' . $nav . '/groups', []))) : ?> |
|
276 | 276 | |
277 | - <li class="treeview <?= $enc->attr( $nav ) ?> <?= strncmp( $this->param( 'resource' ), $nav, strlen( $nav ) ) ? '' : 'active' ?>"> |
|
277 | + <li class="treeview <?= $enc->attr($nav) ?> <?= strncmp($this->param('resource'), $nav, strlen($nav)) ? '' : 'active' ?>"> |
|
278 | 278 | <span> |
279 | 279 | <i class="icon"></i> |
280 | - <span class="title"><?= $enc->attr( $this->translate( 'admin', $nav ) ); ?></span> |
|
280 | + <span class="title"><?= $enc->attr($this->translate('admin', $nav)); ?></span> |
|
281 | 281 | </span> |
282 | 282 | <ul class="tree-menu"> |
283 | - <li class="menu-header"><strong><?= $enc->html( $this->translate( 'admin', $nav ) ); ?></strong></li> |
|
283 | + <li class="menu-header"><strong><?= $enc->html($this->translate('admin', $nav)); ?></strong></li> |
|
284 | 284 | |
285 | - <?php foreach( $navitem as $subresource ) : ?> |
|
286 | - <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $subresource . '/groups', [] ) ) ) : ?> |
|
287 | - <li class="<?= str_replace( '/', '-', $subresource); ?>"> |
|
288 | - <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, ['resource' => $subresource] + $params, [], $config ) ); ?>"> |
|
289 | - <span class="name"><?= $enc->html( $this->translate( 'admin', $subresource ) ); ?></span> |
|
285 | + <?php foreach ($navitem as $subresource) : ?> |
|
286 | + <?php if ($this->access($this->config('admin/jqadm/resource/' . $subresource . '/groups', []))) : ?> |
|
287 | + <li class="<?= str_replace('/', '-', $subresource); ?>"> |
|
288 | + <a href="<?= $enc->attr($this->url($searchTarget, $cntl, $action, ['resource' => $subresource] + $params, [], $config)); ?>"> |
|
289 | + <span class="name"><?= $enc->html($this->translate('admin', $subresource)); ?></span> |
|
290 | 290 | </a> |
291 | 291 | </li> |
292 | 292 | <?php endif; ?> |
@@ -296,15 +296,15 @@ discard block |
||
296 | 296 | |
297 | 297 | <?php endif; ?> |
298 | 298 | <?php else : ?> |
299 | - <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $navitem . '/groups', [] ) ) ) : ?> |
|
300 | - <?php $key = $this->config( 'admin/jqadm/resource/' . $navitem . '/key' ); ?> |
|
299 | + <?php if ($this->access($this->config('admin/jqadm/resource/' . $navitem . '/groups', []))) : ?> |
|
300 | + <?php $key = $this->config('admin/jqadm/resource/' . $navitem . '/key'); ?> |
|
301 | 301 | |
302 | - <li class="<?= $enc->attr( $navitem ); ?> <?= $this->param( 'resource', $navfirst ) === $navitem ? 'active' : '' ?>"> |
|
303 | - <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, array( 'resource' => $navitem ) + $params, [], $config ) ); ?>" |
|
304 | - title="<?= $enc->attr( sprintf( $title, $this->translate( 'admin', $navitem ), $key ) ); ?>" |
|
305 | - data-ctrlkey="<?= $enc->attr( strtolower( $key ) ); ?>"> |
|
302 | + <li class="<?= $enc->attr($navitem); ?> <?= $this->param('resource', $navfirst) === $navitem ? 'active' : '' ?>"> |
|
303 | + <a href="<?= $enc->attr($this->url($searchTarget, $cntl, $action, array('resource' => $navitem) + $params, [], $config)); ?>" |
|
304 | + title="<?= $enc->attr(sprintf($title, $this->translate('admin', $navitem), $key)); ?>" |
|
305 | + data-ctrlkey="<?= $enc->attr(strtolower($key)); ?>"> |
|
306 | 306 | <i class="icon"></i> |
307 | - <span class="title"><?= $enc->html( $this->translate( 'admin', $navitem ) ); ?></span> |
|
307 | + <span class="title"><?= $enc->html($this->translate('admin', $navitem)); ?></span> |
|
308 | 308 | </a> |
309 | 309 | </li> |
310 | 310 | |
@@ -318,23 +318,23 @@ discard block |
||
318 | 318 | |
319 | 319 | <ul class="sidebar-menu advanced"> |
320 | 320 | |
321 | - <?php foreach( $navlist as $nav => $navitem ) : ?> |
|
322 | - <?php if( is_array( $navitem ) ) : ?> |
|
323 | - <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $nav . '/groups', [] ) ) ) : ?> |
|
321 | + <?php foreach ($navlist as $nav => $navitem) : ?> |
|
322 | + <?php if (is_array($navitem)) : ?> |
|
323 | + <?php if ($this->access($this->config('admin/jqadm/resource/' . $nav . '/groups', []))) : ?> |
|
324 | 324 | |
325 | - <li class="treeview <?= $enc->attr( $nav ) ?> <?= strncmp( $this->param( 'resource' ), $nav, strlen( $nav ) ) ? '' : 'active' ?>"> |
|
325 | + <li class="treeview <?= $enc->attr($nav) ?> <?= strncmp($this->param('resource'), $nav, strlen($nav)) ? '' : 'active' ?>"> |
|
326 | 326 | <span> |
327 | 327 | <i class="icon"></i> |
328 | - <span class="title"><?= $enc->attr( $this->translate( 'admin', $nav ) ); ?></span> |
|
328 | + <span class="title"><?= $enc->attr($this->translate('admin', $nav)); ?></span> |
|
329 | 329 | </span> |
330 | 330 | <ul class="tree-menu"> |
331 | - <li class="menu-header"><strong><?= $enc->html( $this->translate( 'admin', $nav ) ); ?></strong></li> |
|
331 | + <li class="menu-header"><strong><?= $enc->html($this->translate('admin', $nav)); ?></strong></li> |
|
332 | 332 | |
333 | - <?php foreach( $navitem as $subresource ) : ?> |
|
334 | - <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $subresource . '/groups', [] ) ) ) : ?> |
|
335 | - <li class="<?= str_replace( '/', '-', $subresource); ?>"> |
|
336 | - <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, ['resource' => $subresource] + $params, [], $config ) ); ?>"> |
|
337 | - <span class="name"><?= $enc->html( $this->translate( 'admin', $subresource ) ); ?></span> |
|
333 | + <?php foreach ($navitem as $subresource) : ?> |
|
334 | + <?php if ($this->access($this->config('admin/jqadm/resource/' . $subresource . '/groups', []))) : ?> |
|
335 | + <li class="<?= str_replace('/', '-', $subresource); ?>"> |
|
336 | + <a href="<?= $enc->attr($this->url($searchTarget, $cntl, $action, ['resource' => $subresource] + $params, [], $config)); ?>"> |
|
337 | + <span class="name"><?= $enc->html($this->translate('admin', $subresource)); ?></span> |
|
338 | 338 | </a> |
339 | 339 | </li> |
340 | 340 | <?php endif; ?> |
@@ -345,15 +345,15 @@ discard block |
||
345 | 345 | |
346 | 346 | <?php endif; ?> |
347 | 347 | <?php else : ?> |
348 | - <?php if( $this->access( $this->config( 'admin/jqadm/resource/' . $navitem . '/groups', [] ) ) ) : ?> |
|
348 | + <?php if ($this->access($this->config('admin/jqadm/resource/' . $navitem . '/groups', []))) : ?> |
|
349 | 349 | |
350 | - <?php $key = $this->config( 'admin/jqadm/resource/' . $navitem . '/key' ); ?> |
|
351 | - <li class="<?= $enc->attr( $navitem ); ?> <?= $this->param( 'resource', $navfirst ) === $navitem ? 'active' : '' ?>"> |
|
352 | - <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, array( 'resource' => $navitem ) + $params, [], $config ) ); ?>" |
|
353 | - title="<?= $enc->attr( sprintf( $title, $this->translate( 'admin', $navitem ), $key ) ); ?>" |
|
354 | - data-ctrlkey="<?= $enc->attr( strtolower( $key ) ); ?>"> |
|
350 | + <?php $key = $this->config('admin/jqadm/resource/' . $navitem . '/key'); ?> |
|
351 | + <li class="<?= $enc->attr($navitem); ?> <?= $this->param('resource', $navfirst) === $navitem ? 'active' : '' ?>"> |
|
352 | + <a href="<?= $enc->attr($this->url($searchTarget, $cntl, $action, array('resource' => $navitem) + $params, [], $config)); ?>" |
|
353 | + title="<?= $enc->attr(sprintf($title, $this->translate('admin', $navitem), $key)); ?>" |
|
354 | + data-ctrlkey="<?= $enc->attr(strtolower($key)); ?>"> |
|
355 | 355 | <i class="icon"></i> |
356 | - <span class="title"><?= $enc->html( $this->translate( 'admin', $navitem ) ); ?></span> |
|
356 | + <span class="title"><?= $enc->html($this->translate('admin', $navitem)); ?></span> |
|
357 | 357 | </a> |
358 | 358 | </li> |
359 | 359 | |
@@ -361,18 +361,18 @@ discard block |
||
361 | 361 | <?php endif; ?> |
362 | 362 | <?php endforeach; ?> |
363 | 363 | |
364 | - <?php if( $this->access( $this->config( 'admin/jqadm/resource/language/groups', [] ) ) ) : ?> |
|
364 | + <?php if ($this->access($this->config('admin/jqadm/resource/language/groups', []))) : ?> |
|
365 | 365 | <li class="language treeview"> |
366 | 366 | <span> |
367 | 367 | <i class="icon"></i> |
368 | - <span class="title"><?= $enc->attr( $this->translate( 'language', $this->param( 'lang', $this->translate( 'admin', 'Language' ) ) ) ); ?></span> |
|
368 | + <span class="title"><?= $enc->attr($this->translate('language', $this->param('lang', $this->translate('admin', 'Language')))); ?></span> |
|
369 | 369 | </span> |
370 | 370 | <ul class="tree-menu"> |
371 | - <li class="menu-header"><strong><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></strong></li> |
|
372 | - <?php foreach( $this->get( 'pageI18nList', [] ) as $langid ) : ?> |
|
373 | - <li class="lang-<?= $enc->attr( $langid ) ?>"> |
|
374 | - <a href="<?= $enc->attr( $this->url( $searchTarget, $cntl, $action, array( 'lang' => $langid ) + $params, [], $config ) ); ?>"> |
|
375 | - <span class="name"><?= $enc->html( $this->translate( 'language', $langid ) ); ?> (<?= $langid ?>)</span> |
|
371 | + <li class="menu-header"><strong><?= $enc->html($this->translate('admin', 'Language')); ?></strong></li> |
|
372 | + <?php foreach ($this->get('pageI18nList', []) as $langid) : ?> |
|
373 | + <li class="lang-<?= $enc->attr($langid) ?>"> |
|
374 | + <a href="<?= $enc->attr($this->url($searchTarget, $cntl, $action, array('lang' => $langid) + $params, [], $config)); ?>"> |
|
375 | + <span class="name"><?= $enc->html($this->translate('language', $langid)); ?> (<?= $langid ?>)</span> |
|
376 | 376 | </a> |
377 | 377 | </li> |
378 | 378 | <?php endforeach; ?> |
@@ -386,20 +386,20 @@ discard block |
||
386 | 386 | |
387 | 387 | <main class="main-content"> |
388 | 388 | |
389 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/error', 'common/partials/error-standard' ), array( 'errors' => $this->get( 'errors', [] ) ) ); ?> |
|
390 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/info', 'common/partials/info-standard' ), array( 'info' => $infoMsgs ) ); ?> |
|
389 | + <?= $this->partial($this->config('admin/jqadm/partial/error', 'common/partials/error-standard'), array('errors' => $this->get('errors', []))); ?> |
|
390 | + <?= $this->partial($this->config('admin/jqadm/partial/info', 'common/partials/info-standard'), array('info' => $infoMsgs)); ?> |
|
391 | 391 | |
392 | - <?= $this->block()->get( 'jqadm_content' ); ?> |
|
392 | + <?= $this->block()->get('jqadm_content'); ?> |
|
393 | 393 | |
394 | 394 | </main> |
395 | 395 | |
396 | 396 | <footer class="main-footer"> |
397 | 397 | <a href="https://github.com/aimeos/ai-admin-jqadm/issues" target="_blank"> |
398 | - <?= $enc->html( $this->translate( 'admin', 'Bug or suggestion?' ) ); ?> |
|
398 | + <?= $enc->html($this->translate('admin', 'Bug or suggestion?')); ?> |
|
399 | 399 | </a> |
400 | 400 | </footer> |
401 | 401 | |
402 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/confirm', 'common/partials/confirm-standard' ) ); ?> |
|
403 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/problem', 'common/partials/problem-standard' ) ); ?> |
|
402 | + <?= $this->partial($this->config('admin/jqadm/partial/confirm', 'common/partials/confirm-standard')); ?> |
|
403 | + <?= $this->partial($this->config('admin/jqadm/partial/problem', 'common/partials/problem-standard')); ?> |
|
404 | 404 | |
405 | 405 | </div> |
@@ -374,8 +374,11 @@ |
||
374 | 374 | aria-label="<?= $enc->attr( $this->translate( 'admin', 'Show' ) ); ?>"> |
375 | 375 | <?= $enc->html( $refId ); ?> - <?= $enc->html( $refItem->getLabel() . ' (' . $refItem->getCode() . ')' ); ?> |
376 | 376 | </a> |
377 | - <?php else : ?> |
|
378 | - <?= $enc->html( $refId ); ?> (<?= $enc->html( $this->translate( 'admin', 'not available any more' ) ); ?>) |
|
377 | + <?php else { |
|
378 | + : ?> |
|
379 | + <?= $enc->html( $refId ); |
|
380 | +} |
|
381 | +?> (<?= $enc->html( $this->translate( 'admin', 'not available any more' ) ); ?>) |
|
379 | 382 | <?php endif; ?> |
380 | 383 | </td> |
381 | 384 | <?php endif; ?> |
@@ -5,28 +5,28 @@ discard block |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2017-2018 |
6 | 6 | */ |
7 | 7 | |
8 | -$selected = function( $key, $code ) { |
|
9 | - return ( $key == $code ? 'selected="selected"' : '' ); |
|
8 | +$selected = function($key, $code) { |
|
9 | + return ($key == $code ? 'selected="selected"' : ''); |
|
10 | 10 | }; |
11 | 11 | |
12 | 12 | |
13 | 13 | $enc = $this->encoder(); |
14 | -$params = $this->get( 'pageParams', [] ); |
|
14 | +$params = $this->get('pageParams', []); |
|
15 | 15 | |
16 | -$newTarget = $this->config( 'admin/jqadm/url/create/target' ); |
|
17 | -$newCntl = $this->config( 'admin/jqadm/url/create/controller', 'Jqadm' ); |
|
18 | -$newAction = $this->config( 'admin/jqadm/url/create/action', 'create' ); |
|
19 | -$newConfig = $this->config( 'admin/jqadm/url/create/config', [] ); |
|
16 | +$newTarget = $this->config('admin/jqadm/url/create/target'); |
|
17 | +$newCntl = $this->config('admin/jqadm/url/create/controller', 'Jqadm'); |
|
18 | +$newAction = $this->config('admin/jqadm/url/create/action', 'create'); |
|
19 | +$newConfig = $this->config('admin/jqadm/url/create/config', []); |
|
20 | 20 | |
21 | -$getTarget = $this->config( 'admin/jqadm/url/get/target' ); |
|
22 | -$getCntl = $this->config( 'admin/jqadm/url/get/controller', 'Jqadm' ); |
|
23 | -$getAction = $this->config( 'admin/jqadm/url/get/action', 'get' ); |
|
24 | -$getConfig = $this->config( 'admin/jqadm/url/get/config', [] ); |
|
21 | +$getTarget = $this->config('admin/jqadm/url/get/target'); |
|
22 | +$getCntl = $this->config('admin/jqadm/url/get/controller', 'Jqadm'); |
|
23 | +$getAction = $this->config('admin/jqadm/url/get/action', 'get'); |
|
24 | +$getConfig = $this->config('admin/jqadm/url/get/config', []); |
|
25 | 25 | |
26 | -$delTarget = $this->config( 'admin/jsonadm/url/target' ); |
|
27 | -$delCntl = $this->config( 'admin/jsonadm/url/controller', 'Jsonadm' ); |
|
28 | -$delAction = $this->config( 'admin/jsonadm/url/action', 'delete' ); |
|
29 | -$delConfig = $this->config( 'admin/jsonadm/url/config', [] ); |
|
26 | +$delTarget = $this->config('admin/jsonadm/url/target'); |
|
27 | +$delCntl = $this->config('admin/jsonadm/url/controller', 'Jsonadm'); |
|
28 | +$delAction = $this->config('admin/jsonadm/url/action', 'delete'); |
|
29 | +$delConfig = $this->config('admin/jsonadm/url/config', []); |
|
30 | 30 | |
31 | 31 | |
32 | 32 | /** admin/jqadm/supplier/product/fields |
@@ -44,21 +44,21 @@ discard block |
||
44 | 44 | * @category Developer |
45 | 45 | */ |
46 | 46 | $default = ['supplier.lists.position', 'supplier.lists.status', 'supplier.lists.type', 'supplier.lists.config', 'supplier.lists.refid']; |
47 | -$default = $this->config( 'admin/jqadm/supplier/product/fields', $default ); |
|
48 | -$fields = $this->session( 'aimeos/admin/jqadm/supplierproduct/fields', $default ); |
|
47 | +$default = $this->config('admin/jqadm/supplier/product/fields', $default); |
|
48 | +$fields = $this->session('aimeos/admin/jqadm/supplierproduct/fields', $default); |
|
49 | 49 | |
50 | -$listItems = $this->get( 'productListItems', [] ); |
|
51 | -$refItems = $this->get( 'productItems', [] ); |
|
50 | +$listItems = $this->get('productListItems', []); |
|
51 | +$refItems = $this->get('productItems', []); |
|
52 | 52 | |
53 | 53 | |
54 | 54 | ?> |
55 | 55 | <div id="product" class="item-product content-block tab-pane fade" role="tabpanel" aria-labelledby="product"> |
56 | 56 | |
57 | 57 | <?= $this->partial( |
58 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard' ), |
|
59 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'productTotal' ), |
|
58 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard'), |
|
59 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('productTotal'), |
|
60 | 60 | 'group' => 'sp', 'action' => 'get', 'fragment' => 'product', |
61 | - 'page' => $this->session( 'aimeos/admin/jqadm/supplierproduct/page', [] )] |
|
61 | + 'page' => $this->session('aimeos/admin/jqadm/supplierproduct/page', [])] |
|
62 | 62 | ); |
63 | 63 | ?> |
64 | 64 | |
@@ -66,39 +66,39 @@ discard block |
||
66 | 66 | <thead class="list-header"> |
67 | 67 | <tr> |
68 | 68 | <?= $this->partial( |
69 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard' ), [ |
|
70 | - 'fields' => $fields, 'params' => $params, 'tabindex' => $this->get( 'tabindex' ), |
|
69 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard'), [ |
|
70 | + 'fields' => $fields, 'params' => $params, 'tabindex' => $this->get('tabindex'), |
|
71 | 71 | 'group' => 'sp', 'action' => 'get', 'fragment' => 'product', |
72 | - 'sort' => $this->session( 'aimeos/admin/jqadm/supplierproduct/sort' ), |
|
72 | + 'sort' => $this->session('aimeos/admin/jqadm/supplierproduct/sort'), |
|
73 | 73 | 'data' => [ |
74 | - 'supplier.lists.position' => $this->translate( 'admin', 'Position' ), |
|
75 | - 'supplier.lists.status' => $this->translate( 'admin', 'Status' ), |
|
76 | - 'supplier.lists.type' => $this->translate( 'admin', 'Type' ), |
|
77 | - 'supplier.lists.config' => $this->translate( 'admin', 'Config' ), |
|
78 | - 'supplier.lists.datestart' => $this->translate( 'admin', 'Start date' ), |
|
79 | - 'supplier.lists.dateend' => $this->translate( 'admin', 'End date' ), |
|
80 | - 'supplier.lists.refid' => $this->translate( 'admin', 'Product ID' ), |
|
74 | + 'supplier.lists.position' => $this->translate('admin', 'Position'), |
|
75 | + 'supplier.lists.status' => $this->translate('admin', 'Status'), |
|
76 | + 'supplier.lists.type' => $this->translate('admin', 'Type'), |
|
77 | + 'supplier.lists.config' => $this->translate('admin', 'Config'), |
|
78 | + 'supplier.lists.datestart' => $this->translate('admin', 'Start date'), |
|
79 | + 'supplier.lists.dateend' => $this->translate('admin', 'End date'), |
|
80 | + 'supplier.lists.refid' => $this->translate('admin', 'Product ID'), |
|
81 | 81 | ] |
82 | 82 | ] ); |
83 | 83 | ?> |
84 | 84 | |
85 | 85 | <th class="actions"> |
86 | - <a class="btn fa act-add" href="#" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
87 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
88 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>"> |
|
86 | + <a class="btn fa act-add" href="#" tabindex="<?= $this->get('tabindex'); ?>" |
|
87 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
88 | + aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>"> |
|
89 | 89 | </a> |
90 | 90 | |
91 | 91 | <?= $this->partial( |
92 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard' ), [ |
|
93 | - 'fields' => $fields, 'group' => 'sp', 'tabindex' => $this->get( 'tabindex' ), |
|
92 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard'), [ |
|
93 | + 'fields' => $fields, 'group' => 'sp', 'tabindex' => $this->get('tabindex'), |
|
94 | 94 | 'data' => [ |
95 | - 'supplier.lists.position' => $this->translate( 'admin', 'Position' ), |
|
96 | - 'supplier.lists.status' => $this->translate( 'admin', 'Status' ), |
|
97 | - 'supplier.lists.type' => $this->translate( 'admin', 'Type' ), |
|
98 | - 'supplier.lists.config' => $this->translate( 'admin', 'Config' ), |
|
99 | - 'supplier.lists.datestart' => $this->translate( 'admin', 'Start date' ), |
|
100 | - 'supplier.lists.dateend' => $this->translate( 'admin', 'End date' ), |
|
101 | - 'supplier.lists.refid' => $this->translate( 'admin', 'Product' ), |
|
95 | + 'supplier.lists.position' => $this->translate('admin', 'Position'), |
|
96 | + 'supplier.lists.status' => $this->translate('admin', 'Status'), |
|
97 | + 'supplier.lists.type' => $this->translate('admin', 'Type'), |
|
98 | + 'supplier.lists.config' => $this->translate('admin', 'Config'), |
|
99 | + 'supplier.lists.datestart' => $this->translate('admin', 'Start date'), |
|
100 | + 'supplier.lists.dateend' => $this->translate('admin', 'End date'), |
|
101 | + 'supplier.lists.refid' => $this->translate('admin', 'Product'), |
|
102 | 102 | ] |
103 | 103 | ] ); |
104 | 104 | ?> |
@@ -107,18 +107,18 @@ discard block |
||
107 | 107 | </thead> |
108 | 108 | <tbody> |
109 | 109 | <?= $this->partial( |
110 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard' ), [ |
|
111 | - 'filter' => $this->session( 'aimeos/admin/jqadm/supplierproduct/filter', [] ), |
|
112 | - 'fields' => $fields, 'group' => 'sp', 'tabindex' => $this->get( 'tabindex' ), |
|
110 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard'), [ |
|
111 | + 'filter' => $this->session('aimeos/admin/jqadm/supplierproduct/filter', []), |
|
112 | + 'fields' => $fields, 'group' => 'sp', 'tabindex' => $this->get('tabindex'), |
|
113 | 113 | 'data' => [ |
114 | 114 | 'supplier.lists.position' => ['op' => '>=', 'type' => 'number'], |
115 | 115 | 'supplier.lists.status' => ['op' => '==', 'type' => 'select', 'val' => [ |
116 | - '1' => $this->translate( 'mshop/code', 'status:1' ), |
|
117 | - '0' => $this->translate( 'mshop/code', 'status:0' ), |
|
118 | - '-1' => $this->translate( 'mshop/code', 'status:-1' ), |
|
119 | - '-2' => $this->translate( 'mshop/code', 'status:-2' ), |
|
116 | + '1' => $this->translate('mshop/code', 'status:1'), |
|
117 | + '0' => $this->translate('mshop/code', 'status:0'), |
|
118 | + '-1' => $this->translate('mshop/code', 'status:-1'), |
|
119 | + '-2' => $this->translate('mshop/code', 'status:-2'), |
|
120 | 120 | ]], |
121 | - 'supplier.lists.type' => ['op' => '==', 'type' => 'select', 'val' => array_keys( $this->get( 'productListTypes', [] ) )], |
|
121 | + 'supplier.lists.type' => ['op' => '==', 'type' => 'select', 'val' => array_keys($this->get('productListTypes', []))], |
|
122 | 122 | 'supplier.lists.config' => ['op' => '~='], |
123 | 123 | 'supplier.lists.datestart' => ['op' => '>=', 'type' => 'datetime-local'], |
124 | 124 | 'supplier.lists.dateend' => ['op' => '>=', 'type' => 'datetime-local'], |
@@ -128,80 +128,80 @@ discard block |
||
128 | 128 | ?> |
129 | 129 | |
130 | 130 | <tr class="list-item-new prototype"> |
131 | - <td colspan="<?= count( $fields ); ?>"> |
|
131 | + <td colspan="<?= count($fields); ?>"> |
|
132 | 132 | <div class="content-block row"> |
133 | 133 | <div class="col-xl-6"> |
134 | 134 | <div class="form-group row mandatory"> |
135 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Product' ) ); ?></label> |
|
135 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Product')); ?></label> |
|
136 | 136 | <div class="col-sm-8"> |
137 | 137 | <input class="item-listid" type="hidden" disabled="disabled" |
138 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.id', '' ) ) ); ?>" /> |
|
138 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.id', ''))); ?>" /> |
|
139 | 139 | <input class="item-config" type="hidden" disabled="disabled" |
140 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.config', '' ) ) ); ?>" /> |
|
140 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.config', ''))); ?>" /> |
|
141 | 141 | <input class="item-label" type="hidden" disabled="disabled" |
142 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'product.label', '' ) ) ); ?>" /> |
|
143 | - <select class="combobox-prototype item-refid" tabindex="<?= $this->get( 'tabindex' ); ?>" disabled="disabled" |
|
144 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.refid', '' ) ) ); ?>"> |
|
142 | + name="<?= $enc->attr($this->formparam(array('product', 'product.label', ''))); ?>" /> |
|
143 | + <select class="combobox-prototype item-refid" tabindex="<?= $this->get('tabindex'); ?>" disabled="disabled" |
|
144 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.refid', ''))); ?>"> |
|
145 | 145 | </select> |
146 | 146 | </div> |
147 | 147 | </div> |
148 | 148 | <div class="form-group row mandatory"> |
149 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label> |
|
149 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label> |
|
150 | 150 | <div class="col-sm-8"> |
151 | - <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" disabled="disabled" |
|
152 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.status', '' ) ) ); ?>"> |
|
151 | + <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get('tabindex'); ?>" disabled="disabled" |
|
152 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.status', ''))); ?>"> |
|
153 | 153 | <option value=""> |
154 | - <?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?> |
|
154 | + <?= $enc->html($this->translate('admin', 'Please select')); ?> |
|
155 | 155 | </option> |
156 | 156 | <option value="1"> |
157 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?> |
|
157 | + <?= $enc->html($this->translate('mshop/code', 'status:1')); ?> |
|
158 | 158 | </option> |
159 | 159 | <option value="0"> |
160 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?> |
|
160 | + <?= $enc->html($this->translate('mshop/code', 'status:0')); ?> |
|
161 | 161 | </option> |
162 | 162 | <option value="-1"> |
163 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?> |
|
163 | + <?= $enc->html($this->translate('mshop/code', 'status:-1')); ?> |
|
164 | 164 | </option> |
165 | 165 | <option value="-2"> |
166 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?> |
|
166 | + <?= $enc->html($this->translate('mshop/code', 'status:-2')); ?> |
|
167 | 167 | </option> |
168 | 168 | </select> |
169 | 169 | </div> |
170 | 170 | </div> |
171 | 171 | <div class="form-group row mandatory"> |
172 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Type' ) ); ?></label> |
|
172 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Type')); ?></label> |
|
173 | 173 | <div class="col-sm-8"> |
174 | - <select class="form-control custom-select item-type" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" disabled="disabled" |
|
175 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.type', '' ) ) ); ?>" > |
|
174 | + <select class="form-control custom-select item-type" required="required" tabindex="<?= $this->get('tabindex'); ?>" disabled="disabled" |
|
175 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.type', ''))); ?>" > |
|
176 | 176 | <option value=""> |
177 | - <?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?> |
|
177 | + <?= $enc->html($this->translate('admin', 'Please select')); ?> |
|
178 | 178 | </option> |
179 | 179 | |
180 | - <?php foreach( $this->get( 'productListTypes', [] ) as $type => $item ) : ?> |
|
181 | - <option value="<?= $enc->attr( $type ); ?>"><?= $enc->html( $type ); ?></option> |
|
180 | + <?php foreach ($this->get('productListTypes', []) as $type => $item) : ?> |
|
181 | + <option value="<?= $enc->attr($type); ?>"><?= $enc->html($type); ?></option> |
|
182 | 182 | <?php endforeach; ?> |
183 | 183 | </select> |
184 | 184 | </div> |
185 | 185 | </div> |
186 | 186 | <div class="form-group row optional"> |
187 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Start date' ) ); ?></label> |
|
187 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Start date')); ?></label> |
|
188 | 188 | <div class="col-sm-8"> |
189 | - <input class="form-control item-datestart" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
190 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.datestart', '' ) ) ); ?>" disabled="disabled" /> |
|
189 | + <input class="form-control item-datestart" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
190 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.datestart', ''))); ?>" disabled="disabled" /> |
|
191 | 191 | </div> |
192 | 192 | </div> |
193 | 193 | <div class="form-group row optional"> |
194 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'End date' ) ); ?></label> |
|
194 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'End date')); ?></label> |
|
195 | 195 | <div class="col-sm-8"> |
196 | - <input class="form-control item-dateend" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
197 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.dateend', '' ) ) ); ?>" disabled="disabled" /> |
|
196 | + <input class="form-control item-dateend" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
197 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.dateend', ''))); ?>" disabled="disabled" /> |
|
198 | 198 | </div> |
199 | 199 | </div> |
200 | 200 | <div class="form-group row optional"> |
201 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Position' ) ); ?></label> |
|
201 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Position')); ?></label> |
|
202 | 202 | <div class="col-sm-8"> |
203 | - <input class="form-control item-position" type="number" step="1" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
204 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.position', '' ) ) ); ?>" disabled="disabled" /> |
|
203 | + <input class="form-control item-position" type="number" step="1" tabindex="<?= $this->get('tabindex'); ?>" |
|
204 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.position', ''))); ?>" disabled="disabled" /> |
|
205 | 205 | </div> |
206 | 206 | </div> |
207 | 207 | </div> |
@@ -210,17 +210,17 @@ discard block |
||
210 | 210 | <thead> |
211 | 211 | <tr> |
212 | 212 | <th> |
213 | - <span class="help"><?= $enc->html( $this->translate( 'admin', 'Option' ) ); ?></span> |
|
213 | + <span class="help"><?= $enc->html($this->translate('admin', 'Option')); ?></span> |
|
214 | 214 | <div class="form-text text-muted help-text"> |
215 | - <?= $enc->html( $this->translate( 'admin', 'Article specific configuration options, will be available as key/value pairs in the templates' ) ); ?> |
|
215 | + <?= $enc->html($this->translate('admin', 'Article specific configuration options, will be available as key/value pairs in the templates')); ?> |
|
216 | 216 | </div> |
217 | 217 | </th> |
218 | 218 | <th> |
219 | - <?= $enc->html( $this->translate( 'admin', 'Value' ) ); ?> |
|
219 | + <?= $enc->html($this->translate('admin', 'Value')); ?> |
|
220 | 220 | </th> |
221 | 221 | <th class="actions"> |
222 | - <div class="btn act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
223 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>"> |
|
222 | + <div class="btn act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
223 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>"> |
|
224 | 224 | </div> |
225 | 225 | </th> |
226 | 226 | </tr> |
@@ -228,16 +228,16 @@ discard block |
||
228 | 228 | <tbody> |
229 | 229 | <tr class="prototype"> |
230 | 230 | <td> |
231 | - <input type="text" class="config-key form-control" tabindex="<?= $this->get( 'tabindex' ); ?>" disabled="disabled" |
|
232 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'config', 'idx', 'key', '' ) ) ); ?>" /> |
|
231 | + <input type="text" class="config-key form-control" tabindex="<?= $this->get('tabindex'); ?>" disabled="disabled" |
|
232 | + name="<?= $enc->attr($this->formparam(array('product', 'config', 'idx', 'key', ''))); ?>" /> |
|
233 | 233 | </td> |
234 | 234 | <td> |
235 | - <input type="text" class="config-value form-control" tabindex="<?= $this->get( 'tabindex' ); ?>" disabled="disabled" |
|
236 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'config', 'idx', 'val', '' ) ) ); ?>" /> |
|
235 | + <input type="text" class="config-value form-control" tabindex="<?= $this->get('tabindex'); ?>" disabled="disabled" |
|
236 | + name="<?= $enc->attr($this->formparam(array('product', 'config', 'idx', 'val', ''))); ?>" /> |
|
237 | 237 | </td> |
238 | 238 | <td class="actions"> |
239 | - <div class="btn act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
240 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>"> |
|
239 | + <div class="btn act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
240 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>"> |
|
241 | 241 | </div> |
242 | 242 | </td> |
243 | 243 | </tr> |
@@ -247,79 +247,79 @@ discard block |
||
247 | 247 | </div> |
248 | 248 | </td> |
249 | 249 | <td class="actions"> |
250 | - <a class="btn fa act-close" href="#" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
251 | - title="<?= $enc->attr( $this->translate( 'admin', 'Close') ); ?>" |
|
252 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Close' ) ); ?>"> |
|
250 | + <a class="btn fa act-close" href="#" tabindex="<?= $this->get('tabindex'); ?>" |
|
251 | + title="<?= $enc->attr($this->translate('admin', 'Close')); ?>" |
|
252 | + aria-label="<?= $enc->attr($this->translate('admin', 'Close')); ?>"> |
|
253 | 253 | </a> |
254 | 254 | </td> |
255 | 255 | </tr> |
256 | 256 | |
257 | - <?php foreach( $this->get( 'productData/supplier.lists.id', [] ) as $idx => $listId ) : ?> |
|
258 | - <?php $siteId = $this->get( 'productData/supplier.lists.siteid/' . $idx ); ?> |
|
259 | - <?php $refId = $this->get( 'productData/supplier.lists.refid/' . $idx ); ?> |
|
257 | + <?php foreach ($this->get('productData/supplier.lists.id', []) as $idx => $listId) : ?> |
|
258 | + <?php $siteId = $this->get('productData/supplier.lists.siteid/' . $idx); ?> |
|
259 | + <?php $refId = $this->get('productData/supplier.lists.refid/' . $idx); ?> |
|
260 | 260 | |
261 | - <tr class="list-item <?= $this->site()->readonly( $siteId ); ?>"> |
|
262 | - <?php if( in_array( 'supplier.lists.position', $fields ) ) : ?> |
|
261 | + <tr class="list-item <?= $this->site()->readonly($siteId); ?>"> |
|
262 | + <?php if (in_array('supplier.lists.position', $fields)) : ?> |
|
263 | 263 | <td class="supplier-lists-position"> |
264 | - <input class="form-control item-position" type="number" step="1" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
265 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.position', '' ) ) ); ?>" |
|
266 | - value="<?= $enc->attr( $this->get( 'productData/supplier.lists.position/' . $idx ) ); ?>" |
|
267 | - <?= $this->site()->readonly( $siteId ); ?> disabled="disabled" /> |
|
264 | + <input class="form-control item-position" type="number" step="1" tabindex="<?= $this->get('tabindex'); ?>" |
|
265 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.position', ''))); ?>" |
|
266 | + value="<?= $enc->attr($this->get('productData/supplier.lists.position/' . $idx)); ?>" |
|
267 | + <?= $this->site()->readonly($siteId); ?> disabled="disabled" /> |
|
268 | 268 | </td> |
269 | 269 | <?php endif; ?> |
270 | - <?php if( in_array( 'supplier.lists.status', $fields ) ) : ?> |
|
270 | + <?php if (in_array('supplier.lists.status', $fields)) : ?> |
|
271 | 271 | <td class="supplier-lists-status"> |
272 | - <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
273 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.status', '' ) ) ); ?>" |
|
274 | - <?= $this->site()->readonly( $siteId ); ?> disabled="disabled" > |
|
272 | + <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
273 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.status', ''))); ?>" |
|
274 | + <?= $this->site()->readonly($siteId); ?> disabled="disabled" > |
|
275 | 275 | <option value=""> |
276 | - <?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?> |
|
276 | + <?= $enc->html($this->translate('admin', 'Please select')); ?> |
|
277 | 277 | </option> |
278 | - <option value="1" <?= $selected( $this->get( 'productData/supplier.lists.status/' . $idx, 1 ), 1 ); ?> > |
|
279 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?> |
|
278 | + <option value="1" <?= $selected($this->get('productData/supplier.lists.status/' . $idx, 1), 1); ?> > |
|
279 | + <?= $enc->html($this->translate('mshop/code', 'status:1')); ?> |
|
280 | 280 | </option> |
281 | - <option value="0" <?= $selected( $this->get( 'productData/supplier.lists.status/' . $idx, 1 ), 0 ); ?> > |
|
282 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?> |
|
281 | + <option value="0" <?= $selected($this->get('productData/supplier.lists.status/' . $idx, 1), 0); ?> > |
|
282 | + <?= $enc->html($this->translate('mshop/code', 'status:0')); ?> |
|
283 | 283 | </option> |
284 | - <option value="-1" <?= $selected( $this->get( 'productData/supplier.lists.status/' . $idx, 1 ), -1 ); ?> > |
|
285 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?> |
|
284 | + <option value="-1" <?= $selected($this->get('productData/supplier.lists.status/' . $idx, 1), -1); ?> > |
|
285 | + <?= $enc->html($this->translate('mshop/code', 'status:-1')); ?> |
|
286 | 286 | </option> |
287 | - <option value="-2" <?= $selected( $this->get( 'productData/supplier.lists.status/' . $idx, 1 ), -2 ); ?> > |
|
288 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?> |
|
287 | + <option value="-2" <?= $selected($this->get('productData/supplier.lists.status/' . $idx, 1), -2); ?> > |
|
288 | + <?= $enc->html($this->translate('mshop/code', 'status:-2')); ?> |
|
289 | 289 | </option> |
290 | 290 | </select> |
291 | 291 | </td> |
292 | 292 | <?php endif; ?> |
293 | - <?php if( in_array( 'supplier.lists.type', $fields ) ) : ?> |
|
293 | + <?php if (in_array('supplier.lists.type', $fields)) : ?> |
|
294 | 294 | <td class="supplier-lists-type"> |
295 | - <select class="form-control custom-select item-type" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
296 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.type', '' ) ) ); ?>" |
|
297 | - <?= $this->site()->readonly( $siteId ); ?> disabled="disabled" > |
|
295 | + <select class="form-control custom-select item-type" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
296 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.type', ''))); ?>" |
|
297 | + <?= $this->site()->readonly($siteId); ?> disabled="disabled" > |
|
298 | 298 | <option value=""> |
299 | - <?= $enc->html( $this->translate( 'admin', 'Please select' ) ); ?> |
|
299 | + <?= $enc->html($this->translate('admin', 'Please select')); ?> |
|
300 | 300 | </option> |
301 | 301 | |
302 | - <?php foreach( $this->get( 'productListTypes', [] ) as $type => $item ) : ?> |
|
303 | - <option value="<?= $enc->attr( $type ); ?>" <?= $selected( $this->get( 'productData/supplier.lists.type/' . $idx ), $type ); ?> > |
|
304 | - <?= $enc->html( $type ); ?> |
|
302 | + <?php foreach ($this->get('productListTypes', []) as $type => $item) : ?> |
|
303 | + <option value="<?= $enc->attr($type); ?>" <?= $selected($this->get('productData/supplier.lists.type/' . $idx), $type); ?> > |
|
304 | + <?= $enc->html($type); ?> |
|
305 | 305 | </option> |
306 | 306 | <?php endforeach; ?> |
307 | 307 | </select> |
308 | 308 | </td> |
309 | 309 | <?php endif; ?> |
310 | - <?php if( in_array( 'supplier.lists.config', $fields ) ) : ?> |
|
310 | + <?php if (in_array('supplier.lists.config', $fields)) : ?> |
|
311 | 311 | <td class="supplier-lists-config item-config"> |
312 | 312 | <div class="config-type config-type-map"> |
313 | - <input type="text" class="config-value form-control" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
314 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.config', '' ) ) ); ?>" |
|
315 | - value="<?= $enc->attr( json_encode( $this->get( 'productData/supplier.lists.config/' . $idx ) ) ); ?>" |
|
316 | - <?= $this->site()->readonly( $siteId ); ?> disabled="disabled" /> |
|
313 | + <input type="text" class="config-value form-control" tabindex="<?= $this->get('tabindex'); ?>" |
|
314 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.config', ''))); ?>" |
|
315 | + value="<?= $enc->attr(json_encode($this->get('productData/supplier.lists.config/' . $idx))); ?>" |
|
316 | + <?= $this->site()->readonly($siteId); ?> disabled="disabled" /> |
|
317 | 317 | |
318 | 318 | <table class="table table-striped config-map-table"> |
319 | 319 | <tr class="config-map-row prototype-map"> |
320 | 320 | <td class="config-map-actions"> |
321 | 321 | <div class="btn act-delete fa" tabindex="1" |
322 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>"> |
|
322 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>"> |
|
323 | 323 | </div> |
324 | 324 | </td> |
325 | 325 | <td class="config-map-row-key"> |
@@ -332,12 +332,12 @@ discard block |
||
332 | 332 | <tr class="config-map-actions"> |
333 | 333 | <td class="config-map-action-add"> |
334 | 334 | <div class="btn act-add fa" tabindex="1" |
335 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry') ); ?>"> |
|
335 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry')); ?>"> |
|
336 | 336 | </div> |
337 | 337 | </td> |
338 | 338 | <td class="config-map-action-update" colspan="2"> |
339 | 339 | <div class="btn btn-primary act-update" tabindex="1"> |
340 | - <?= $enc->attr( $this->translate( 'admin', 'OK') ); ?> |
|
340 | + <?= $enc->attr($this->translate('admin', 'OK')); ?> |
|
341 | 341 | </div> |
342 | 342 | </td> |
343 | 343 | </tr> |
@@ -345,55 +345,55 @@ discard block |
||
345 | 345 | </div> |
346 | 346 | </td> |
347 | 347 | <?php endif; ?> |
348 | - <?php if( in_array( 'supplier.lists.datestart', $fields ) ) : ?> |
|
348 | + <?php if (in_array('supplier.lists.datestart', $fields)) : ?> |
|
349 | 349 | <td class="supplier-lists-datestart"> |
350 | - <input class="form-control item-datestart" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
351 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.datestart', '' ) ) ); ?>" |
|
352 | - value="<?= $enc->attr( str_replace( ' ', 'T', $this->get( 'productData/supplier.lists.datestart/' . $idx ) ) ); ?>" |
|
353 | - <?= $this->site()->readonly( $siteId ); ?> disabled="disabled" /> |
|
350 | + <input class="form-control item-datestart" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
351 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.datestart', ''))); ?>" |
|
352 | + value="<?= $enc->attr(str_replace(' ', 'T', $this->get('productData/supplier.lists.datestart/' . $idx))); ?>" |
|
353 | + <?= $this->site()->readonly($siteId); ?> disabled="disabled" /> |
|
354 | 354 | </td> |
355 | 355 | <?php endif; ?> |
356 | - <?php if( in_array( 'supplier.lists.dateend', $fields ) ) : ?> |
|
356 | + <?php if (in_array('supplier.lists.dateend', $fields)) : ?> |
|
357 | 357 | <td class="supplier-lists-dateend"> |
358 | - <input class="form-control item-dateend" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
359 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.dateend', '' ) ) ); ?>" |
|
360 | - value="<?= $enc->attr( str_replace( ' ', 'T', $this->get( 'productData/supplier.lists.dateend/' . $idx ) ) ); ?>" |
|
361 | - <?= $this->site()->readonly( $siteId ); ?> disabled="disabled" /> |
|
358 | + <input class="form-control item-dateend" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
359 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.dateend', ''))); ?>" |
|
360 | + value="<?= $enc->attr(str_replace(' ', 'T', $this->get('productData/supplier.lists.dateend/' . $idx))); ?>" |
|
361 | + <?= $this->site()->readonly($siteId); ?> disabled="disabled" /> |
|
362 | 362 | </td> |
363 | 363 | <?php endif; ?> |
364 | 364 | |
365 | - <?php $refItem = ( isset( $refItems[$refId] ) ? $refItems[$refId] : null ); ?> |
|
365 | + <?php $refItem = (isset($refItems[$refId]) ? $refItems[$refId] : null); ?> |
|
366 | 366 | |
367 | - <?php if( in_array( 'supplier.lists.refid', $fields ) ) : ?> |
|
367 | + <?php if (in_array('supplier.lists.refid', $fields)) : ?> |
|
368 | 368 | <td class="supplier-lists-refid"> |
369 | 369 | <input class="form-control item-refid" type="hidden" |
370 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.refid', '' ) ) ); ?>" |
|
371 | - value="<?= $enc->attr( $refId ); ?>" disabled="disabled" /> |
|
372 | - <?php if( $refItem ) : ?> |
|
373 | - <a class="btn act-view fa item-refid" tabindex="<?= $this->get( 'tabindex' ); ?>" target="_blank" |
|
374 | - href="<?= $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['resource' => 'product', 'id' => $refId] + $params, [], $getConfig ) ); ?>" |
|
375 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show entry') ); ?>" |
|
376 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Show' ) ); ?>"> |
|
377 | - <?= $enc->html( $refId ); ?> - <?= $enc->html( $refItem->getLabel() . ' (' . $refItem->getCode() . ')' ); ?> |
|
370 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.refid', ''))); ?>" |
|
371 | + value="<?= $enc->attr($refId); ?>" disabled="disabled" /> |
|
372 | + <?php if ($refItem) : ?> |
|
373 | + <a class="btn act-view fa item-refid" tabindex="<?= $this->get('tabindex'); ?>" target="_blank" |
|
374 | + href="<?= $enc->attr($this->url($getTarget, $getCntl, $getAction, ['resource' => 'product', 'id' => $refId] + $params, [], $getConfig)); ?>" |
|
375 | + title="<?= $enc->attr($this->translate('admin', 'Show entry')); ?>" |
|
376 | + aria-label="<?= $enc->attr($this->translate('admin', 'Show')); ?>"> |
|
377 | + <?= $enc->html($refId); ?> - <?= $enc->html($refItem->getLabel() . ' (' . $refItem->getCode() . ')'); ?> |
|
378 | 378 | </a> |
379 | 379 | <?php else : ?> |
380 | - <?= $enc->html( $refId ); ?> (<?= $enc->html( $this->translate( 'admin', 'not available any more' ) ); ?>) |
|
380 | + <?= $enc->html($refId); ?> (<?= $enc->html($this->translate('admin', 'not available any more')); ?>) |
|
381 | 381 | <?php endif; ?> |
382 | 382 | </td> |
383 | 383 | <?php endif; ?> |
384 | 384 | |
385 | 385 | <td class="actions"> |
386 | - <input type="hidden" value="<?= $enc->attr( $listId ); ?>" disabled="disabled" |
|
387 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.id', '' ) ) ); ?>" /> |
|
386 | + <input type="hidden" value="<?= $enc->attr($listId); ?>" disabled="disabled" |
|
387 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.id', ''))); ?>" /> |
|
388 | 388 | |
389 | - <?php if( !$this->site()->readonly( $siteId ) ) : ?> |
|
390 | - <a class="btn act-edit fa" tabindex="<?= $this->get( 'tabindex' ); ?>" href="#" |
|
391 | - title="<?= $enc->attr( $this->translate( 'admin', 'Edit this entry') ); ?>" |
|
392 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Edit' ) ); ?>"></a> |
|
393 | - <a class="btn act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
394 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'supplier/lists', 'id' => $listId] + $params, [], $delConfig ) ); ?>" |
|
395 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
396 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
389 | + <?php if (!$this->site()->readonly($siteId)) : ?> |
|
390 | + <a class="btn act-edit fa" tabindex="<?= $this->get('tabindex'); ?>" href="#" |
|
391 | + title="<?= $enc->attr($this->translate('admin', 'Edit this entry')); ?>" |
|
392 | + aria-label="<?= $enc->attr($this->translate('admin', 'Edit')); ?>"></a> |
|
393 | + <a class="btn act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
394 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'supplier/lists', 'id' => $listId] + $params, [], $delConfig)); ?>" |
|
395 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
396 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
397 | 397 | <?php endif; ?> |
398 | 398 | </td> |
399 | 399 | </tr> |
@@ -402,17 +402,17 @@ discard block |
||
402 | 402 | </tbody> |
403 | 403 | </table> |
404 | 404 | |
405 | - <?php if( $this->get( 'productData', [] ) === [] ) : ?> |
|
406 | - <div class="noitems"><?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?></div> |
|
405 | + <?php if ($this->get('productData', []) === []) : ?> |
|
406 | + <div class="noitems"><?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?></div> |
|
407 | 407 | <?php endif; ?> |
408 | 408 | |
409 | 409 | <?= $this->partial( |
410 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard' ), |
|
411 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'productTotal' ), |
|
410 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard'), |
|
411 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('productTotal'), |
|
412 | 412 | 'group' => 'sp', 'action' => 'get', 'fragment' => 'product', |
413 | - 'page' =>$this->session( 'aimeos/admin/jqadm/supplierproduct/page', [] )] |
|
413 | + 'page' =>$this->session('aimeos/admin/jqadm/supplierproduct/page', [])] |
|
414 | 414 | ); |
415 | 415 | ?> |
416 | 416 | |
417 | 417 | </div> |
418 | -<?= $this->get( 'productBody' ); ?> |
|
418 | +<?= $this->get('productBody'); ?> |
@@ -6,10 +6,10 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | $enc = $this->encoder(); |
9 | -$currencies = array_keys( $this->get( 'orderCurrencyItems', [] ) ); |
|
9 | +$currencies = array_keys($this->get('orderCurrencyItems', [])); |
|
10 | 10 | |
11 | 11 | |
12 | 12 | ?> |
13 | -<div class="dashboard-order row" data-currencies="<?= $enc->attr( json_encode( $currencies ) ) ?>"> |
|
14 | - <?= $this->get( 'orderBody' ); ?> |
|
13 | +<div class="dashboard-order row" data-currencies="<?= $enc->attr(json_encode($currencies)) ?>"> |
|
14 | + <?= $this->get('orderBody'); ?> |
|
15 | 15 | </div> |
@@ -92,14 +92,12 @@ discard block |
||
92 | 92 | $view->tabindex = ++$idx + 1; |
93 | 93 | $view->itemBody .= $client->copy(); |
94 | 94 | } |
95 | - } |
|
96 | - catch( \Aimeos\MShop\Exception $e ) |
|
95 | + } catch( \Aimeos\MShop\Exception $e ) |
|
97 | 96 | { |
98 | 97 | $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
99 | 98 | $view->errors = $view->get( 'errors', [] ) + $error; |
100 | 99 | $this->logException( $e ); |
101 | - } |
|
102 | - catch( \Exception $e ) |
|
100 | + } catch( \Exception $e ) |
|
103 | 101 | { |
104 | 102 | $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
105 | 103 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -144,14 +142,12 @@ discard block |
||
144 | 142 | $view->tabindex = ++$idx + 1; |
145 | 143 | $view->itemBody .= $client->create(); |
146 | 144 | } |
147 | - } |
|
148 | - catch( \Aimeos\MShop\Exception $e ) |
|
145 | + } catch( \Aimeos\MShop\Exception $e ) |
|
149 | 146 | { |
150 | 147 | $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
151 | 148 | $view->errors = $view->get( 'errors', [] ) + $error; |
152 | 149 | $this->logException( $e ); |
153 | - } |
|
154 | - catch( \Exception $e ) |
|
150 | + } catch( \Exception $e ) |
|
155 | 151 | { |
156 | 152 | $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
157 | 153 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -192,14 +188,12 @@ discard block |
||
192 | 188 | |
193 | 189 | $this->nextAction( $view, 'search', 'plugin', null, 'delete' ); |
194 | 190 | return; |
195 | - } |
|
196 | - catch( \Aimeos\MShop\Exception $e ) |
|
191 | + } catch( \Aimeos\MShop\Exception $e ) |
|
197 | 192 | { |
198 | 193 | $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
199 | 194 | $view->errors = $view->get( 'errors', [] ) + $error; |
200 | 195 | $this->logException( $e ); |
201 | - } |
|
202 | - catch( \Exception $e ) |
|
196 | + } catch( \Exception $e ) |
|
203 | 197 | { |
204 | 198 | $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
205 | 199 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -244,14 +238,12 @@ discard block |
||
244 | 238 | $view->tabindex = ++$idx + 1; |
245 | 239 | $view->itemBody .= $client->get(); |
246 | 240 | } |
247 | - } |
|
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
241 | + } catch( \Aimeos\MShop\Exception $e ) |
|
249 | 242 | { |
250 | 243 | $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
251 | 244 | $view->errors = $view->get( 'errors', [] ) + $error; |
252 | 245 | $this->logException( $e ); |
253 | - } |
|
254 | - catch( \Exception $e ) |
|
246 | + } catch( \Exception $e ) |
|
255 | 247 | { |
256 | 248 | $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
257 | 249 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -288,18 +280,15 @@ discard block |
||
288 | 280 | |
289 | 281 | $this->nextAction( $view, $view->param( 'next' ), 'plugin', $view->item->getId(), 'save' ); |
290 | 282 | return; |
291 | - } |
|
292 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
283 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
293 | 284 | { |
294 | 285 | // fall through to create |
295 | - } |
|
296 | - catch( \Aimeos\MShop\Exception $e ) |
|
286 | + } catch( \Aimeos\MShop\Exception $e ) |
|
297 | 287 | { |
298 | 288 | $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
299 | 289 | $view->errors = $view->get( 'errors', [] ) + $error; |
300 | 290 | $this->logException( $e ); |
301 | - } |
|
302 | - catch( \Exception $e ) |
|
291 | + } catch( \Exception $e ) |
|
303 | 292 | { |
304 | 293 | $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
305 | 294 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -342,14 +331,12 @@ discard block |
||
342 | 331 | foreach( $this->getSubClients() as $client ) { |
343 | 332 | $view->itemBody .= $client->search(); |
344 | 333 | } |
345 | - } |
|
346 | - catch( \Aimeos\MShop\Exception $e ) |
|
334 | + } catch( \Aimeos\MShop\Exception $e ) |
|
347 | 335 | { |
348 | 336 | $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
349 | 337 | $view->errors = $view->get( 'errors', [] ) + $error; |
350 | 338 | $this->logException( $e ); |
351 | - } |
|
352 | - catch( \Exception $e ) |
|
339 | + } catch( \Exception $e ) |
|
353 | 340 | { |
354 | 341 | $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
355 | 342 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -522,7 +522,7 @@ |
||
522 | 522 | /** |
523 | 523 | * Returns the available plugin type items |
524 | 524 | * |
525 | - * @return array List of item implementing \Aimeos\MShop\Common\Type\Iface |
|
525 | + * @return \Aimeos\MShop\Common\Item\Type\Iface[] List of item implementing \Aimeos\MShop\Common\Type\Iface |
|
526 | 526 | */ |
527 | 527 | protected function getTypeItems() |
528 | 528 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Plugin; |
12 | 12 | |
13 | -sprintf( 'plugin' ); // for translation |
|
13 | +sprintf('plugin'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,41 +35,41 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'plugin' ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'plugin'); |
|
43 | 43 | |
44 | - $view->item = $manager->getItem( $id ); |
|
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
44 | + $view->item = $manager->getItem($id); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemProviders = $this->getProviderNames(); |
48 | 48 | $view->itemDecorators = $this->getDecoratorNames(); |
49 | - $view->itemAttributes = $this->getConfigAttributes( $view->item ); |
|
49 | + $view->itemAttributes = $this->getConfigAttributes($view->item); |
|
50 | 50 | $view->itemTypes = $this->getTypeItems(); |
51 | 51 | $view->itemBody = ''; |
52 | 52 | |
53 | - foreach( $this->getSubClients() as $idx => $client ) |
|
53 | + foreach ($this->getSubClients() as $idx => $client) |
|
54 | 54 | { |
55 | 55 | $view->tabindex = ++$idx + 1; |
56 | 56 | $view->itemBody .= $client->copy(); |
57 | 57 | } |
58 | 58 | } |
59 | - catch( \Aimeos\MShop\Exception $e ) |
|
59 | + catch (\Aimeos\MShop\Exception $e) |
|
60 | 60 | { |
61 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
62 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
63 | - $this->logException( $e ); |
|
61 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
62 | + $view->errors = $view->get('errors', []) + $error; |
|
63 | + $this->logException($e); |
|
64 | 64 | } |
65 | - catch( \Exception $e ) |
|
65 | + catch (\Exception $e) |
|
66 | 66 | { |
67 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
68 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
69 | - $this->logException( $e ); |
|
67 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
68 | + $view->errors = $view->get('errors', []) + $error; |
|
69 | + $this->logException($e); |
|
70 | 70 | } |
71 | 71 | |
72 | - return $this->render( $view ); |
|
72 | + return $this->render($view); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | |
86 | 86 | try |
87 | 87 | { |
88 | - $data = $view->param( 'item', [] ); |
|
88 | + $data = $view->param('item', []); |
|
89 | 89 | |
90 | - if( !isset( $view->item ) ) { |
|
91 | - $view->item = \Aimeos\MShop::create( $context, 'plugin' )->createItem(); |
|
90 | + if (!isset($view->item)) { |
|
91 | + $view->item = \Aimeos\MShop::create($context, 'plugin')->createItem(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $data['plugin.siteid'] = $view->item->getSiteId(); |
@@ -100,26 +100,26 @@ discard block |
||
100 | 100 | $view->itemData = $data; |
101 | 101 | $view->itemBody = ''; |
102 | 102 | |
103 | - foreach( $this->getSubClients() as $idx => $client ) |
|
103 | + foreach ($this->getSubClients() as $idx => $client) |
|
104 | 104 | { |
105 | 105 | $view->tabindex = ++$idx + 1; |
106 | 106 | $view->itemBody .= $client->create(); |
107 | 107 | } |
108 | 108 | } |
109 | - catch( \Aimeos\MShop\Exception $e ) |
|
109 | + catch (\Aimeos\MShop\Exception $e) |
|
110 | 110 | { |
111 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
112 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
113 | - $this->logException( $e ); |
|
111 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
112 | + $view->errors = $view->get('errors', []) + $error; |
|
113 | + $this->logException($e); |
|
114 | 114 | } |
115 | - catch( \Exception $e ) |
|
115 | + catch (\Exception $e) |
|
116 | 116 | { |
117 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
118 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
119 | - $this->logException( $e ); |
|
117 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
118 | + $view->errors = $view->get('errors', []) + $error; |
|
119 | + $this->logException($e); |
|
120 | 120 | } |
121 | 121 | |
122 | - return $this->render( $view ); |
|
122 | + return $this->render($view); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -133,38 +133,38 @@ discard block |
||
133 | 133 | $view = $this->getView(); |
134 | 134 | $context = $this->getContext(); |
135 | 135 | |
136 | - $manager = \Aimeos\MShop::create( $context, 'plugin' ); |
|
136 | + $manager = \Aimeos\MShop::create($context, 'plugin'); |
|
137 | 137 | $manager->begin(); |
138 | 138 | |
139 | 139 | try |
140 | 140 | { |
141 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
142 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
141 | + if (($id = $view->param('id')) === null) { |
|
142 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
143 | 143 | } |
144 | 144 | |
145 | - $view->item = $manager->getItem( $id ); |
|
145 | + $view->item = $manager->getItem($id); |
|
146 | 146 | |
147 | - foreach( $this->getSubClients() as $client ) { |
|
147 | + foreach ($this->getSubClients() as $client) { |
|
148 | 148 | $client->delete(); |
149 | 149 | } |
150 | 150 | |
151 | - $manager->deleteItem( $id ); |
|
151 | + $manager->deleteItem($id); |
|
152 | 152 | $manager->commit(); |
153 | 153 | |
154 | - $this->nextAction( $view, 'search', 'plugin', null, 'delete' ); |
|
154 | + $this->nextAction($view, 'search', 'plugin', null, 'delete'); |
|
155 | 155 | return; |
156 | 156 | } |
157 | - catch( \Aimeos\MShop\Exception $e ) |
|
157 | + catch (\Aimeos\MShop\Exception $e) |
|
158 | 158 | { |
159 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
160 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
161 | - $this->logException( $e ); |
|
159 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
160 | + $view->errors = $view->get('errors', []) + $error; |
|
161 | + $this->logException($e); |
|
162 | 162 | } |
163 | - catch( \Exception $e ) |
|
163 | + catch (\Exception $e) |
|
164 | 164 | { |
165 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
166 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
167 | - $this->logException( $e ); |
|
165 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
166 | + $view->errors = $view->get('errors', []) + $error; |
|
167 | + $this->logException($e); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $manager->rollback(); |
@@ -185,41 +185,41 @@ discard block |
||
185 | 185 | |
186 | 186 | try |
187 | 187 | { |
188 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
189 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
188 | + if (($id = $view->param('id')) === null) { |
|
189 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
190 | 190 | } |
191 | 191 | |
192 | - $manager = \Aimeos\MShop::create( $context, 'plugin' ); |
|
192 | + $manager = \Aimeos\MShop::create($context, 'plugin'); |
|
193 | 193 | |
194 | - $view->item = $manager->getItem( $id ); |
|
195 | - $view->itemData = $this->toArray( $view->item ); |
|
194 | + $view->item = $manager->getItem($id); |
|
195 | + $view->itemData = $this->toArray($view->item); |
|
196 | 196 | $view->itemSubparts = $this->getSubClientNames(); |
197 | 197 | $view->itemDecorators = $this->getDecoratorNames(); |
198 | 198 | $view->itemProviders = $this->getProviderNames(); |
199 | - $view->itemAttributes = $this->getConfigAttributes( $view->item ); |
|
199 | + $view->itemAttributes = $this->getConfigAttributes($view->item); |
|
200 | 200 | $view->itemTypes = $this->getTypeItems(); |
201 | 201 | $view->itemBody = ''; |
202 | 202 | |
203 | - foreach( $this->getSubClients() as $idx => $client ) |
|
203 | + foreach ($this->getSubClients() as $idx => $client) |
|
204 | 204 | { |
205 | 205 | $view->tabindex = ++$idx + 1; |
206 | 206 | $view->itemBody .= $client->get(); |
207 | 207 | } |
208 | 208 | } |
209 | - catch( \Aimeos\MShop\Exception $e ) |
|
209 | + catch (\Aimeos\MShop\Exception $e) |
|
210 | 210 | { |
211 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
212 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
213 | - $this->logException( $e ); |
|
211 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
212 | + $view->errors = $view->get('errors', []) + $error; |
|
213 | + $this->logException($e); |
|
214 | 214 | } |
215 | - catch( \Exception $e ) |
|
215 | + catch (\Exception $e) |
|
216 | 216 | { |
217 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
218 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
219 | - $this->logException( $e ); |
|
217 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
218 | + $view->errors = $view->get('errors', []) + $error; |
|
219 | + $this->logException($e); |
|
220 | 220 | } |
221 | 221 | |
222 | - return $this->render( $view ); |
|
222 | + return $this->render($view); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | |
@@ -233,40 +233,40 @@ discard block |
||
233 | 233 | $view = $this->getView(); |
234 | 234 | $context = $this->getContext(); |
235 | 235 | |
236 | - $manager = \Aimeos\MShop::create( $context, 'plugin' ); |
|
236 | + $manager = \Aimeos\MShop::create($context, 'plugin'); |
|
237 | 237 | $manager->begin(); |
238 | 238 | |
239 | 239 | try |
240 | 240 | { |
241 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
242 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
241 | + $item = $this->fromArray($view->param('item', [])); |
|
242 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
243 | 243 | $view->itemBody = ''; |
244 | 244 | |
245 | - foreach( $this->getSubClients() as $client ) { |
|
245 | + foreach ($this->getSubClients() as $client) { |
|
246 | 246 | $view->itemBody .= $client->save(); |
247 | 247 | } |
248 | 248 | |
249 | - $manager->saveItem( clone $view->item ); |
|
249 | + $manager->saveItem(clone $view->item); |
|
250 | 250 | $manager->commit(); |
251 | 251 | |
252 | - $this->nextAction( $view, $view->param( 'next' ), 'plugin', $view->item->getId(), 'save' ); |
|
252 | + $this->nextAction($view, $view->param('next'), 'plugin', $view->item->getId(), 'save'); |
|
253 | 253 | return; |
254 | 254 | } |
255 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
255 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
256 | 256 | { |
257 | 257 | // fall through to create |
258 | 258 | } |
259 | - catch( \Aimeos\MShop\Exception $e ) |
|
259 | + catch (\Aimeos\MShop\Exception $e) |
|
260 | 260 | { |
261 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
262 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
263 | - $this->logException( $e ); |
|
261 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
262 | + $view->errors = $view->get('errors', []) + $error; |
|
263 | + $this->logException($e); |
|
264 | 264 | } |
265 | - catch( \Exception $e ) |
|
265 | + catch (\Exception $e) |
|
266 | 266 | { |
267 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
268 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
269 | - $this->logException( $e ); |
|
267 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
268 | + $view->errors = $view->get('errors', []) + $error; |
|
269 | + $this->logException($e); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | $manager->rollback(); |
@@ -288,35 +288,35 @@ discard block |
||
288 | 288 | try |
289 | 289 | { |
290 | 290 | $total = 0; |
291 | - $params = $this->storeSearchParams( $view->param(), 'plugin' ); |
|
292 | - $manager = \Aimeos\MShop::create( $context, 'plugin' ); |
|
291 | + $params = $this->storeSearchParams($view->param(), 'plugin'); |
|
292 | + $manager = \Aimeos\MShop::create($context, 'plugin'); |
|
293 | 293 | |
294 | 294 | $search = $manager->createSearch(); |
295 | - $search->setSortations( [$search->sort( '+', 'plugin.type' ), $search->sort( '+', 'plugin.position' )] ); |
|
296 | - $search = $this->initCriteria( $search, $params ); |
|
295 | + $search->setSortations([$search->sort('+', 'plugin.type'), $search->sort('+', 'plugin.position')]); |
|
296 | + $search = $this->initCriteria($search, $params); |
|
297 | 297 | |
298 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
299 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
298 | + $view->items = $manager->searchItems($search, [], $total); |
|
299 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
300 | 300 | $view->filterOperators = $search->getOperators(); |
301 | 301 | $view->itemTypes = $this->getTypeItems(); |
302 | 302 | $view->total = $total; |
303 | 303 | $view->itemBody = ''; |
304 | 304 | |
305 | - foreach( $this->getSubClients() as $client ) { |
|
305 | + foreach ($this->getSubClients() as $client) { |
|
306 | 306 | $view->itemBody .= $client->search(); |
307 | 307 | } |
308 | 308 | } |
309 | - catch( \Aimeos\MShop\Exception $e ) |
|
309 | + catch (\Aimeos\MShop\Exception $e) |
|
310 | 310 | { |
311 | - $error = array( 'plugin-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
312 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
313 | - $this->logException( $e ); |
|
311 | + $error = array('plugin-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
312 | + $view->errors = $view->get('errors', []) + $error; |
|
313 | + $this->logException($e); |
|
314 | 314 | } |
315 | - catch( \Exception $e ) |
|
315 | + catch (\Exception $e) |
|
316 | 316 | { |
317 | - $error = array( 'plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
318 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
319 | - $this->logException( $e ); |
|
317 | + $error = array('plugin-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
318 | + $view->errors = $view->get('errors', []) + $error; |
|
319 | + $this->logException($e); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /** admin/jqadm/plugin/template-list |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $tplconf = 'admin/jqadm/plugin/template-list'; |
342 | 342 | $default = 'plugin/list-standard'; |
343 | 343 | |
344 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
344 | + return $view->render($view->config($tplconf, $default)); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | * @param string|null $name Name of the sub-client (Default if null) |
353 | 353 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
354 | 354 | */ |
355 | - public function getSubClient( $type, $name = null ) |
|
355 | + public function getSubClient($type, $name = null) |
|
356 | 356 | { |
357 | 357 | /** admin/jqadm/plugin/decorators/excludes |
358 | 358 | * Excludes decorators added by the "common" option from the plugin JQAdm client |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * @see admin/jqadm/plugin/decorators/excludes |
428 | 428 | * @see admin/jqadm/plugin/decorators/global |
429 | 429 | */ |
430 | - return $this->createSubClient( 'plugin/' . $type, $name ); |
|
430 | + return $this->createSubClient('plugin/' . $type, $name); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | |
@@ -437,13 +437,13 @@ discard block |
||
437 | 437 | * @param \Aimeos\MShop\Plugin\Item\Iface $item Plugin item incl. provider/decorator property |
438 | 438 | * @return \Aimeos\MW\Common\Critera\Attribute\Iface[] List of configuration attributes |
439 | 439 | */ |
440 | - public function getConfigAttributes( \Aimeos\MShop\Plugin\Item\Iface $item ) |
|
440 | + public function getConfigAttributes(\Aimeos\MShop\Plugin\Item\Iface $item) |
|
441 | 441 | { |
442 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'plugin' ); |
|
442 | + $manager = \Aimeos\MShop::create($this->getContext(), 'plugin'); |
|
443 | 443 | |
444 | 444 | try { |
445 | - return $manager->getProvider( $item, $item->getType() )->getConfigBE(); |
|
446 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
445 | + return $manager->getProvider($item, $item->getType())->getConfigBE(); |
|
446 | + } catch (\Aimeos\MShop\Exception $e) { |
|
447 | 447 | return []; |
448 | 448 | } |
449 | 449 | } |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | protected function getDecoratorNames() |
458 | 458 | { |
459 | 459 | $ds = DIRECTORY_SEPARATOR; |
460 | - return $this->getClassNames( 'MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Decorator' ); |
|
460 | + return $this->getClassNames('MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Decorator'); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | { |
471 | 471 | $ds = DIRECTORY_SEPARATOR; |
472 | 472 | return [ |
473 | - 'order' => $this->getClassNames( 'MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Order' ) |
|
473 | + 'order' => $this->getClassNames('MShop' . $ds . 'Plugin' . $ds . 'Provider' . $ds . 'Order') |
|
474 | 474 | ]; |
475 | 475 | } |
476 | 476 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * @since 2017.10 |
516 | 516 | * @category Developer |
517 | 517 | */ |
518 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/plugin/standard/subparts', [] ); |
|
518 | + return $this->getContext()->getConfig()->get('admin/jqadm/plugin/standard/subparts', []); |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | |
@@ -526,12 +526,12 @@ discard block |
||
526 | 526 | */ |
527 | 527 | protected function getTypeItems() |
528 | 528 | { |
529 | - $typeManager = \Aimeos\MShop::create( $this->getContext(), 'plugin/type' ); |
|
529 | + $typeManager = \Aimeos\MShop::create($this->getContext(), 'plugin/type'); |
|
530 | 530 | |
531 | - $search = $typeManager->createSearch( true )->setSlice( 0, 10000 ); |
|
532 | - $search->setSortations( [$search->sort( '+', 'plugin.type.position' )] ); |
|
531 | + $search = $typeManager->createSearch(true)->setSlice(0, 10000); |
|
532 | + $search->setSortations([$search->sort('+', 'plugin.type.position')]); |
|
533 | 533 | |
534 | - return $this->map( $typeManager->searchItems( $search ) ); |
|
534 | + return $this->map($typeManager->searchItems($search)); |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | |
@@ -541,17 +541,17 @@ discard block |
||
541 | 541 | * @param string[] Data array |
542 | 542 | * @return \Aimeos\MShop\Plugin\Item\Iface New plugin item object |
543 | 543 | */ |
544 | - protected function fromArray( array $data ) |
|
544 | + protected function fromArray(array $data) |
|
545 | 545 | { |
546 | 546 | $conf = []; |
547 | 547 | |
548 | - if( isset( $data['config']['key'] ) ) |
|
548 | + if (isset($data['config']['key'])) |
|
549 | 549 | { |
550 | - foreach( (array) $data['config']['key'] as $idx => $key ) |
|
550 | + foreach ((array) $data['config']['key'] as $idx => $key) |
|
551 | 551 | { |
552 | - if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) |
|
552 | + if (trim($key) !== '' && isset($data['config']['val'][$idx])) |
|
553 | 553 | { |
554 | - if( ( $val = json_decode( $data['config']['val'][$idx] ) ) === null ) { |
|
554 | + if (($val = json_decode($data['config']['val'][$idx])) === null) { |
|
555 | 555 | $conf[$key] = $data['config']['val'][$idx]; |
556 | 556 | } else { |
557 | 557 | $conf[$key] = $val; |
@@ -560,16 +560,16 @@ discard block |
||
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
563 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'plugin' ); |
|
563 | + $manager = \Aimeos\MShop::create($this->getContext(), 'plugin'); |
|
564 | 564 | |
565 | - if( isset( $data['plugin.id'] ) && $data['plugin.id'] != '' ) { |
|
566 | - $item = $manager->getItem( $data['plugin.id'] ); |
|
565 | + if (isset($data['plugin.id']) && $data['plugin.id'] != '') { |
|
566 | + $item = $manager->getItem($data['plugin.id']); |
|
567 | 567 | } else { |
568 | 568 | $item = $manager->createItem(); |
569 | 569 | } |
570 | 570 | |
571 | - $item->fromArray( $data ); |
|
572 | - $item->setConfig( $conf ); |
|
571 | + $item->fromArray($data); |
|
572 | + $item->setConfig($conf); |
|
573 | 573 | |
574 | 574 | return $item; |
575 | 575 | } |
@@ -581,21 +581,21 @@ discard block |
||
581 | 581 | * @param \Aimeos\MShop\Plugin\Item\Iface $item Plugin item object |
582 | 582 | * @return string[] Multi-dimensional associative list of item data |
583 | 583 | */ |
584 | - protected function toArray( \Aimeos\MShop\Plugin\Item\Iface $item, $copy = false ) |
|
584 | + protected function toArray(\Aimeos\MShop\Plugin\Item\Iface $item, $copy = false) |
|
585 | 585 | { |
586 | 586 | $config = $item->getConfig(); |
587 | - $data = $item->toArray( true ); |
|
587 | + $data = $item->toArray(true); |
|
588 | 588 | $data['config'] = []; |
589 | 589 | |
590 | - if( $copy === true ) |
|
590 | + if ($copy === true) |
|
591 | 591 | { |
592 | 592 | $data['plugin.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
593 | 593 | $data['plugin.id'] = ''; |
594 | 594 | } |
595 | 595 | |
596 | - ksort( $config ); |
|
596 | + ksort($config); |
|
597 | 597 | |
598 | - foreach( $config as $key => $value ) |
|
598 | + foreach ($config as $key => $value) |
|
599 | 599 | { |
600 | 600 | $data['config']['key'][] = $key; |
601 | 601 | $data['config']['val'][] = $value; |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
612 | 612 | * @return string HTML output |
613 | 613 | */ |
614 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
614 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
615 | 615 | { |
616 | 616 | /** admin/jqadm/plugin/template-item |
617 | 617 | * Relative path to the HTML body template for the plugin item. |
@@ -635,6 +635,6 @@ discard block |
||
635 | 635 | $tplconf = 'admin/jqadm/plugin/template-item'; |
636 | 636 | $default = 'plugin/item-standard'; |
637 | 637 | |
638 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
638 | + return $view->render($view->config($tplconf, $default)); |
|
639 | 639 | } |
640 | 640 | } |
@@ -111,14 +111,12 @@ |
||
111 | 111 | foreach( $this->getSubClients() as $client ) { |
112 | 112 | $view->listBody .= $client->search(); |
113 | 113 | } |
114 | - } |
|
115 | - catch( \Aimeos\MShop\Exception $e ) |
|
114 | + } catch( \Aimeos\MShop\Exception $e ) |
|
116 | 115 | { |
117 | 116 | $error = array( 'dashboard' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
118 | 117 | $view->errors = $view->get( 'errors', [] ) + $error; |
119 | 118 | $this->logException( $e ); |
120 | - } |
|
121 | - catch( \Exception $e ) |
|
119 | + } catch( \Exception $e ) |
|
122 | 120 | { |
123 | 121 | $error = array( 'dashboard' => $e->getMessage() ); |
124 | 122 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Dashboard; |
12 | 12 | |
13 | -sprintf( 'dashboard' ); // for translation |
|
13 | +sprintf('dashboard'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -49,21 +49,21 @@ discard block |
||
49 | 49 | { |
50 | 50 | $view->listBody = ''; |
51 | 51 | |
52 | - foreach( $this->getSubClients() as $client ) { |
|
52 | + foreach ($this->getSubClients() as $client) { |
|
53 | 53 | $view->listBody .= $client->search(); |
54 | 54 | } |
55 | 55 | } |
56 | - catch( \Aimeos\MShop\Exception $e ) |
|
56 | + catch (\Aimeos\MShop\Exception $e) |
|
57 | 57 | { |
58 | - $error = array( 'dashboard' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
59 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
60 | - $this->logException( $e ); |
|
58 | + $error = array('dashboard' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
59 | + $view->errors = $view->get('errors', []) + $error; |
|
60 | + $this->logException($e); |
|
61 | 61 | } |
62 | - catch( \Exception $e ) |
|
62 | + catch (\Exception $e) |
|
63 | 63 | { |
64 | - $error = array( 'dashboard' => $e->getMessage() ); |
|
65 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
66 | - $this->logException( $e ); |
|
64 | + $error = array('dashboard' => $e->getMessage()); |
|
65 | + $view->errors = $view->get('errors', []) + $error; |
|
66 | + $this->logException($e); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** admin/jqadm/dashboard/template-list |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $tplconf = 'admin/jqadm/dashboard/template-list'; |
89 | 89 | $default = 'dashboard/list-standard'; |
90 | 90 | |
91 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
91 | + return $view->render($view->config($tplconf, $default)); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param string|null $name Name of the sub-client (Default if null) |
100 | 100 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
101 | 101 | */ |
102 | - public function getSubClient( $type, $name = null ) |
|
102 | + public function getSubClient($type, $name = null) |
|
103 | 103 | { |
104 | 104 | /** admin/jqadm/dashboard/decorators/excludes |
105 | 105 | * Excludes decorators added by the "common" option from the dashboard JQAdm client |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @see admin/jqadm/dashboard/decorators/excludes |
175 | 175 | * @see admin/jqadm/dashboard/decorators/global |
176 | 176 | */ |
177 | - return $this->createSubClient( 'dashboard/' . $type, $name ); |
|
177 | + return $this->createSubClient('dashboard/' . $type, $name); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | |
@@ -218,6 +218,6 @@ discard block |
||
218 | 218 | * @since 2016.07 |
219 | 219 | * @category Developer |
220 | 220 | */ |
221 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/dashboard/standard/subparts', [] ); |
|
221 | + return $this->getContext()->getConfig()->get('admin/jqadm/dashboard/standard/subparts', []); |
|
222 | 222 | } |
223 | 223 | } |
@@ -125,14 +125,12 @@ discard block |
||
125 | 125 | $view->tabindex = ++$idx + 1; |
126 | 126 | $view->itemBody .= $client->copy(); |
127 | 127 | } |
128 | - } |
|
129 | - catch( \Aimeos\MShop\Exception $e ) |
|
128 | + } catch( \Aimeos\MShop\Exception $e ) |
|
130 | 129 | { |
131 | 130 | $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
132 | 131 | $view->errors = $view->get( 'errors', [] ) + $error; |
133 | 132 | $this->logException( $e ); |
134 | - } |
|
135 | - catch( \Exception $e ) |
|
133 | + } catch( \Exception $e ) |
|
136 | 134 | { |
137 | 135 | $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
138 | 136 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -177,14 +175,12 @@ discard block |
||
177 | 175 | $view->tabindex = ++$idx + 1; |
178 | 176 | $view->itemBody .= $client->create(); |
179 | 177 | } |
180 | - } |
|
181 | - catch( \Aimeos\MShop\Exception $e ) |
|
178 | + } catch( \Aimeos\MShop\Exception $e ) |
|
182 | 179 | { |
183 | 180 | $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
184 | 181 | $view->errors = $view->get( 'errors', [] ) + $error; |
185 | 182 | $this->logException( $e ); |
186 | - } |
|
187 | - catch( \Exception $e ) |
|
183 | + } catch( \Exception $e ) |
|
188 | 184 | { |
189 | 185 | $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
190 | 186 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -225,14 +221,12 @@ discard block |
||
225 | 221 | |
226 | 222 | $this->nextAction( $view, 'search', 'service', null, 'delete' ); |
227 | 223 | return; |
228 | - } |
|
229 | - catch( \Aimeos\MShop\Exception $e ) |
|
224 | + } catch( \Aimeos\MShop\Exception $e ) |
|
230 | 225 | { |
231 | 226 | $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
232 | 227 | $view->errors = $view->get( 'errors', [] ) + $error; |
233 | 228 | $this->logException( $e ); |
234 | - } |
|
235 | - catch( \Exception $e ) |
|
229 | + } catch( \Exception $e ) |
|
236 | 230 | { |
237 | 231 | $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
238 | 232 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,14 +271,12 @@ discard block |
||
277 | 271 | $view->tabindex = ++$idx + 1; |
278 | 272 | $view->itemBody .= $client->get(); |
279 | 273 | } |
280 | - } |
|
281 | - catch( \Aimeos\MShop\Exception $e ) |
|
274 | + } catch( \Aimeos\MShop\Exception $e ) |
|
282 | 275 | { |
283 | 276 | $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
284 | 277 | $view->errors = $view->get( 'errors', [] ) + $error; |
285 | 278 | $this->logException( $e ); |
286 | - } |
|
287 | - catch( \Exception $e ) |
|
279 | + } catch( \Exception $e ) |
|
288 | 280 | { |
289 | 281 | $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
290 | 282 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -321,18 +313,15 @@ discard block |
||
321 | 313 | |
322 | 314 | $this->nextAction( $view, $view->param( 'next' ), 'service', $view->item->getId(), 'save' ); |
323 | 315 | return; |
324 | - } |
|
325 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
316 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
326 | 317 | { |
327 | 318 | // fall through to create |
328 | - } |
|
329 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
330 | 320 | { |
331 | 321 | $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
332 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
333 | 323 | $this->logException( $e ); |
334 | - } |
|
335 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
336 | 325 | { |
337 | 326 | $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
338 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -375,14 +364,12 @@ discard block |
||
375 | 364 | foreach( $this->getSubClients() as $client ) { |
376 | 365 | $view->itemBody .= $client->search(); |
377 | 366 | } |
378 | - } |
|
379 | - catch( \Aimeos\MShop\Exception $e ) |
|
367 | + } catch( \Aimeos\MShop\Exception $e ) |
|
380 | 368 | { |
381 | 369 | $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
382 | 370 | $view->errors = $view->get( 'errors', [] ) + $error; |
383 | 371 | $this->logException( $e ); |
384 | - } |
|
385 | - catch( \Exception $e ) |
|
372 | + } catch( \Exception $e ) |
|
386 | 373 | { |
387 | 374 | $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
388 | 375 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -548,7 +548,7 @@ |
||
548 | 548 | /** |
549 | 549 | * Returns the available service type items |
550 | 550 | * |
551 | - * @return array List of item implementing \Aimeos\MShop\Common\Type\Iface |
|
551 | + * @return \Aimeos\MShop\Common\Item\Type\Iface[] List of item implementing \Aimeos\MShop\Common\Type\Iface |
|
552 | 552 | */ |
553 | 553 | protected function getTypeItems() |
554 | 554 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Service; |
12 | 12 | |
13 | -sprintf( 'service' ); // for translation |
|
13 | +sprintf('service'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,41 +35,41 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'service' ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'service'); |
|
43 | 43 | |
44 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
44 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemProviders = $this->getProviderNames(); |
48 | 48 | $view->itemDecorators = $this->getDecoratorNames(); |
49 | - $view->itemAttributes = $this->getConfigAttributes( $view->item ); |
|
49 | + $view->itemAttributes = $this->getConfigAttributes($view->item); |
|
50 | 50 | $view->itemTypes = $this->getTypeItems(); |
51 | 51 | $view->itemBody = ''; |
52 | 52 | |
53 | - foreach( $this->getSubClients() as $idx => $client ) |
|
53 | + foreach ($this->getSubClients() as $idx => $client) |
|
54 | 54 | { |
55 | 55 | $view->tabindex = ++$idx + 1; |
56 | 56 | $view->itemBody .= $client->copy(); |
57 | 57 | } |
58 | 58 | } |
59 | - catch( \Aimeos\MShop\Exception $e ) |
|
59 | + catch (\Aimeos\MShop\Exception $e) |
|
60 | 60 | { |
61 | - $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
62 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
63 | - $this->logException( $e ); |
|
61 | + $error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
62 | + $view->errors = $view->get('errors', []) + $error; |
|
63 | + $this->logException($e); |
|
64 | 64 | } |
65 | - catch( \Exception $e ) |
|
65 | + catch (\Exception $e) |
|
66 | 66 | { |
67 | - $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
68 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
69 | - $this->logException( $e ); |
|
67 | + $error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
68 | + $view->errors = $view->get('errors', []) + $error; |
|
69 | + $this->logException($e); |
|
70 | 70 | } |
71 | 71 | |
72 | - return $this->render( $view ); |
|
72 | + return $this->render($view); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | |
86 | 86 | try |
87 | 87 | { |
88 | - $data = $view->param( 'item', [] ); |
|
88 | + $data = $view->param('item', []); |
|
89 | 89 | |
90 | - if( !isset( $view->item ) ) { |
|
91 | - $view->item = \Aimeos\MShop::create( $context, 'service' )->createItem(); |
|
90 | + if (!isset($view->item)) { |
|
91 | + $view->item = \Aimeos\MShop::create($context, 'service')->createItem(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $data['service.siteid'] = $view->item->getSiteId(); |
@@ -100,26 +100,26 @@ discard block |
||
100 | 100 | $view->itemData = $data; |
101 | 101 | $view->itemBody = ''; |
102 | 102 | |
103 | - foreach( $this->getSubClients() as $idx => $client ) |
|
103 | + foreach ($this->getSubClients() as $idx => $client) |
|
104 | 104 | { |
105 | 105 | $view->tabindex = ++$idx + 1; |
106 | 106 | $view->itemBody .= $client->create(); |
107 | 107 | } |
108 | 108 | } |
109 | - catch( \Aimeos\MShop\Exception $e ) |
|
109 | + catch (\Aimeos\MShop\Exception $e) |
|
110 | 110 | { |
111 | - $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
112 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
113 | - $this->logException( $e ); |
|
111 | + $error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
112 | + $view->errors = $view->get('errors', []) + $error; |
|
113 | + $this->logException($e); |
|
114 | 114 | } |
115 | - catch( \Exception $e ) |
|
115 | + catch (\Exception $e) |
|
116 | 116 | { |
117 | - $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
118 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
119 | - $this->logException( $e ); |
|
117 | + $error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
118 | + $view->errors = $view->get('errors', []) + $error; |
|
119 | + $this->logException($e); |
|
120 | 120 | } |
121 | 121 | |
122 | - return $this->render( $view ); |
|
122 | + return $this->render($view); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -133,39 +133,39 @@ discard block |
||
133 | 133 | $view = $this->getView(); |
134 | 134 | $context = $this->getContext(); |
135 | 135 | |
136 | - $manager = \Aimeos\MShop::create( $context, 'service' ); |
|
136 | + $manager = \Aimeos\MShop::create($context, 'service'); |
|
137 | 137 | $manager->begin(); |
138 | 138 | |
139 | 139 | try |
140 | 140 | { |
141 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
142 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
141 | + if (($id = $view->param('id')) === null) { |
|
142 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
143 | 143 | } |
144 | 144 | |
145 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
145 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
146 | 146 | |
147 | - foreach( $this->getSubClients() as $client ) { |
|
147 | + foreach ($this->getSubClients() as $client) { |
|
148 | 148 | $client->delete(); |
149 | 149 | } |
150 | 150 | |
151 | - $manager->saveItem( $view->item ); |
|
152 | - $manager->deleteItem( $id ); |
|
151 | + $manager->saveItem($view->item); |
|
152 | + $manager->deleteItem($id); |
|
153 | 153 | $manager->commit(); |
154 | 154 | |
155 | - $this->nextAction( $view, 'search', 'service', null, 'delete' ); |
|
155 | + $this->nextAction($view, 'search', 'service', null, 'delete'); |
|
156 | 156 | return; |
157 | 157 | } |
158 | - catch( \Aimeos\MShop\Exception $e ) |
|
158 | + catch (\Aimeos\MShop\Exception $e) |
|
159 | 159 | { |
160 | - $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
161 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
162 | - $this->logException( $e ); |
|
160 | + $error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
161 | + $view->errors = $view->get('errors', []) + $error; |
|
162 | + $this->logException($e); |
|
163 | 163 | } |
164 | - catch( \Exception $e ) |
|
164 | + catch (\Exception $e) |
|
165 | 165 | { |
166 | - $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
167 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
168 | - $this->logException( $e ); |
|
166 | + $error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
167 | + $view->errors = $view->get('errors', []) + $error; |
|
168 | + $this->logException($e); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $manager->rollback(); |
@@ -186,41 +186,41 @@ discard block |
||
186 | 186 | |
187 | 187 | try |
188 | 188 | { |
189 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
190 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
189 | + if (($id = $view->param('id')) === null) { |
|
190 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
191 | 191 | } |
192 | 192 | |
193 | - $manager = \Aimeos\MShop::create( $context, 'service' ); |
|
193 | + $manager = \Aimeos\MShop::create($context, 'service'); |
|
194 | 194 | |
195 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
196 | - $view->itemData = $this->toArray( $view->item ); |
|
195 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
196 | + $view->itemData = $this->toArray($view->item); |
|
197 | 197 | $view->itemSubparts = $this->getSubClientNames(); |
198 | 198 | $view->itemDecorators = $this->getDecoratorNames(); |
199 | 199 | $view->itemProviders = $this->getProviderNames(); |
200 | - $view->itemAttributes = $this->getConfigAttributes( $view->item ); |
|
200 | + $view->itemAttributes = $this->getConfigAttributes($view->item); |
|
201 | 201 | $view->itemTypes = $this->getTypeItems(); |
202 | 202 | $view->itemBody = ''; |
203 | 203 | |
204 | - foreach( $this->getSubClients() as $idx => $client ) |
|
204 | + foreach ($this->getSubClients() as $idx => $client) |
|
205 | 205 | { |
206 | 206 | $view->tabindex = ++$idx + 1; |
207 | 207 | $view->itemBody .= $client->get(); |
208 | 208 | } |
209 | 209 | } |
210 | - catch( \Aimeos\MShop\Exception $e ) |
|
210 | + catch (\Aimeos\MShop\Exception $e) |
|
211 | 211 | { |
212 | - $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
213 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
214 | - $this->logException( $e ); |
|
212 | + $error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
213 | + $view->errors = $view->get('errors', []) + $error; |
|
214 | + $this->logException($e); |
|
215 | 215 | } |
216 | - catch( \Exception $e ) |
|
216 | + catch (\Exception $e) |
|
217 | 217 | { |
218 | - $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
219 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
220 | - $this->logException( $e ); |
|
218 | + $error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
219 | + $view->errors = $view->get('errors', []) + $error; |
|
220 | + $this->logException($e); |
|
221 | 221 | } |
222 | 222 | |
223 | - return $this->render( $view ); |
|
223 | + return $this->render($view); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | |
@@ -234,40 +234,40 @@ discard block |
||
234 | 234 | $view = $this->getView(); |
235 | 235 | $context = $this->getContext(); |
236 | 236 | |
237 | - $manager = \Aimeos\MShop::create( $context, 'service' ); |
|
237 | + $manager = \Aimeos\MShop::create($context, 'service'); |
|
238 | 238 | $manager->begin(); |
239 | 239 | |
240 | 240 | try |
241 | 241 | { |
242 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
243 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
242 | + $item = $this->fromArray($view->param('item', [])); |
|
243 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
244 | 244 | $view->itemBody = ''; |
245 | 245 | |
246 | - foreach( $this->getSubClients() as $client ) { |
|
246 | + foreach ($this->getSubClients() as $client) { |
|
247 | 247 | $view->itemBody .= $client->save(); |
248 | 248 | } |
249 | 249 | |
250 | - $manager->saveItem( clone $view->item ); |
|
250 | + $manager->saveItem(clone $view->item); |
|
251 | 251 | $manager->commit(); |
252 | 252 | |
253 | - $this->nextAction( $view, $view->param( 'next' ), 'service', $view->item->getId(), 'save' ); |
|
253 | + $this->nextAction($view, $view->param('next'), 'service', $view->item->getId(), 'save'); |
|
254 | 254 | return; |
255 | 255 | } |
256 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
256 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
257 | 257 | { |
258 | 258 | // fall through to create |
259 | 259 | } |
260 | - catch( \Aimeos\MShop\Exception $e ) |
|
260 | + catch (\Aimeos\MShop\Exception $e) |
|
261 | 261 | { |
262 | - $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
263 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
264 | - $this->logException( $e ); |
|
262 | + $error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
263 | + $view->errors = $view->get('errors', []) + $error; |
|
264 | + $this->logException($e); |
|
265 | 265 | } |
266 | - catch( \Exception $e ) |
|
266 | + catch (\Exception $e) |
|
267 | 267 | { |
268 | - $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
269 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
270 | - $this->logException( $e ); |
|
268 | + $error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
269 | + $view->errors = $view->get('errors', []) + $error; |
|
270 | + $this->logException($e); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | $manager->rollback(); |
@@ -289,35 +289,35 @@ discard block |
||
289 | 289 | try |
290 | 290 | { |
291 | 291 | $total = 0; |
292 | - $params = $this->storeSearchParams( $view->param(), 'service' ); |
|
293 | - $manager = \Aimeos\MShop::create( $context, 'service' ); |
|
292 | + $params = $this->storeSearchParams($view->param(), 'service'); |
|
293 | + $manager = \Aimeos\MShop::create($context, 'service'); |
|
294 | 294 | |
295 | 295 | $search = $manager->createSearch(); |
296 | - $search->setSortations( [$search->sort( '+', 'service.type' ), $search->sort( '+', 'service.position' )] ); |
|
297 | - $search = $this->initCriteria( $search, $params ); |
|
296 | + $search->setSortations([$search->sort('+', 'service.type'), $search->sort('+', 'service.position')]); |
|
297 | + $search = $this->initCriteria($search, $params); |
|
298 | 298 | |
299 | - $view->items = $manager->searchItems( $search, $this->getDomains(), $total ); |
|
300 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
299 | + $view->items = $manager->searchItems($search, $this->getDomains(), $total); |
|
300 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
301 | 301 | $view->filterOperators = $search->getOperators(); |
302 | 302 | $view->itemTypes = $this->getTypeItems(); |
303 | 303 | $view->total = $total; |
304 | 304 | $view->itemBody = ''; |
305 | 305 | |
306 | - foreach( $this->getSubClients() as $client ) { |
|
306 | + foreach ($this->getSubClients() as $client) { |
|
307 | 307 | $view->itemBody .= $client->search(); |
308 | 308 | } |
309 | 309 | } |
310 | - catch( \Aimeos\MShop\Exception $e ) |
|
310 | + catch (\Aimeos\MShop\Exception $e) |
|
311 | 311 | { |
312 | - $error = array( 'service-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
313 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
314 | - $this->logException( $e ); |
|
312 | + $error = array('service-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
313 | + $view->errors = $view->get('errors', []) + $error; |
|
314 | + $this->logException($e); |
|
315 | 315 | } |
316 | - catch( \Exception $e ) |
|
316 | + catch (\Exception $e) |
|
317 | 317 | { |
318 | - $error = array( 'service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
319 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
320 | - $this->logException( $e ); |
|
318 | + $error = array('service-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
319 | + $view->errors = $view->get('errors', []) + $error; |
|
320 | + $this->logException($e); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | /** admin/jqadm/service/template-list |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/service/template-list'; |
343 | 343 | $default = 'service/list-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * @param string|null $name Name of the sub-client (Default if null) |
354 | 354 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
355 | 355 | */ |
356 | - public function getSubClient( $type, $name = null ) |
|
356 | + public function getSubClient($type, $name = null) |
|
357 | 357 | { |
358 | 358 | /** admin/jqadm/service/decorators/excludes |
359 | 359 | * Excludes decorators added by the "common" option from the service JQAdm client |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | * @see admin/jqadm/service/decorators/excludes |
429 | 429 | * @see admin/jqadm/service/decorators/global |
430 | 430 | */ |
431 | - return $this->createSubClient( 'service/' . $type, $name ); |
|
431 | + return $this->createSubClient('service/' . $type, $name); |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | |
@@ -438,13 +438,13 @@ discard block |
||
438 | 438 | * @param \Aimeos\MShop\Service\Item\Iface $item Service item incl. provider/decorator property |
439 | 439 | * @return \Aimeos\MW\Common\Critera\Attribute\Iface[] List of configuration attributes |
440 | 440 | */ |
441 | - public function getConfigAttributes( \Aimeos\MShop\Service\Item\Iface $item ) |
|
441 | + public function getConfigAttributes(\Aimeos\MShop\Service\Item\Iface $item) |
|
442 | 442 | { |
443 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'service' ); |
|
443 | + $manager = \Aimeos\MShop::create($this->getContext(), 'service'); |
|
444 | 444 | |
445 | 445 | try { |
446 | - return $manager->getProvider( $item, $item->getType() )->getConfigBE(); |
|
447 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
446 | + return $manager->getProvider($item, $item->getType())->getConfigBE(); |
|
447 | + } catch (\Aimeos\MShop\Exception $e) { |
|
448 | 448 | return []; |
449 | 449 | } |
450 | 450 | } |
@@ -468,9 +468,9 @@ discard block |
||
468 | 468 | * @since 2017.10 |
469 | 469 | * @category Developer |
470 | 470 | */ |
471 | - $domains = array( 'media', 'price', 'text' ); |
|
471 | + $domains = array('media', 'price', 'text'); |
|
472 | 472 | |
473 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/service/domains', $domains ); |
|
473 | + return $this->getContext()->getConfig()->get('admin/jqadm/service/domains', $domains); |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | protected function getDecoratorNames() |
483 | 483 | { |
484 | 484 | $ds = DIRECTORY_SEPARATOR; |
485 | - return $this->getClassNames( 'MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Decorator' ); |
|
485 | + return $this->getClassNames('MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Decorator'); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | |
@@ -495,8 +495,8 @@ discard block |
||
495 | 495 | { |
496 | 496 | $ds = DIRECTORY_SEPARATOR; |
497 | 497 | return [ |
498 | - 'delivery' => $this->getClassNames( 'MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Delivery' ), |
|
499 | - 'payment' => $this->getClassNames( 'MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Payment' ), |
|
498 | + 'delivery' => $this->getClassNames('MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Delivery'), |
|
499 | + 'payment' => $this->getClassNames('MShop' . $ds . 'Service' . $ds . 'Provider' . $ds . 'Payment'), |
|
500 | 500 | ]; |
501 | 501 | } |
502 | 502 | |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * @since 2017.10 |
542 | 542 | * @category Developer |
543 | 543 | */ |
544 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/service/standard/subparts', [] ); |
|
544 | + return $this->getContext()->getConfig()->get('admin/jqadm/service/standard/subparts', []); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | |
@@ -552,12 +552,12 @@ discard block |
||
552 | 552 | */ |
553 | 553 | protected function getTypeItems() |
554 | 554 | { |
555 | - $typeManager = \Aimeos\MShop::create( $this->getContext(), 'service/type' ); |
|
555 | + $typeManager = \Aimeos\MShop::create($this->getContext(), 'service/type'); |
|
556 | 556 | |
557 | - $search = $typeManager->createSearch( true )->setSlice( 0, 10000 ); |
|
558 | - $search->setSortations( [$search->sort( '+', 'service.type.position' )] ); |
|
557 | + $search = $typeManager->createSearch(true)->setSlice(0, 10000); |
|
558 | + $search->setSortations([$search->sort('+', 'service.type.position')]); |
|
559 | 559 | |
560 | - return $this->map( $typeManager->searchItems( $search ) ); |
|
560 | + return $this->map($typeManager->searchItems($search)); |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | |
@@ -567,17 +567,17 @@ discard block |
||
567 | 567 | * @param string[] Data array |
568 | 568 | * @return \Aimeos\MShop\Service\Item\Iface New service item object |
569 | 569 | */ |
570 | - protected function fromArray( array $data ) |
|
570 | + protected function fromArray(array $data) |
|
571 | 571 | { |
572 | 572 | $conf = []; |
573 | 573 | |
574 | - if( isset( $data['config']['key'] ) ) |
|
574 | + if (isset($data['config']['key'])) |
|
575 | 575 | { |
576 | - foreach( (array) $data['config']['key'] as $idx => $key ) |
|
576 | + foreach ((array) $data['config']['key'] as $idx => $key) |
|
577 | 577 | { |
578 | - if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) |
|
578 | + if (trim($key) !== '' && isset($data['config']['val'][$idx])) |
|
579 | 579 | { |
580 | - if( ( $val = json_decode( $data['config']['val'][$idx] ) ) === null ) { |
|
580 | + if (($val = json_decode($data['config']['val'][$idx])) === null) { |
|
581 | 581 | $conf[$key] = $data['config']['val'][$idx]; |
582 | 582 | } else { |
583 | 583 | $conf[$key] = $val; |
@@ -586,16 +586,16 @@ discard block |
||
586 | 586 | } |
587 | 587 | } |
588 | 588 | |
589 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'service' ); |
|
589 | + $manager = \Aimeos\MShop::create($this->getContext(), 'service'); |
|
590 | 590 | |
591 | - if( isset( $data['service.id'] ) && $data['service.id'] != '' ) { |
|
592 | - $item = $manager->getItem( $data['service.id'], $this->getDomains() ); |
|
591 | + if (isset($data['service.id']) && $data['service.id'] != '') { |
|
592 | + $item = $manager->getItem($data['service.id'], $this->getDomains()); |
|
593 | 593 | } else { |
594 | 594 | $item = $manager->createItem(); |
595 | 595 | } |
596 | 596 | |
597 | - $item->fromArray( $data ); |
|
598 | - $item->setConfig( $conf ); |
|
597 | + $item->fromArray($data); |
|
598 | + $item->setConfig($conf); |
|
599 | 599 | |
600 | 600 | return $item; |
601 | 601 | } |
@@ -607,22 +607,22 @@ discard block |
||
607 | 607 | * @param \Aimeos\MShop\Service\Item\Iface $item Service item object |
608 | 608 | * @return string[] Multi-dimensional associative list of item data |
609 | 609 | */ |
610 | - protected function toArray( \Aimeos\MShop\Service\Item\Iface $item, $copy = false ) |
|
610 | + protected function toArray(\Aimeos\MShop\Service\Item\Iface $item, $copy = false) |
|
611 | 611 | { |
612 | 612 | $config = $item->getConfig(); |
613 | - $data = $item->toArray( true ); |
|
613 | + $data = $item->toArray(true); |
|
614 | 614 | $data['config'] = []; |
615 | 615 | |
616 | - if( $copy === true ) |
|
616 | + if ($copy === true) |
|
617 | 617 | { |
618 | 618 | $data['service.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
619 | 619 | $data['service.code'] = $data['service.code'] . '_copy'; |
620 | 620 | $data['service.id'] = ''; |
621 | 621 | } |
622 | 622 | |
623 | - ksort( $config ); |
|
623 | + ksort($config); |
|
624 | 624 | |
625 | - foreach( $config as $key => $value ) |
|
625 | + foreach ($config as $key => $value) |
|
626 | 626 | { |
627 | 627 | $data['config']['key'][] = $key; |
628 | 628 | $data['config']['val'][] = $value; |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
639 | 639 | * @return string HTML output |
640 | 640 | */ |
641 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
641 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
642 | 642 | { |
643 | 643 | /** admin/jqadm/service/template-item |
644 | 644 | * Relative path to the HTML body template for the service item. |
@@ -662,6 +662,6 @@ discard block |
||
662 | 662 | $tplconf = 'admin/jqadm/service/template-item'; |
663 | 663 | $default = 'service/item-standard'; |
664 | 664 | |
665 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
665 | + return $view->render($view->config($tplconf, $default)); |
|
666 | 666 | } |
667 | 667 | } |
@@ -122,14 +122,12 @@ discard block |
||
122 | 122 | $view->tabindex = ++$idx + 1; |
123 | 123 | $view->itemBody .= $client->copy(); |
124 | 124 | } |
125 | - } |
|
126 | - catch( \Aimeos\MShop\Exception $e ) |
|
125 | + } catch( \Aimeos\MShop\Exception $e ) |
|
127 | 126 | { |
128 | 127 | $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
129 | 128 | $view->errors = $view->get( 'errors', [] ) + $error; |
130 | 129 | $this->logException( $e ); |
131 | - } |
|
132 | - catch( \Exception $e ) |
|
130 | + } catch( \Exception $e ) |
|
133 | 131 | { |
134 | 132 | $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
135 | 133 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -172,14 +170,12 @@ discard block |
||
172 | 170 | $view->tabindex = ++$idx + 1; |
173 | 171 | $view->itemBody .= $client->create(); |
174 | 172 | } |
175 | - } |
|
176 | - catch( \Aimeos\MShop\Exception $e ) |
|
173 | + } catch( \Aimeos\MShop\Exception $e ) |
|
177 | 174 | { |
178 | 175 | $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
179 | 176 | $view->errors = $view->get( 'errors', [] ) + $error; |
180 | 177 | $this->logException( $e ); |
181 | - } |
|
182 | - catch( \Exception $e ) |
|
178 | + } catch( \Exception $e ) |
|
183 | 179 | { |
184 | 180 | $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
185 | 181 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -220,14 +216,12 @@ discard block |
||
220 | 216 | |
221 | 217 | $this->nextAction( $view, 'search', 'customer', null, 'delete' ); |
222 | 218 | return; |
223 | - } |
|
224 | - catch( \Aimeos\MShop\Exception $e ) |
|
219 | + } catch( \Aimeos\MShop\Exception $e ) |
|
225 | 220 | { |
226 | 221 | $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
227 | 222 | $view->errors = $view->get( 'errors', [] ) + $error; |
228 | 223 | $this->logException( $e ); |
229 | - } |
|
230 | - catch( \Exception $e ) |
|
224 | + } catch( \Exception $e ) |
|
231 | 225 | { |
232 | 226 | $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
233 | 227 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -269,14 +263,12 @@ discard block |
||
269 | 263 | $view->tabindex = ++$idx + 1; |
270 | 264 | $view->itemBody .= $client->get(); |
271 | 265 | } |
272 | - } |
|
273 | - catch( \Aimeos\MShop\Exception $e ) |
|
266 | + } catch( \Aimeos\MShop\Exception $e ) |
|
274 | 267 | { |
275 | 268 | $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
276 | 269 | $view->errors = $view->get( 'errors', [] ) + $error; |
277 | 270 | $this->logException( $e ); |
278 | - } |
|
279 | - catch( \Exception $e ) |
|
271 | + } catch( \Exception $e ) |
|
280 | 272 | { |
281 | 273 | $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
282 | 274 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -313,18 +305,15 @@ discard block |
||
313 | 305 | |
314 | 306 | $this->nextAction( $view, $view->param( 'next' ), 'customer', $view->item->getId(), 'save' ); |
315 | 307 | return; |
316 | - } |
|
317 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
308 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
318 | 309 | { |
319 | 310 | // fall through to create |
320 | - } |
|
321 | - catch( \Aimeos\MShop\Exception $e ) |
|
311 | + } catch( \Aimeos\MShop\Exception $e ) |
|
322 | 312 | { |
323 | 313 | $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
324 | 314 | $view->errors = $view->get( 'errors', [] ) + $error; |
325 | 315 | $this->logException( $e ); |
326 | - } |
|
327 | - catch( \Exception $e ) |
|
316 | + } catch( \Exception $e ) |
|
328 | 317 | { |
329 | 318 | $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
330 | 319 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -363,14 +352,12 @@ discard block |
||
363 | 352 | foreach( $this->getSubClients() as $client ) { |
364 | 353 | $view->itemBody .= $client->search(); |
365 | 354 | } |
366 | - } |
|
367 | - catch( \Aimeos\MShop\Exception $e ) |
|
355 | + } catch( \Aimeos\MShop\Exception $e ) |
|
368 | 356 | { |
369 | 357 | $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
370 | 358 | $view->errors = $view->get( 'errors', [] ) + $error; |
371 | 359 | $this->logException( $e ); |
372 | - } |
|
373 | - catch( \Exception $e ) |
|
360 | + } catch( \Exception $e ) |
|
374 | 361 | { |
375 | 362 | $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
376 | 363 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer; |
12 | 12 | |
13 | -sprintf( 'customer' ); // for translation |
|
13 | +sprintf('customer'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,38 +35,38 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
43 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
43 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemGroups = $this->getGroupItems(); |
48 | 48 | $view->itemBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $idx => $client ) |
|
50 | + foreach ($this->getSubClients() as $idx => $client) |
|
51 | 51 | { |
52 | 52 | $view->tabindex = ++$idx + 1; |
53 | 53 | $view->itemBody .= $client->copy(); |
54 | 54 | } |
55 | 55 | } |
56 | - catch( \Aimeos\MShop\Exception $e ) |
|
56 | + catch (\Aimeos\MShop\Exception $e) |
|
57 | 57 | { |
58 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
59 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
60 | - $this->logException( $e ); |
|
58 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
59 | + $view->errors = $view->get('errors', []) + $error; |
|
60 | + $this->logException($e); |
|
61 | 61 | } |
62 | - catch( \Exception $e ) |
|
62 | + catch (\Exception $e) |
|
63 | 63 | { |
64 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
65 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
66 | - $this->logException( $e ); |
|
64 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
65 | + $view->errors = $view->get('errors', []) + $error; |
|
66 | + $this->logException($e); |
|
67 | 67 | } |
68 | 68 | |
69 | - return $this->render( $view ); |
|
69 | + return $this->render($view); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | |
83 | 83 | try |
84 | 84 | { |
85 | - $data = $view->param( 'item', [] ); |
|
85 | + $data = $view->param('item', []); |
|
86 | 86 | |
87 | - if( !isset( $view->item ) ) { |
|
88 | - $view->item = \Aimeos\MShop::create( $context, 'customer' )->createItem(); |
|
87 | + if (!isset($view->item)) { |
|
88 | + $view->item = \Aimeos\MShop::create($context, 'customer')->createItem(); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $data['customer.siteid'] = $view->item->getSiteId(); |
@@ -95,26 +95,26 @@ discard block |
||
95 | 95 | $view->itemData = $data; |
96 | 96 | $view->itemBody = ''; |
97 | 97 | |
98 | - foreach( $this->getSubClients() as $idx => $client ) |
|
98 | + foreach ($this->getSubClients() as $idx => $client) |
|
99 | 99 | { |
100 | 100 | $view->tabindex = ++$idx + 1; |
101 | 101 | $view->itemBody .= $client->create(); |
102 | 102 | } |
103 | 103 | } |
104 | - catch( \Aimeos\MShop\Exception $e ) |
|
104 | + catch (\Aimeos\MShop\Exception $e) |
|
105 | 105 | { |
106 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
107 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
108 | - $this->logException( $e ); |
|
106 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
107 | + $view->errors = $view->get('errors', []) + $error; |
|
108 | + $this->logException($e); |
|
109 | 109 | } |
110 | - catch( \Exception $e ) |
|
110 | + catch (\Exception $e) |
|
111 | 111 | { |
112 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
113 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
114 | - $this->logException( $e ); |
|
112 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
113 | + $view->errors = $view->get('errors', []) + $error; |
|
114 | + $this->logException($e); |
|
115 | 115 | } |
116 | 116 | |
117 | - return $this->render( $view ); |
|
117 | + return $this->render($view); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | |
@@ -128,39 +128,39 @@ discard block |
||
128 | 128 | $view = $this->getView(); |
129 | 129 | $context = $this->getContext(); |
130 | 130 | |
131 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
131 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
132 | 132 | $manager->begin(); |
133 | 133 | |
134 | 134 | try |
135 | 135 | { |
136 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
137 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
136 | + if (($id = $view->param('id')) === null) { |
|
137 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
138 | 138 | } |
139 | 139 | |
140 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
140 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
141 | 141 | |
142 | - foreach( $this->getSubClients() as $client ) { |
|
142 | + foreach ($this->getSubClients() as $client) { |
|
143 | 143 | $client->delete(); |
144 | 144 | } |
145 | 145 | |
146 | - $manager->saveItem( $view->item ); |
|
147 | - $manager->deleteItem( $id ); |
|
146 | + $manager->saveItem($view->item); |
|
147 | + $manager->deleteItem($id); |
|
148 | 148 | $manager->commit(); |
149 | 149 | |
150 | - $this->nextAction( $view, 'search', 'customer', null, 'delete' ); |
|
150 | + $this->nextAction($view, 'search', 'customer', null, 'delete'); |
|
151 | 151 | return; |
152 | 152 | } |
153 | - catch( \Aimeos\MShop\Exception $e ) |
|
153 | + catch (\Aimeos\MShop\Exception $e) |
|
154 | 154 | { |
155 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
156 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
157 | - $this->logException( $e ); |
|
155 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
156 | + $view->errors = $view->get('errors', []) + $error; |
|
157 | + $this->logException($e); |
|
158 | 158 | } |
159 | - catch( \Exception $e ) |
|
159 | + catch (\Exception $e) |
|
160 | 160 | { |
161 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
162 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
163 | - $this->logException( $e ); |
|
161 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
162 | + $view->errors = $view->get('errors', []) + $error; |
|
163 | + $this->logException($e); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | $manager->rollback(); |
@@ -181,38 +181,38 @@ discard block |
||
181 | 181 | |
182 | 182 | try |
183 | 183 | { |
184 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
185 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
184 | + if (($id = $view->param('id')) === null) { |
|
185 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
186 | 186 | } |
187 | 187 | |
188 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
188 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
189 | 189 | |
190 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
190 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
191 | 191 | $view->itemSubparts = $this->getSubClientNames(); |
192 | - $view->itemData = $this->toArray( $view->item ); |
|
192 | + $view->itemData = $this->toArray($view->item); |
|
193 | 193 | $view->itemGroups = $this->getGroupItems(); |
194 | 194 | $view->itemBody = ''; |
195 | 195 | |
196 | - foreach( $this->getSubClients() as $idx => $client ) |
|
196 | + foreach ($this->getSubClients() as $idx => $client) |
|
197 | 197 | { |
198 | 198 | $view->tabindex = ++$idx + 1; |
199 | 199 | $view->itemBody .= $client->get(); |
200 | 200 | } |
201 | 201 | } |
202 | - catch( \Aimeos\MShop\Exception $e ) |
|
202 | + catch (\Aimeos\MShop\Exception $e) |
|
203 | 203 | { |
204 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
205 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
206 | - $this->logException( $e ); |
|
204 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
205 | + $view->errors = $view->get('errors', []) + $error; |
|
206 | + $this->logException($e); |
|
207 | 207 | } |
208 | - catch( \Exception $e ) |
|
208 | + catch (\Exception $e) |
|
209 | 209 | { |
210 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
211 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
212 | - $this->logException( $e ); |
|
210 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
211 | + $view->errors = $view->get('errors', []) + $error; |
|
212 | + $this->logException($e); |
|
213 | 213 | } |
214 | 214 | |
215 | - return $this->render( $view ); |
|
215 | + return $this->render($view); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | |
@@ -226,40 +226,40 @@ discard block |
||
226 | 226 | $view = $this->getView(); |
227 | 227 | $context = $this->getContext(); |
228 | 228 | |
229 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
229 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
230 | 230 | $manager->begin(); |
231 | 231 | |
232 | 232 | try |
233 | 233 | { |
234 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
235 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
234 | + $item = $this->fromArray($view->param('item', [])); |
|
235 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
236 | 236 | $view->itemBody = ''; |
237 | 237 | |
238 | - foreach( $this->getSubClients() as $client ) { |
|
238 | + foreach ($this->getSubClients() as $client) { |
|
239 | 239 | $view->itemBody .= $client->save(); |
240 | 240 | } |
241 | 241 | |
242 | - $manager->saveItem( clone $view->item ); |
|
242 | + $manager->saveItem(clone $view->item); |
|
243 | 243 | $manager->commit(); |
244 | 244 | |
245 | - $this->nextAction( $view, $view->param( 'next' ), 'customer', $view->item->getId(), 'save' ); |
|
245 | + $this->nextAction($view, $view->param('next'), 'customer', $view->item->getId(), 'save'); |
|
246 | 246 | return; |
247 | 247 | } |
248 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
248 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
249 | 249 | { |
250 | 250 | // fall through to create |
251 | 251 | } |
252 | - catch( \Aimeos\MShop\Exception $e ) |
|
252 | + catch (\Aimeos\MShop\Exception $e) |
|
253 | 253 | { |
254 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
255 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
256 | - $this->logException( $e ); |
|
254 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
255 | + $view->errors = $view->get('errors', []) + $error; |
|
256 | + $this->logException($e); |
|
257 | 257 | } |
258 | - catch( \Exception $e ) |
|
258 | + catch (\Exception $e) |
|
259 | 259 | { |
260 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
261 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
262 | - $this->logException( $e ); |
|
260 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
261 | + $view->errors = $view->get('errors', []) + $error; |
|
262 | + $this->logException($e); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | $manager->rollback(); |
@@ -281,31 +281,31 @@ discard block |
||
281 | 281 | try |
282 | 282 | { |
283 | 283 | $total = 0; |
284 | - $params = $this->storeSearchParams( $view->param(), 'customer' ); |
|
285 | - $manager = \Aimeos\MShop::create( $context, 'customer' ); |
|
286 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
284 | + $params = $this->storeSearchParams($view->param(), 'customer'); |
|
285 | + $manager = \Aimeos\MShop::create($context, 'customer'); |
|
286 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
287 | 287 | |
288 | - $view->items = $manager->searchItems( $search, $this->getDomains(), $total ); |
|
289 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
288 | + $view->items = $manager->searchItems($search, $this->getDomains(), $total); |
|
289 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
290 | 290 | $view->filterOperators = $search->getOperators(); |
291 | 291 | $view->total = $total; |
292 | 292 | $view->itemBody = ''; |
293 | 293 | |
294 | - foreach( $this->getSubClients() as $client ) { |
|
294 | + foreach ($this->getSubClients() as $client) { |
|
295 | 295 | $view->itemBody .= $client->search(); |
296 | 296 | } |
297 | 297 | } |
298 | - catch( \Aimeos\MShop\Exception $e ) |
|
298 | + catch (\Aimeos\MShop\Exception $e) |
|
299 | 299 | { |
300 | - $error = array( 'customer-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
301 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
302 | - $this->logException( $e ); |
|
300 | + $error = array('customer-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
301 | + $view->errors = $view->get('errors', []) + $error; |
|
302 | + $this->logException($e); |
|
303 | 303 | } |
304 | - catch( \Exception $e ) |
|
304 | + catch (\Exception $e) |
|
305 | 305 | { |
306 | - $error = array( 'customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
307 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
308 | - $this->logException( $e ); |
|
306 | + $error = array('customer-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
307 | + $view->errors = $view->get('errors', []) + $error; |
|
308 | + $this->logException($e); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** admin/jqadm/customer/template-list |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $tplconf = 'admin/jqadm/customer/template-list'; |
331 | 331 | $default = 'customer/list-standard'; |
332 | 332 | |
333 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
333 | + return $view->render($view->config($tplconf, $default)); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | * @param string|null $name Name of the sub-client (Default if null) |
342 | 342 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
343 | 343 | */ |
344 | - public function getSubClient( $type, $name = null ) |
|
344 | + public function getSubClient($type, $name = null) |
|
345 | 345 | { |
346 | 346 | /** admin/jqadm/customer/decorators/excludes |
347 | 347 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | * @see admin/jqadm/customer/decorators/excludes |
417 | 417 | * @see admin/jqadm/customer/decorators/global |
418 | 418 | */ |
419 | - return $this->createSubClient( 'customer/' . $type, $name ); |
|
419 | + return $this->createSubClient('customer/' . $type, $name); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | */ |
441 | 441 | $domains = ['customer/address', 'customer/group', 'customer/property']; |
442 | 442 | |
443 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/domains', $domains ); |
|
443 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/domains', $domains); |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | |
@@ -452,20 +452,20 @@ discard block |
||
452 | 452 | protected function getGroupItems() |
453 | 453 | { |
454 | 454 | $list = []; |
455 | - $isSuper = $this->getView()->access( ['super'] ); |
|
456 | - $isAdmin = $this->getView()->access( ['admin'] ); |
|
455 | + $isSuper = $this->getView()->access(['super']); |
|
456 | + $isAdmin = $this->getView()->access(['admin']); |
|
457 | 457 | |
458 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer/group' ); |
|
458 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/group'); |
|
459 | 459 | $search = $manager->createSearch(); |
460 | - $search->setSortations( [$search->sort( '+', 'customer.group.label' )] ); |
|
460 | + $search->setSortations([$search->sort('+', 'customer.group.label')]); |
|
461 | 461 | |
462 | - foreach( $manager->searchItems( $search ) as $groupId => $groupItem ) |
|
462 | + foreach ($manager->searchItems($search) as $groupId => $groupItem) |
|
463 | 463 | { |
464 | - if( !$isSuper && in_array( $groupItem->getCode(), ['super'] ) ) { |
|
464 | + if (!$isSuper && in_array($groupItem->getCode(), ['super'])) { |
|
465 | 465 | continue; |
466 | 466 | } |
467 | 467 | |
468 | - if( !$isSuper && !$isAdmin && in_array( $groupItem->getCode(), ['super', 'admin', 'editor'] ) ) { |
|
468 | + if (!$isSuper && !$isAdmin && in_array($groupItem->getCode(), ['super', 'admin', 'editor'])) { |
|
469 | 469 | continue; |
470 | 470 | } |
471 | 471 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * @since 2017.07 |
517 | 517 | * @category Developer |
518 | 518 | */ |
519 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/standard/subparts', [] ); |
|
519 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/standard/subparts', []); |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | |
@@ -527,21 +527,21 @@ discard block |
||
527 | 527 | * @param string[] Data array |
528 | 528 | * @return \Aimeos\MShop\Customer\Item\Iface New customer item object |
529 | 529 | */ |
530 | - protected function fromArray( array $data ) |
|
530 | + protected function fromArray(array $data) |
|
531 | 531 | { |
532 | 532 | $data['customer.label'] = $data['customer.firstname'] . ' ' . $data['customer.lastname']; |
533 | 533 | $data['customer.code'] = $data['customer.email']; |
534 | 534 | |
535 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer' ); |
|
535 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer'); |
|
536 | 536 | |
537 | - if( isset( $data['customer.id'] ) && $data['customer.id'] != '' ) { |
|
538 | - $item = $manager->getItem( $data['customer.id'], $this->getDomains() ); |
|
537 | + if (isset($data['customer.id']) && $data['customer.id'] != '') { |
|
538 | + $item = $manager->getItem($data['customer.id'], $this->getDomains()); |
|
539 | 539 | } else { |
540 | 540 | $item = $manager->createItem(); |
541 | 541 | } |
542 | 542 | |
543 | - $item->fromArray( $data ); |
|
544 | - $item->setGroups( array_intersect( array_keys( $this->getGroupItems() ), $item->getGroups() ) ); |
|
543 | + $item->fromArray($data); |
|
544 | + $item->setGroups(array_intersect(array_keys($this->getGroupItems()), $item->getGroups())); |
|
545 | 545 | |
546 | 546 | return $item; |
547 | 547 | } |
@@ -553,11 +553,11 @@ discard block |
||
553 | 553 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object |
554 | 554 | * @return string[] Multi-dimensional associative list of item data |
555 | 555 | */ |
556 | - protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false ) |
|
556 | + protected function toArray(\Aimeos\MShop\Customer\Item\Iface $item, $copy = false) |
|
557 | 557 | { |
558 | - $data = $item->toArray( true ); |
|
558 | + $data = $item->toArray(true); |
|
559 | 559 | |
560 | - if( $copy === true ) |
|
560 | + if ($copy === true) |
|
561 | 561 | { |
562 | 562 | $data['customer.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
563 | 563 | $data['customer.email'] = ''; |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
575 | 575 | * @return string HTML output |
576 | 576 | */ |
577 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
577 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
578 | 578 | { |
579 | 579 | /** admin/jqadm/customer/template-item |
580 | 580 | * Relative path to the HTML body template for the customer item. |
@@ -598,6 +598,6 @@ discard block |
||
598 | 598 | $tplconf = 'admin/jqadm/customer/template-item'; |
599 | 599 | $default = 'customer/item-standard'; |
600 | 600 | |
601 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
601 | + return $view->render($view->config($tplconf, $default)); |
|
602 | 602 | } |
603 | 603 | } |
@@ -84,14 +84,12 @@ |
||
84 | 84 | foreach( $this->getSubClients() as $client ) { |
85 | 85 | $view->itemBody .= $client->search(); |
86 | 86 | } |
87 | - } |
|
88 | - catch( \Aimeos\MAdmin\Exception $e ) |
|
87 | + } catch( \Aimeos\MAdmin\Exception $e ) |
|
89 | 88 | { |
90 | 89 | $error = array( 'log-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
91 | 90 | $view->errors = $view->get( 'errors', [] ) + $error; |
92 | 91 | $this->logException( $e ); |
93 | - } |
|
94 | - catch( \Exception $e ) |
|
92 | + } catch( \Exception $e ) |
|
95 | 93 | { |
96 | 94 | $error = array( 'log-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
97 | 95 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Log; |
12 | 12 | |
13 | -sprintf( 'log' ); // for translation |
|
13 | +sprintf('log'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -36,32 +36,32 @@ discard block |
||
36 | 36 | try |
37 | 37 | { |
38 | 38 | $total = 0; |
39 | - $params = $this->storeSearchParams( $view->param(), 'log' ); |
|
40 | - $manager = \Aimeos\MAdmin::create( $context, 'log' ); |
|
39 | + $params = $this->storeSearchParams($view->param(), 'log'); |
|
40 | + $manager = \Aimeos\MAdmin::create($context, 'log'); |
|
41 | 41 | |
42 | 42 | $search = $manager->createSearch(); |
43 | - $search->setSortations( [$search->sort( '-', 'log.timestamp')] ); |
|
44 | - $search = $this->initCriteria( $search, $params ); |
|
43 | + $search->setSortations([$search->sort('-', 'log.timestamp')]); |
|
44 | + $search = $this->initCriteria($search, $params); |
|
45 | 45 | |
46 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
46 | + $view->items = $manager->searchItems($search, [], $total); |
|
47 | 47 | $view->total = $total; |
48 | 48 | $view->itemBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->itemBody .= $client->search(); |
52 | 52 | } |
53 | 53 | } |
54 | - catch( \Aimeos\MAdmin\Exception $e ) |
|
54 | + catch (\Aimeos\MAdmin\Exception $e) |
|
55 | 55 | { |
56 | - $error = array( 'log-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
57 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
58 | - $this->logException( $e ); |
|
56 | + $error = array('log-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
57 | + $view->errors = $view->get('errors', []) + $error; |
|
58 | + $this->logException($e); |
|
59 | 59 | } |
60 | - catch( \Exception $e ) |
|
60 | + catch (\Exception $e) |
|
61 | 61 | { |
62 | - $error = array( 'log-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
63 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
64 | - $this->logException( $e ); |
|
62 | + $error = array('log-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
63 | + $view->errors = $view->get('errors', []) + $error; |
|
64 | + $this->logException($e); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** admin/jqadm/log/template-list |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $tplconf = 'admin/jqadm/log/template-list'; |
87 | 87 | $default = 'log/list-standard'; |
88 | 88 | |
89 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
89 | + return $view->render($view->config($tplconf, $default)); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param string|null $name Name of the sub-client (Default if null) |
98 | 98 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
99 | 99 | */ |
100 | - public function getSubClient( $type, $name = null ) |
|
100 | + public function getSubClient($type, $name = null) |
|
101 | 101 | { |
102 | 102 | /** admin/jqadm/log/decorators/excludes |
103 | 103 | * Excludes decorators added by the "common" option from the log JQAdm client |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @see admin/jqadm/log/decorators/excludes |
173 | 173 | * @see admin/jqadm/log/decorators/global |
174 | 174 | */ |
175 | - return $this->createSubClient( 'log/' . $type, $name ); |
|
175 | + return $this->createSubClient('log/' . $type, $name); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @since 2018.04 |
217 | 217 | * @category Developer |
218 | 218 | */ |
219 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/log/standard/subparts', [] ); |
|
219 | + return $this->getContext()->getConfig()->get('admin/jqadm/log/standard/subparts', []); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
227 | 227 | * @return string HTML output |
228 | 228 | */ |
229 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
229 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
230 | 230 | { |
231 | 231 | /** admin/jqadm/log/template-item |
232 | 232 | * Relative path to the HTML body template for the log item. |
@@ -250,6 +250,6 @@ discard block |
||
250 | 250 | $tplconf = 'admin/jqadm/log/template-item'; |
251 | 251 | $default = 'log/item-standard'; |
252 | 252 | |
253 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
253 | + return $view->render($view->config($tplconf, $default)); |
|
254 | 254 | } |
255 | 255 | } |
@@ -121,14 +121,12 @@ discard block |
||
121 | 121 | $view->tabindex = ++$idx + 1; |
122 | 122 | $view->itemBody .= $client->copy(); |
123 | 123 | } |
124 | - } |
|
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
124 | + } catch( \Aimeos\MShop\Exception $e ) |
|
126 | 125 | { |
127 | 126 | $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
128 | 127 | $view->errors = $view->get( 'errors', [] ) + $error; |
129 | 128 | $this->logException( $e ); |
130 | - } |
|
131 | - catch( \Exception $e ) |
|
129 | + } catch( \Exception $e ) |
|
132 | 130 | { |
133 | 131 | $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
134 | 132 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -170,14 +168,12 @@ discard block |
||
170 | 168 | $view->tabindex = ++$idx + 1; |
171 | 169 | $view->itemBody .= $client->create(); |
172 | 170 | } |
173 | - } |
|
174 | - catch( \Aimeos\MShop\Exception $e ) |
|
171 | + } catch( \Aimeos\MShop\Exception $e ) |
|
175 | 172 | { |
176 | 173 | $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
177 | 174 | $view->errors = $view->get( 'errors', [] ) + $error; |
178 | 175 | $this->logException( $e ); |
179 | - } |
|
180 | - catch( \Exception $e ) |
|
176 | + } catch( \Exception $e ) |
|
181 | 177 | { |
182 | 178 | $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
183 | 179 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -218,14 +214,12 @@ discard block |
||
218 | 214 | |
219 | 215 | $this->nextAction( $view, 'search', 'supplier', null, 'delete' ); |
220 | 216 | return; |
221 | - } |
|
222 | - catch( \Aimeos\MShop\Exception $e ) |
|
217 | + } catch( \Aimeos\MShop\Exception $e ) |
|
223 | 218 | { |
224 | 219 | $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
225 | 220 | $view->errors = $view->get( 'errors', [] ) + $error; |
226 | 221 | $this->logException( $e ); |
227 | - } |
|
228 | - catch( \Exception $e ) |
|
222 | + } catch( \Exception $e ) |
|
229 | 223 | { |
230 | 224 | $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
231 | 225 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -266,14 +260,12 @@ discard block |
||
266 | 260 | $view->tabindex = ++$idx + 1; |
267 | 261 | $view->itemBody .= $client->get(); |
268 | 262 | } |
269 | - } |
|
270 | - catch( \Aimeos\MShop\Exception $e ) |
|
263 | + } catch( \Aimeos\MShop\Exception $e ) |
|
271 | 264 | { |
272 | 265 | $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
273 | 266 | $view->errors = $view->get( 'errors', [] ) + $error; |
274 | 267 | $this->logException( $e ); |
275 | - } |
|
276 | - catch( \Exception $e ) |
|
268 | + } catch( \Exception $e ) |
|
277 | 269 | { |
278 | 270 | $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
279 | 271 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -310,18 +302,15 @@ discard block |
||
310 | 302 | |
311 | 303 | $this->nextAction( $view, $view->param( 'next' ), 'supplier', $view->item->getId(), 'save' ); |
312 | 304 | return; |
313 | - } |
|
314 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
305 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
315 | 306 | { |
316 | 307 | // fall through to create |
317 | - } |
|
318 | - catch( \Aimeos\MShop\Exception $e ) |
|
308 | + } catch( \Aimeos\MShop\Exception $e ) |
|
319 | 309 | { |
320 | 310 | $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
321 | 311 | $view->errors = $view->get( 'errors', [] ) + $error; |
322 | 312 | $this->logException( $e ); |
323 | - } |
|
324 | - catch( \Exception $e ) |
|
313 | + } catch( \Exception $e ) |
|
325 | 314 | { |
326 | 315 | $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
327 | 316 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -360,14 +349,12 @@ discard block |
||
360 | 349 | foreach( $this->getSubClients() as $client ) { |
361 | 350 | $view->itemBody .= $client->search(); |
362 | 351 | } |
363 | - } |
|
364 | - catch( \Aimeos\MShop\Exception $e ) |
|
352 | + } catch( \Aimeos\MShop\Exception $e ) |
|
365 | 353 | { |
366 | 354 | $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
367 | 355 | $view->errors = $view->get( 'errors', [] ) + $error; |
368 | 356 | $this->logException( $e ); |
369 | - } |
|
370 | - catch( \Exception $e ) |
|
357 | + } catch( \Exception $e ) |
|
371 | 358 | { |
372 | 359 | $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
373 | 360 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Supplier; |
12 | 12 | |
13 | -sprintf( 'supplier' ); // for translation |
|
13 | +sprintf('supplier'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
43 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
43 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'supplier' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'supplier')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['supplier.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,39 +126,39 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
138 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->saveItem( $view->item ); |
|
145 | - $manager->deleteItem( $id ); |
|
144 | + $manager->saveItem($view->item); |
|
145 | + $manager->deleteItem($id); |
|
146 | 146 | $manager->commit(); |
147 | 147 | |
148 | - $this->nextAction( $view, 'search', 'supplier', null, 'delete' ); |
|
148 | + $this->nextAction($view, 'search', 'supplier', null, 'delete'); |
|
149 | 149 | return; |
150 | 150 | } |
151 | - catch( \Aimeos\MShop\Exception $e ) |
|
151 | + catch (\Aimeos\MShop\Exception $e) |
|
152 | 152 | { |
153 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
154 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
155 | - $this->logException( $e ); |
|
153 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
154 | + $view->errors = $view->get('errors', []) + $error; |
|
155 | + $this->logException($e); |
|
156 | 156 | } |
157 | - catch( \Exception $e ) |
|
157 | + catch (\Exception $e) |
|
158 | 158 | { |
159 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
160 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
161 | - $this->logException( $e ); |
|
159 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
160 | + $view->errors = $view->get('errors', []) + $error; |
|
161 | + $this->logException($e); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $manager->rollback(); |
@@ -179,37 +179,37 @@ discard block |
||
179 | 179 | |
180 | 180 | try |
181 | 181 | { |
182 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
183 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
182 | + if (($id = $view->param('id')) === null) { |
|
183 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
184 | 184 | } |
185 | 185 | |
186 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
186 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
187 | 187 | |
188 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
188 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
189 | 189 | $view->itemSubparts = $this->getSubClientNames(); |
190 | - $view->itemData = $this->toArray( $view->item ); |
|
190 | + $view->itemData = $this->toArray($view->item); |
|
191 | 191 | $view->itemBody = ''; |
192 | 192 | |
193 | - foreach( $this->getSubClients() as $idx => $client ) |
|
193 | + foreach ($this->getSubClients() as $idx => $client) |
|
194 | 194 | { |
195 | 195 | $view->tabindex = ++$idx + 1; |
196 | 196 | $view->itemBody .= $client->get(); |
197 | 197 | } |
198 | 198 | } |
199 | - catch( \Aimeos\MShop\Exception $e ) |
|
199 | + catch (\Aimeos\MShop\Exception $e) |
|
200 | 200 | { |
201 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
202 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
203 | - $this->logException( $e ); |
|
201 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
202 | + $view->errors = $view->get('errors', []) + $error; |
|
203 | + $this->logException($e); |
|
204 | 204 | } |
205 | - catch( \Exception $e ) |
|
205 | + catch (\Exception $e) |
|
206 | 206 | { |
207 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
208 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
209 | - $this->logException( $e ); |
|
207 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
208 | + $view->errors = $view->get('errors', []) + $error; |
|
209 | + $this->logException($e); |
|
210 | 210 | } |
211 | 211 | |
212 | - return $this->render( $view ); |
|
212 | + return $this->render($view); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
@@ -223,40 +223,40 @@ discard block |
||
223 | 223 | $view = $this->getView(); |
224 | 224 | $context = $this->getContext(); |
225 | 225 | |
226 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
226 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
227 | 227 | $manager->begin(); |
228 | 228 | |
229 | 229 | try |
230 | 230 | { |
231 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
232 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
231 | + $item = $this->fromArray($view->param('item', [])); |
|
232 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
233 | 233 | $view->itemBody = ''; |
234 | 234 | |
235 | - foreach( $this->getSubClients() as $client ) { |
|
235 | + foreach ($this->getSubClients() as $client) { |
|
236 | 236 | $view->itemBody .= $client->save(); |
237 | 237 | } |
238 | 238 | |
239 | - $manager->saveItem( clone $view->item ); |
|
239 | + $manager->saveItem(clone $view->item); |
|
240 | 240 | $manager->commit(); |
241 | 241 | |
242 | - $this->nextAction( $view, $view->param( 'next' ), 'supplier', $view->item->getId(), 'save' ); |
|
242 | + $this->nextAction($view, $view->param('next'), 'supplier', $view->item->getId(), 'save'); |
|
243 | 243 | return; |
244 | 244 | } |
245 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
245 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
246 | 246 | { |
247 | 247 | // fall through to create |
248 | 248 | } |
249 | - catch( \Aimeos\MShop\Exception $e ) |
|
249 | + catch (\Aimeos\MShop\Exception $e) |
|
250 | 250 | { |
251 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
252 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
253 | - $this->logException( $e ); |
|
251 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
252 | + $view->errors = $view->get('errors', []) + $error; |
|
253 | + $this->logException($e); |
|
254 | 254 | } |
255 | - catch( \Exception $e ) |
|
255 | + catch (\Exception $e) |
|
256 | 256 | { |
257 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
258 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
259 | - $this->logException( $e ); |
|
257 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
258 | + $view->errors = $view->get('errors', []) + $error; |
|
259 | + $this->logException($e); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | $manager->rollback(); |
@@ -278,31 +278,31 @@ discard block |
||
278 | 278 | try |
279 | 279 | { |
280 | 280 | $total = 0; |
281 | - $params = $this->storeSearchParams( $view->param(), 'supplier' ); |
|
282 | - $manager = \Aimeos\MShop::create( $context, 'supplier' ); |
|
283 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
281 | + $params = $this->storeSearchParams($view->param(), 'supplier'); |
|
282 | + $manager = \Aimeos\MShop::create($context, 'supplier'); |
|
283 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
284 | 284 | |
285 | - $view->items = $manager->searchItems( $search, $this->getDomains(), $total ); |
|
286 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
285 | + $view->items = $manager->searchItems($search, $this->getDomains(), $total); |
|
286 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
287 | 287 | $view->filterOperators = $search->getOperators(); |
288 | 288 | $view->total = $total; |
289 | 289 | $view->itemBody = ''; |
290 | 290 | |
291 | - foreach( $this->getSubClients() as $client ) { |
|
291 | + foreach ($this->getSubClients() as $client) { |
|
292 | 292 | $view->itemBody .= $client->search(); |
293 | 293 | } |
294 | 294 | } |
295 | - catch( \Aimeos\MShop\Exception $e ) |
|
295 | + catch (\Aimeos\MShop\Exception $e) |
|
296 | 296 | { |
297 | - $error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
298 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
299 | - $this->logException( $e ); |
|
297 | + $error = array('supplier-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
298 | + $view->errors = $view->get('errors', []) + $error; |
|
299 | + $this->logException($e); |
|
300 | 300 | } |
301 | - catch( \Exception $e ) |
|
301 | + catch (\Exception $e) |
|
302 | 302 | { |
303 | - $error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
304 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
305 | - $this->logException( $e ); |
|
303 | + $error = array('supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
304 | + $view->errors = $view->get('errors', []) + $error; |
|
305 | + $this->logException($e); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** admin/jqadm/supplier/template-list |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $tplconf = 'admin/jqadm/supplier/template-list'; |
328 | 328 | $default = 'supplier/list-standard'; |
329 | 329 | |
330 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
330 | + return $view->render($view->config($tplconf, $default)); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @param string|null $name Name of the sub-client (Default if null) |
339 | 339 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
340 | 340 | */ |
341 | - public function getSubClient( $type, $name = null ) |
|
341 | + public function getSubClient($type, $name = null) |
|
342 | 342 | { |
343 | 343 | /** admin/jqadm/supplier/decorators/excludes |
344 | 344 | * Excludes decorators added by the "common" option from the supplier JQAdm client |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * @see admin/jqadm/supplier/decorators/excludes |
414 | 414 | * @see admin/jqadm/supplier/decorators/global |
415 | 415 | */ |
416 | - return $this->createSubClient( 'supplier/' . $type, $name ); |
|
416 | + return $this->createSubClient('supplier/' . $type, $name); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | $domains = ['media', 'supplier/address', 'text']; |
439 | 439 | |
440 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/domains', $domains ); |
|
440 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/domains', $domains); |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | * @since 2017.10 |
482 | 482 | * @category Developer |
483 | 483 | */ |
484 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/standard/subparts', [] ); |
|
484 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/standard/subparts', []); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -492,17 +492,17 @@ discard block |
||
492 | 492 | * @param string[] Data array |
493 | 493 | * @return \Aimeos\MShop\Supplier\Item\Iface New supplier item object |
494 | 494 | */ |
495 | - protected function fromArray( array $data ) |
|
495 | + protected function fromArray(array $data) |
|
496 | 496 | { |
497 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'supplier' ); |
|
497 | + $manager = \Aimeos\MShop::create($this->getContext(), 'supplier'); |
|
498 | 498 | |
499 | - if( isset( $data['supplier.id'] ) && $data['supplier.id'] != '' ) { |
|
500 | - $item = $manager->getItem( $data['supplier.id'], $this->getDomains() ); |
|
499 | + if (isset($data['supplier.id']) && $data['supplier.id'] != '') { |
|
500 | + $item = $manager->getItem($data['supplier.id'], $this->getDomains()); |
|
501 | 501 | } else { |
502 | 502 | $item = $manager->createItem(); |
503 | 503 | } |
504 | 504 | |
505 | - $item->fromArray( $data ); |
|
505 | + $item->fromArray($data); |
|
506 | 506 | |
507 | 507 | return $item; |
508 | 508 | } |
@@ -514,11 +514,11 @@ discard block |
||
514 | 514 | * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object |
515 | 515 | * @return string[] Multi-dimensional associative list of item data |
516 | 516 | */ |
517 | - protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, $copy = false ) |
|
517 | + protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, $copy = false) |
|
518 | 518 | { |
519 | - $data = $item->toArray( true ); |
|
519 | + $data = $item->toArray(true); |
|
520 | 520 | |
521 | - if( $copy === true ) |
|
521 | + if ($copy === true) |
|
522 | 522 | { |
523 | 523 | $data['supplier.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
524 | 524 | $data['supplier.code'] = $data['supplier.code'] . '_copy'; |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
536 | 536 | * @return string HTML output |
537 | 537 | */ |
538 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
538 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
539 | 539 | { |
540 | 540 | /** admin/jqadm/supplier/template-item |
541 | 541 | * Relative path to the HTML body template for the supplier item. |
@@ -559,6 +559,6 @@ discard block |
||
559 | 559 | $tplconf = 'admin/jqadm/supplier/template-item'; |
560 | 560 | $default = 'supplier/item-standard'; |
561 | 561 | |
562 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
562 | + return $view->render($view->config($tplconf, $default)); |
|
563 | 563 | } |
564 | 564 | } |