@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | */ |
18 | 18 | |
19 | 19 | |
20 | -$selected = function( $key, $code ) { |
|
21 | - return ( (string) $key === (string) $code ? 'selected="selected"' : '' ); |
|
20 | +$selected = function($key, $code) { |
|
21 | + return ((string) $key === (string) $code ? 'selected="selected"' : ''); |
|
22 | 22 | }; |
23 | 23 | |
24 | 24 | |
25 | -$group = (array) $this->get( 'group', [] ); |
|
26 | -$filter = $this->get( 'filter', [] ); |
|
27 | -$fields = $this->get( 'fields', [] ); |
|
25 | +$group = (array) $this->get('group', []); |
|
26 | +$filter = $this->get('filter', []); |
|
27 | +$fields = $this->get('fields', []); |
|
28 | 28 | $idx = 0; |
29 | 29 | |
30 | 30 | $enc = $this->encoder(); |
@@ -32,41 +32,41 @@ discard block |
||
32 | 32 | |
33 | 33 | ?> |
34 | 34 | <tr class="list-search"> |
35 | - <?php foreach( $this->get( 'data', [] ) as $key => $list ) : $idx++ ?> |
|
36 | - <?php if( in_array( $key, $fields ) ) : ?> |
|
37 | - <td class="<?= str_replace( '.', '-', $key ); ?>"> |
|
38 | - <input type="hidden" value="<?= $enc->attr( $key ); ?>" |
|
39 | - name="<?= $enc->attr( $this->formparam( array_merge( $group, ['filter', 'key', $idx] ) ) ); ?>" /> |
|
40 | - <input type="hidden" value="<?= $enc->attr( $this->value( $list, 'op', '=~' ) ); ?>" |
|
41 | - name="<?= $enc->attr( $this->formparam( array_merge( $group, ['filter', 'op', $idx] ) ) ); ?>" /> |
|
35 | + <?php foreach ($this->get('data', []) as $key => $list) : $idx++ ?> |
|
36 | + <?php if (in_array($key, $fields)) : ?> |
|
37 | + <td class="<?= str_replace('.', '-', $key); ?>"> |
|
38 | + <input type="hidden" value="<?= $enc->attr($key); ?>" |
|
39 | + name="<?= $enc->attr($this->formparam(array_merge($group, ['filter', 'key', $idx]))); ?>" /> |
|
40 | + <input type="hidden" value="<?= $enc->attr($this->value($list, 'op', '=~')); ?>" |
|
41 | + name="<?= $enc->attr($this->formparam(array_merge($group, ['filter', 'op', $idx]))); ?>" /> |
|
42 | 42 | |
43 | - <?php if( ( $type = $this->value( $list, 'type', 'text' ) ) === 'select' ) : ?> |
|
44 | - <select class="form-control custom-select" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
45 | - name="<?= $enc->attr( $this->formparam( array_merge( $group, ['filter', 'val', $idx] ) ) ); ?>"> |
|
46 | - <option value=""><?= $enc->attr( $this->translate( 'admin', 'All' ) ); ?></option> |
|
43 | + <?php if (($type = $this->value($list, 'type', 'text')) === 'select') : ?> |
|
44 | + <select class="form-control custom-select" tabindex="<?= $this->get('tabindex'); ?>" |
|
45 | + name="<?= $enc->attr($this->formparam(array_merge($group, ['filter', 'val', $idx]))); ?>"> |
|
46 | + <option value=""><?= $enc->attr($this->translate('admin', 'All')); ?></option> |
|
47 | 47 | |
48 | - <?php foreach( (array) $this->value( $list, 'val', [] ) as $val => $name ) : ?> |
|
49 | - <option value="<?= $enc->attr( $val ); ?>" <?= $selected( $this->value( $filter, 'val/' . $idx ), $val ); ?> > |
|
50 | - <?= $enc->html( $name ); ?> |
|
48 | + <?php foreach ((array) $this->value($list, 'val', []) as $val => $name) : ?> |
|
49 | + <option value="<?= $enc->attr($val); ?>" <?= $selected($this->value($filter, 'val/' . $idx), $val); ?> > |
|
50 | + <?= $enc->html($name); ?> |
|
51 | 51 | </option> |
52 | 52 | <?php endforeach; ?> |
53 | 53 | </select> |
54 | 54 | <?php else : ?> |
55 | - <input class="form-control" type="<?= $enc->attr( $type ); ?>" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
56 | - name="<?= $enc->attr( $this->formparam( array_merge( $group, ['filter', 'val', $idx] ) ) ); ?>" |
|
57 | - value="<?= $enc->attr( $this->value( $filter, 'val/' . $idx ) ); ?>" /> |
|
55 | + <input class="form-control" type="<?= $enc->attr($type); ?>" tabindex="<?= $this->get('tabindex'); ?>" |
|
56 | + name="<?= $enc->attr($this->formparam(array_merge($group, ['filter', 'val', $idx]))); ?>" |
|
57 | + value="<?= $enc->attr($this->value($filter, 'val/' . $idx)); ?>" /> |
|
58 | 58 | <?php endif; ?> |
59 | 59 | </td> |
60 | 60 | <?php endif; ?> |
61 | 61 | <?php endforeach; ?> |
62 | 62 | |
63 | 63 | <td class="actions"> |
64 | - <button type="submit" class="btn act-search fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
65 | - title="<?= $enc->attr( $this->translate( 'admin', 'Search') ); ?>" |
|
66 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Search' ) ); ?>"> |
|
64 | + <button type="submit" class="btn act-search fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
65 | + title="<?= $enc->attr($this->translate('admin', 'Search')); ?>" |
|
66 | + aria-label="<?= $enc->attr($this->translate('admin', 'Search')); ?>"> |
|
67 | 67 | </button> |
68 | - <a class="btn act-reset fa" href="#" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
69 | - title="<?= $enc->attr( $this->translate( 'admin', 'Reset') ); ?>" |
|
70 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Reset' ) ); ?>"></a> |
|
68 | + <a class="btn act-reset fa" href="#" tabindex="<?= $this->get('tabindex'); ?>" |
|
69 | + title="<?= $enc->attr($this->translate('admin', 'Reset')); ?>" |
|
70 | + aria-label="<?= $enc->attr($this->translate('admin', 'Reset')); ?>"></a> |
|
71 | 71 | </td> |
72 | 72 | </tr> |
@@ -51,8 +51,11 @@ |
||
51 | 51 | </option> |
52 | 52 | <?php endforeach; ?> |
53 | 53 | </select> |
54 | - <?php else : ?> |
|
55 | - <input class="form-control" type="<?= $enc->attr( $type ); ?>" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
54 | + <?php else { |
|
55 | + : ?> |
|
56 | + <input class="form-control" type="<?= $enc->attr( $type ); |
|
57 | +} |
|
58 | +?>" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
56 | 59 | name="<?= $enc->attr( $this->formparam( array_merge( $group, ['filter', 'val', $idx] ) ) ); ?>" |
57 | 60 | value="<?= $enc->attr( $this->value( $filter, 'val/' . $idx ) ); ?>" /> |
58 | 61 | <?php endif; ?> |
@@ -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.php' ), array( 'errors' => $this->get( 'errors', [] ) ) ); ?> |
|
390 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/info', 'common/partials/info-standard.php' ), array( 'info' => $infoMsgs ) ); ?> |
|
389 | + <?= $this->partial($this->config('admin/jqadm/partial/error', 'common/partials/error-standard.php'), array('errors' => $this->get('errors', []))); ?> |
|
390 | + <?= $this->partial($this->config('admin/jqadm/partial/info', 'common/partials/info-standard.php'), 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.php' ) ); ?> |
|
403 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/problem', 'common/partials/problem-standard.php' ) ); ?> |
|
402 | + <?= $this->partial($this->config('admin/jqadm/partial/confirm', 'common/partials/confirm-standard.php')); ?> |
|
403 | + <?= $this->partial($this->config('admin/jqadm/partial/problem', 'common/partials/problem-standard.php')); ?> |
|
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.typeid', '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.php' ), |
|
59 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'productTotal' ), |
|
58 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
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.php' ), [ |
|
70 | - 'fields' => $fields, 'params' => $params, 'tabindex' => $this->get( 'tabindex' ), |
|
69 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php'), [ |
|
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.typeid' => $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.typeid' => $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.php' ), [ |
|
93 | - 'fields' => $fields, 'group' => 'sp', 'tabindex' => $this->get( 'tabindex' ), |
|
92 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard.php'), [ |
|
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.typeid' => $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.typeid' => $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.php' ), [ |
|
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.php'), [ |
|
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.typeid' => ['op' => '==', 'type' => 'select', 'val' => $this->get( 'productListTypes', [])], |
|
121 | + 'supplier.lists.typeid' => ['op' => '==', 'type' => 'select', 'val' => $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-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" disabled="disabled" |
|
175 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.typeid', '' ) ) ); ?>" > |
|
174 | + <select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>" disabled="disabled" |
|
175 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.typeid', ''))); ?>" > |
|
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 $id => $type ) : ?> |
|
181 | - <option value="<?= $enc->attr( $id ); ?>"><?= $enc->html( $type ); ?></option> |
|
180 | + <?php foreach ($this->get('productListTypes', []) as $id => $type) : ?> |
|
181 | + <option value="<?= $enc->attr($id); ?>"><?= $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.typeid', $fields ) ) : ?> |
|
293 | + <?php if (in_array('supplier.lists.typeid', $fields)) : ?> |
|
294 | 294 | <td class="supplier-lists-typeid"> |
295 | - <select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
296 | - name="<?= $enc->attr( $this->formparam( array( 'product', 'supplier.lists.typeid', '' ) ) ); ?>" |
|
297 | - <?= $this->site()->readonly( $siteId ); ?> disabled="disabled" > |
|
295 | + <select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
296 | + name="<?= $enc->attr($this->formparam(array('product', 'supplier.lists.typeid', ''))); ?>" |
|
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 $id => $type ) : ?> |
|
303 | - <option value="<?= $enc->attr( $id ); ?>" <?= $selected( $this->get( 'productData/supplier.lists.typeid/' . $idx ), $id ); ?> > |
|
304 | - <?= $enc->html( $type ); ?> |
|
302 | + <?php foreach ($this->get('productListTypes', []) as $id => $type) : ?> |
|
303 | + <option value="<?= $enc->attr($id); ?>" <?= $selected($this->get('productData/supplier.lists.typeid/' . $idx), $id); ?> > |
|
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.php' ), |
|
411 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'productTotal' ), |
|
410 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
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'); ?> |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/property/type' ); |
|
77 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/property/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('size', [], 'media')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'size', $result ); |
|
85 | + $this->assertContains('size', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/property/type' ); |
|
161 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/property/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('size', [], 'media')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'size', $result ); |
|
169 | + $this->assertContains('size', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
209 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/property/type' ); |
|
216 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/property/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'media.property.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'size' ), |
|
291 | + 'key' => array(0 => 'media.property.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'size'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-media.property.type.id' ), |
|
295 | + 'sort' => array('-media.property.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>size<', $result ); |
|
302 | + $this->assertContains('>size<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Property\Standard' ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Property\Standard') |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder('\Aimeos\MW\View\Standard') |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/property/type' ); |
|
359 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/property/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('size', [], 'media')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient( $this->context, '%type/media/property' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient($this->context, '%type/media/property'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Media\Property\Factory::createClient($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/type/media/property/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/type/media/property/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/type/media/property/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Media\\Property\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Media\\Property\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Type\\Media\\Property\\' . $name; |
79 | 79 | |
80 | - $client = self::createClientBase( $context, $classname, $iface ); |
|
80 | + $client = self::createClientBase($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'type/media/property' ); |
|
82 | + return self::addClientDecorators($context, $client, 'type/media/property'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/log/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2018.04 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/log/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/log/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Log\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Log\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Log\\' . $name; |
79 | 79 | |
80 | - $client = self::createClientBase( $context, $classname, $iface ); |
|
80 | + $client = self::createClientBase($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'log' ); |
|
82 | + return self::addClientDecorators($context, $client, 'log'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Log\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Log\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -38,23 +38,23 @@ discard block |
||
38 | 38 | { |
39 | 39 | $param = array( |
40 | 40 | 'site' => 'unittest', 'lang' => 'de', |
41 | - 'sort' => array( '-log.timestamp' ), |
|
41 | + 'sort' => array('-log.timestamp'), |
|
42 | 42 | ); |
43 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
44 | - $this->view->addHelper( 'param', $helper ); |
|
43 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
44 | + $this->view->addHelper('param', $helper); |
|
45 | 45 | |
46 | 46 | $result = $this->object->search(); |
47 | 47 | |
48 | - $this->assertContains( '>unittest facility<', $result ); |
|
48 | + $this->assertContains('>unittest facility<', $result); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testSearchException() |
53 | 53 | { |
54 | - $object = $this->getClientMock( 'initCriteria' ); |
|
54 | + $object = $this->getClientMock('initCriteria'); |
|
55 | 55 | |
56 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
57 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
56 | + $object->expects($this->once())->method('initCriteria') |
|
57 | + ->will($this->throwException(new \RuntimeException())); |
|
58 | 58 | |
59 | 59 | $object->search(); |
60 | 60 | } |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | |
63 | 63 | public function testSearchMShopException() |
64 | 64 | { |
65 | - $object = $this->getClientMock( 'initCriteria' ); |
|
65 | + $object = $this->getClientMock('initCriteria'); |
|
66 | 66 | |
67 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
68 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
67 | + $object->expects($this->once())->method('initCriteria') |
|
68 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
69 | 69 | |
70 | 70 | $object->search(); |
71 | 71 | } |
@@ -73,27 +73,27 @@ discard block |
||
73 | 73 | |
74 | 74 | public function testGetSubClientInvalid() |
75 | 75 | { |
76 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
77 | - $this->object->getSubClient( '$unknown$' ); |
|
76 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
77 | + $this->object->getSubClient('$unknown$'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
81 | 81 | public function testGetSubClientUnknown() |
82 | 82 | { |
83 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
84 | - $this->object->getSubClient( 'unknown' ); |
|
83 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
84 | + $this->object->getSubClient('unknown'); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | - public function getClientMock( $method ) |
|
88 | + public function getClientMock($method) |
|
89 | 89 | { |
90 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Log\Standard' ) |
|
91 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
92 | - ->setMethods( [$method] ) |
|
90 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Log\Standard') |
|
91 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
92 | + ->setMethods([$method]) |
|
93 | 93 | ->getMock(); |
94 | 94 | |
95 | - $object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
96 | - $object->setView( $this->getViewNoRender() ); |
|
95 | + $object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
96 | + $object->setView($this->getViewNoRender()); |
|
97 | 97 | |
98 | 98 | return $object; |
99 | 99 | } |
@@ -101,17 +101,17 @@ discard block |
||
101 | 101 | |
102 | 102 | protected function getViewNoRender() |
103 | 103 | { |
104 | - $view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' ) |
|
105 | - ->setConstructorArgs( array( [] ) ) |
|
106 | - ->setMethods( array( 'render', 'config' ) ) |
|
104 | + $view = $this->getMockBuilder('\Aimeos\MW\View\Standard') |
|
105 | + ->setConstructorArgs(array([])) |
|
106 | + ->setMethods(array('render', 'config')) |
|
107 | 107 | ->getMock(); |
108 | 108 | |
109 | 109 | $param = ['site' => 'unittest']; |
110 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
111 | - $view->addHelper( 'param', $helper ); |
|
110 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
111 | + $view->addHelper('param', $helper); |
|
112 | 112 | |
113 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
114 | - $view->addHelper( 'access', $helper ); |
|
113 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
114 | + $view->addHelper('access', $helper); |
|
115 | 115 | |
116 | 116 | return $view; |
117 | 117 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Log\Factory::createClient( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Log\Factory::createClient($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Log\Factory::createClient( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Log\Factory::createClient($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Log\Factory::createClient( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Log\Factory::createClient($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Log\Factory::createClient( $this->context, '%log' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Log\Factory::createClient($this->context, '%log'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Log\Factory::createClient( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Log\Factory::createClient($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |