@@ -8,30 +8,30 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | |
11 | -$target = $this->config( 'admin/jqadm/url/search/target' ); |
|
12 | -$controller = $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 | +$target = $this->config('admin/jqadm/url/search/target'); |
|
12 | +$controller = $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 | -$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 | -$copyTarget = $this->config( 'admin/jqadm/url/copy/target' ); |
|
27 | -$copyCntl = $this->config( 'admin/jqadm/url/copy/controller', 'Jqadm' ); |
|
28 | -$copyAction = $this->config( 'admin/jqadm/url/copy/action', 'copy' ); |
|
29 | -$copyConfig = $this->config( 'admin/jqadm/url/copy/config', [] ); |
|
26 | +$copyTarget = $this->config('admin/jqadm/url/copy/target'); |
|
27 | +$copyCntl = $this->config('admin/jqadm/url/copy/controller', 'Jqadm'); |
|
28 | +$copyAction = $this->config('admin/jqadm/url/copy/action', 'copy'); |
|
29 | +$copyConfig = $this->config('admin/jqadm/url/copy/config', []); |
|
30 | 30 | |
31 | -$delTarget = $this->config( 'admin/jqadm/url/delete/target' ); |
|
32 | -$delCntl = $this->config( 'admin/jqadm/url/delete/controller', 'Jqadm' ); |
|
33 | -$delAction = $this->config( 'admin/jqadm/url/delete/action', 'delete' ); |
|
34 | -$delConfig = $this->config( 'admin/jqadm/url/delete/config', [] ); |
|
31 | +$delTarget = $this->config('admin/jqadm/url/delete/target'); |
|
32 | +$delCntl = $this->config('admin/jqadm/url/delete/controller', 'Jqadm'); |
|
33 | +$delAction = $this->config('admin/jqadm/url/delete/action', 'delete'); |
|
34 | +$delConfig = $this->config('admin/jqadm/url/delete/config', []); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** admin/jqadm/coupon/fields |
@@ -49,40 +49,40 @@ discard block |
||
49 | 49 | * @category Developer |
50 | 50 | */ |
51 | 51 | $default = ['coupon.status', 'coupon.label', 'coupon.provider']; |
52 | -$default = $this->config( 'admin/jqadm/coupon/fields', $default ); |
|
53 | -$fields = $this->session( 'aimeos/admin/jqadm/coupon/fields', $default ); |
|
52 | +$default = $this->config('admin/jqadm/coupon/fields', $default); |
|
53 | +$fields = $this->session('aimeos/admin/jqadm/coupon/fields', $default); |
|
54 | 54 | |
55 | -$searchParams = $params = $this->get( 'pageParams', [] ); |
|
55 | +$searchParams = $params = $this->get('pageParams', []); |
|
56 | 56 | $searchParams['page']['start'] = 0; |
57 | 57 | |
58 | 58 | $columnList = [ |
59 | - 'coupon.id' => $this->translate( 'admin', 'ID' ), |
|
60 | - 'coupon.status' => $this->translate( 'admin', 'Status' ), |
|
61 | - 'coupon.provider' => $this->translate( 'admin', 'Provider' ), |
|
62 | - 'coupon.label' => $this->translate( 'admin', 'Label' ), |
|
63 | - 'coupon.datestart' => $this->translate( 'admin', 'Start date' ), |
|
64 | - 'coupon.dateend' => $this->translate( 'admin', 'End date' ), |
|
65 | - 'coupon.config' => $this->translate( 'admin', 'Config' ), |
|
66 | - 'coupon.ctime' => $this->translate( 'admin', 'Created' ), |
|
67 | - 'coupon.mtime' => $this->translate( 'admin', 'Modified' ), |
|
68 | - 'coupon.editor' => $this->translate( 'admin', 'Editor' ), |
|
59 | + 'coupon.id' => $this->translate('admin', 'ID'), |
|
60 | + 'coupon.status' => $this->translate('admin', 'Status'), |
|
61 | + 'coupon.provider' => $this->translate('admin', 'Provider'), |
|
62 | + 'coupon.label' => $this->translate('admin', 'Label'), |
|
63 | + 'coupon.datestart' => $this->translate('admin', 'Start date'), |
|
64 | + 'coupon.dateend' => $this->translate('admin', 'End date'), |
|
65 | + 'coupon.config' => $this->translate('admin', 'Config'), |
|
66 | + 'coupon.ctime' => $this->translate('admin', 'Created'), |
|
67 | + 'coupon.mtime' => $this->translate('admin', 'Modified'), |
|
68 | + 'coupon.editor' => $this->translate('admin', 'Editor'), |
|
69 | 69 | ]; |
70 | 70 | |
71 | 71 | ?> |
72 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
72 | +<?php $this->block()->start('jqadm_content'); ?> |
|
73 | 73 | |
74 | 74 | <nav class="main-navbar"> |
75 | 75 | |
76 | 76 | <span class="navbar-brand"> |
77 | - <?= $enc->html( $this->translate( 'admin', 'Voucher' ) ); ?> |
|
78 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span> |
|
77 | + <?= $enc->html($this->translate('admin', 'Voucher')); ?> |
|
78 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span> |
|
79 | 79 | </span> |
80 | 80 | |
81 | 81 | <?= $this->partial( |
82 | - $this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php' ), [ |
|
83 | - 'filter' => $this->session( 'aimeos/admin/jqadm/coupon/filter', [] ), |
|
84 | - 'filterAttributes' => $this->get( 'filterAttributes', [] ), |
|
85 | - 'filterOperators' => $this->get( 'filterOperators', [] ), |
|
82 | + $this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php'), [ |
|
83 | + 'filter' => $this->session('aimeos/admin/jqadm/coupon/filter', []), |
|
84 | + 'filterAttributes' => $this->get('filterAttributes', []), |
|
85 | + 'filterOperators' => $this->get('filterOperators', []), |
|
86 | 86 | 'params' => $params, |
87 | 87 | ] |
88 | 88 | ); ?> |
@@ -90,33 +90,33 @@ discard block |
||
90 | 90 | |
91 | 91 | |
92 | 92 | <?= $this->partial( |
93 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
94 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ), |
|
95 | - 'page' => $this->session( 'aimeos/admin/jqadm/coupon/page', [] )] |
|
93 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
94 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'), |
|
95 | + 'page' => $this->session('aimeos/admin/jqadm/coupon/page', [])] |
|
96 | 96 | ); |
97 | 97 | ?> |
98 | 98 | |
99 | -<form class="list list-product" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>"> |
|
99 | +<form class="list list-product" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>"> |
|
100 | 100 | <?= $this->csrf()->formfield(); ?> |
101 | 101 | |
102 | 102 | <table class="list-items table table-hover table-striped"> |
103 | 103 | <thead class="list-header"> |
104 | 104 | <tr> |
105 | 105 | <?= $this->partial( |
106 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php' ), |
|
107 | - ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/coupon/sort' )] |
|
106 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php'), |
|
107 | + ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/coupon/sort')] |
|
108 | 108 | ); |
109 | 109 | ?> |
110 | 110 | |
111 | 111 | <th class="actions"> |
112 | 112 | <a class="btn fa act-add" tabindex="1" |
113 | - href="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, $params, [], $newConfig ) ); ?>" |
|
114 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
115 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>"> |
|
113 | + href="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, $params, [], $newConfig)); ?>" |
|
114 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
115 | + aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>"> |
|
116 | 116 | </a> |
117 | 117 | |
118 | 118 | <?= $this->partial( |
119 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard.php' ), |
|
119 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard.php'), |
|
120 | 120 | ['fields' => $fields, 'data' => $columnList] |
121 | 121 | ); |
122 | 122 | ?> |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | <tbody> |
127 | 127 | |
128 | 128 | <?= $this->partial( |
129 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php' ), [ |
|
130 | - 'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/coupon/filter', [] ), |
|
129 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php'), [ |
|
130 | + 'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/coupon/filter', []), |
|
131 | 131 | 'data' => [ |
132 | 132 | 'coupon.id' => ['op' => '=='], |
133 | 133 | 'coupon.status' => ['op' => '==', 'type' => 'select', 'val' => [ |
134 | - '1' => $this->translate( 'mshop/code', 'status:1' ), |
|
135 | - '0' => $this->translate( 'mshop/code', 'status:0' ), |
|
136 | - '-1' => $this->translate( 'mshop/code', 'status:-1' ), |
|
137 | - '-2' => $this->translate( 'mshop/code', 'status:-2' ), |
|
134 | + '1' => $this->translate('mshop/code', 'status:1'), |
|
135 | + '0' => $this->translate('mshop/code', 'status:0'), |
|
136 | + '-1' => $this->translate('mshop/code', 'status:-1'), |
|
137 | + '-2' => $this->translate('mshop/code', 'status:-2'), |
|
138 | 138 | ]], |
139 | 139 | 'coupon.provider' => [], |
140 | 140 | 'coupon.label' => [], |
@@ -148,58 +148,58 @@ discard block |
||
148 | 148 | ] ); |
149 | 149 | ?> |
150 | 150 | |
151 | - <?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?> |
|
152 | - <?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?> |
|
153 | - <tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>"> |
|
154 | - <?php if( in_array( 'coupon.id', $fields ) ) : ?> |
|
155 | - <td class="coupon-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td> |
|
151 | + <?php foreach ($this->get('items', []) as $id => $item) : ?> |
|
152 | + <?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?> |
|
153 | + <tr class="<?= $this->site()->readonly($item->getSiteId()); ?>"> |
|
154 | + <?php if (in_array('coupon.id', $fields)) : ?> |
|
155 | + <td class="coupon-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td> |
|
156 | 156 | <?php endif; ?> |
157 | - <?php if( in_array( 'coupon.status', $fields ) ) : ?> |
|
158 | - <td class="coupon-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr( $item->getStatus() ); ?>"></div></a></td> |
|
157 | + <?php if (in_array('coupon.status', $fields)) : ?> |
|
158 | + <td class="coupon-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr($item->getStatus()); ?>"></div></a></td> |
|
159 | 159 | <?php endif; ?> |
160 | - <?php if( in_array( 'coupon.provider', $fields ) ) : ?> |
|
161 | - <td class="coupon-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getProvider() ); ?></a></td> |
|
160 | + <?php if (in_array('coupon.provider', $fields)) : ?> |
|
161 | + <td class="coupon-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getProvider()); ?></a></td> |
|
162 | 162 | <?php endif; ?> |
163 | - <?php if( in_array( 'coupon.label', $fields ) ) : ?> |
|
164 | - <td class="coupon-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getLabel() ); ?></a></td> |
|
163 | + <?php if (in_array('coupon.label', $fields)) : ?> |
|
164 | + <td class="coupon-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getLabel()); ?></a></td> |
|
165 | 165 | <?php endif; ?> |
166 | - <?php if( in_array( 'coupon.datestart', $fields ) ) : ?> |
|
167 | - <td class="coupon-datestart"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateStart() ); ?></a></td> |
|
166 | + <?php if (in_array('coupon.datestart', $fields)) : ?> |
|
167 | + <td class="coupon-datestart"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateStart()); ?></a></td> |
|
168 | 168 | <?php endif; ?> |
169 | - <?php if( in_array( 'coupon.dateend', $fields ) ) : ?> |
|
170 | - <td class="coupon-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateEnd() ); ?></a></td> |
|
169 | + <?php if (in_array('coupon.dateend', $fields)) : ?> |
|
170 | + <td class="coupon-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateEnd()); ?></a></td> |
|
171 | 171 | <?php endif; ?> |
172 | - <?php if( in_array( 'coupon.config', $fields ) ) : ?> |
|
172 | + <?php if (in_array('coupon.config', $fields)) : ?> |
|
173 | 173 | <td class="coupon-config config-item"> |
174 | 174 | <a class="items-field" href="<?= $url; ?>"> |
175 | - <?php foreach( $item->getConfig() as $key => $value ) : ?> |
|
176 | - <span class="config-key"><?= $enc->html( $key ); ?></span> |
|
177 | - <span class="config-value"><?= $enc->html( !is_scalar( $value ) ? json_encode( $value ) : $value ); ?></span> |
|
175 | + <?php foreach ($item->getConfig() as $key => $value) : ?> |
|
176 | + <span class="config-key"><?= $enc->html($key); ?></span> |
|
177 | + <span class="config-value"><?= $enc->html(!is_scalar($value) ? json_encode($value) : $value); ?></span> |
|
178 | 178 | <br/> |
179 | 179 | <?php endforeach; ?> |
180 | 180 | </a> |
181 | 181 | </td> |
182 | 182 | <?php endif; ?> |
183 | - <?php if( in_array( 'coupon.ctime', $fields ) ) : ?> |
|
184 | - <td class="coupon-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td> |
|
183 | + <?php if (in_array('coupon.ctime', $fields)) : ?> |
|
184 | + <td class="coupon-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td> |
|
185 | 185 | <?php endif; ?> |
186 | - <?php if( in_array( 'coupon.mtime', $fields ) ) : ?> |
|
187 | - <td class="coupon-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td> |
|
186 | + <?php if (in_array('coupon.mtime', $fields)) : ?> |
|
187 | + <td class="coupon-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td> |
|
188 | 188 | <?php endif; ?> |
189 | - <?php if( in_array( 'coupon.editor', $fields ) ) : ?> |
|
190 | - <td class="coupon-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td> |
|
189 | + <?php if (in_array('coupon.editor', $fields)) : ?> |
|
190 | + <td class="coupon-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td> |
|
191 | 191 | <?php endif; ?> |
192 | 192 | |
193 | 193 | <td class="actions"> |
194 | 194 | <a class="btn act-copy fa" tabindex="1" |
195 | - href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>" |
|
196 | - title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>" |
|
197 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a> |
|
198 | - <?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?> |
|
195 | + href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>" |
|
196 | + title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>" |
|
197 | + aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a> |
|
198 | + <?php if (!$this->site()->readonly($item->getSiteId())) : ?> |
|
199 | 199 | <a class="btn act-delete fa" tabindex="1" |
200 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'coupon', 'id' => $id] + $params, [], $delConfig ) ); ?>" |
|
201 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
202 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
200 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'coupon', 'id' => $id] + $params, [], $delConfig)); ?>" |
|
201 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
202 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
203 | 203 | <?php endif; ?> |
204 | 204 | </td> |
205 | 205 | </tr> |
@@ -207,18 +207,18 @@ discard block |
||
207 | 207 | </tbody> |
208 | 208 | </table> |
209 | 209 | |
210 | - <?php if( $this->get( 'items', [] ) === [] ) : ?> |
|
211 | - <?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?> |
|
210 | + <?php if ($this->get('items', []) === []) : ?> |
|
211 | + <?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?> |
|
212 | 212 | <?php endif; ?> |
213 | 213 | </form> |
214 | 214 | |
215 | 215 | <?= $this->partial( |
216 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
217 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ), |
|
218 | - 'page' => $this->session( 'aimeos/admin/jqadm/coupon/page', [] )] |
|
216 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
217 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'), |
|
218 | + 'page' => $this->session('aimeos/admin/jqadm/coupon/page', [])] |
|
219 | 219 | ); |
220 | 220 | ?> |
221 | 221 | |
222 | 222 | <?php $this->block()->stop(); ?> |
223 | 223 | |
224 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?> |
|
224 | +<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?> |
@@ -8,30 +8,30 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | |
11 | -$target = $this->config( 'admin/jqadm/url/search/target' ); |
|
12 | -$controller = $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 | +$target = $this->config('admin/jqadm/url/search/target'); |
|
12 | +$controller = $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 | -$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 | -$copyTarget = $this->config( 'admin/jqadm/url/copy/target' ); |
|
27 | -$copyCntl = $this->config( 'admin/jqadm/url/copy/controller', 'Jqadm' ); |
|
28 | -$copyAction = $this->config( 'admin/jqadm/url/copy/action', 'copy' ); |
|
29 | -$copyConfig = $this->config( 'admin/jqadm/url/copy/config', [] ); |
|
26 | +$copyTarget = $this->config('admin/jqadm/url/copy/target'); |
|
27 | +$copyCntl = $this->config('admin/jqadm/url/copy/controller', 'Jqadm'); |
|
28 | +$copyAction = $this->config('admin/jqadm/url/copy/action', 'copy'); |
|
29 | +$copyConfig = $this->config('admin/jqadm/url/copy/config', []); |
|
30 | 30 | |
31 | -$delTarget = $this->config( 'admin/jqadm/url/delete/target' ); |
|
32 | -$delCntl = $this->config( 'admin/jqadm/url/delete/controller', 'Jqadm' ); |
|
33 | -$delAction = $this->config( 'admin/jqadm/url/delete/action', 'delete' ); |
|
34 | -$delConfig = $this->config( 'admin/jqadm/url/delete/config', [] ); |
|
31 | +$delTarget = $this->config('admin/jqadm/url/delete/target'); |
|
32 | +$delCntl = $this->config('admin/jqadm/url/delete/controller', 'Jqadm'); |
|
33 | +$delAction = $this->config('admin/jqadm/url/delete/action', 'delete'); |
|
34 | +$delConfig = $this->config('admin/jqadm/url/delete/config', []); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** admin/jqadm/service/fields |
@@ -49,48 +49,48 @@ discard block |
||
49 | 49 | * @category Developer |
50 | 50 | */ |
51 | 51 | $default = ['service.status', 'service.typeid', 'service.label', 'service.provider']; |
52 | -$default = $this->config( 'admin/jqadm/service/fields', $default ); |
|
53 | -$fields = $this->session( 'aimeos/admin/jqadm/service/fields', $default ); |
|
52 | +$default = $this->config('admin/jqadm/service/fields', $default); |
|
53 | +$fields = $this->session('aimeos/admin/jqadm/service/fields', $default); |
|
54 | 54 | |
55 | -$searchParams = $params = $this->get( 'pageParams', [] ); |
|
55 | +$searchParams = $params = $this->get('pageParams', []); |
|
56 | 56 | $searchParams['page']['start'] = 0; |
57 | 57 | |
58 | 58 | $typeList = []; |
59 | -foreach( $this->get( 'itemTypes', [] ) as $id => $typeItem ) { |
|
59 | +foreach ($this->get('itemTypes', []) as $id => $typeItem) { |
|
60 | 60 | $typeList[$id] = $typeItem->getCode(); |
61 | 61 | } |
62 | 62 | |
63 | 63 | $columnList = [ |
64 | - 'service.id' => $this->translate( 'admin', 'ID' ), |
|
65 | - 'service.status' => $this->translate( 'admin', 'Status' ), |
|
66 | - 'service.typeid' => $this->translate( 'admin', 'Type' ), |
|
67 | - 'service.position' => $this->translate( 'admin', 'Position' ), |
|
68 | - 'service.code' => $this->translate( 'admin', 'Code' ), |
|
69 | - 'service.label' => $this->translate( 'admin', 'Label' ), |
|
70 | - 'service.provider' => $this->translate( 'admin', 'Provider' ), |
|
71 | - 'service.datestart' => $this->translate( 'admin', 'Start date' ), |
|
72 | - 'service.dateend' => $this->translate( 'admin', 'End date' ), |
|
73 | - 'service.config' => $this->translate( 'admin', 'Config' ), |
|
74 | - 'service.ctime' => $this->translate( 'admin', 'Created' ), |
|
75 | - 'service.mtime' => $this->translate( 'admin', 'Modified' ), |
|
76 | - 'service.editor' => $this->translate( 'admin', 'Editor' ), |
|
64 | + 'service.id' => $this->translate('admin', 'ID'), |
|
65 | + 'service.status' => $this->translate('admin', 'Status'), |
|
66 | + 'service.typeid' => $this->translate('admin', 'Type'), |
|
67 | + 'service.position' => $this->translate('admin', 'Position'), |
|
68 | + 'service.code' => $this->translate('admin', 'Code'), |
|
69 | + 'service.label' => $this->translate('admin', 'Label'), |
|
70 | + 'service.provider' => $this->translate('admin', 'Provider'), |
|
71 | + 'service.datestart' => $this->translate('admin', 'Start date'), |
|
72 | + 'service.dateend' => $this->translate('admin', 'End date'), |
|
73 | + 'service.config' => $this->translate('admin', 'Config'), |
|
74 | + 'service.ctime' => $this->translate('admin', 'Created'), |
|
75 | + 'service.mtime' => $this->translate('admin', 'Modified'), |
|
76 | + 'service.editor' => $this->translate('admin', 'Editor'), |
|
77 | 77 | ]; |
78 | 78 | |
79 | 79 | ?> |
80 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
80 | +<?php $this->block()->start('jqadm_content'); ?> |
|
81 | 81 | |
82 | 82 | <nav class="main-navbar"> |
83 | 83 | |
84 | 84 | <span class="navbar-brand"> |
85 | - <?= $enc->html( $this->translate( 'admin', 'Service' ) ); ?> |
|
86 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span> |
|
85 | + <?= $enc->html($this->translate('admin', 'Service')); ?> |
|
86 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span> |
|
87 | 87 | </span> |
88 | 88 | |
89 | 89 | <?= $this->partial( |
90 | - $this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php' ), [ |
|
91 | - 'filter' => $this->session( 'aimeos/admin/jqadm/service/filter', [] ), |
|
92 | - 'filterAttributes' => $this->get( 'filterAttributes', [] ), |
|
93 | - 'filterOperators' => $this->get( 'filterOperators', [] ), |
|
90 | + $this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php'), [ |
|
91 | + 'filter' => $this->session('aimeos/admin/jqadm/service/filter', []), |
|
92 | + 'filterAttributes' => $this->get('filterAttributes', []), |
|
93 | + 'filterOperators' => $this->get('filterOperators', []), |
|
94 | 94 | 'params' => $params, |
95 | 95 | ] |
96 | 96 | ); ?> |
@@ -98,33 +98,33 @@ discard block |
||
98 | 98 | |
99 | 99 | |
100 | 100 | <?= $this->partial( |
101 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
102 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ), |
|
103 | - 'page' => $this->session( 'aimeos/admin/jqadm/service/page', [] )] |
|
101 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
102 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'), |
|
103 | + 'page' => $this->session('aimeos/admin/jqadm/service/page', [])] |
|
104 | 104 | ); |
105 | 105 | ?> |
106 | 106 | |
107 | -<form class="list list-product" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>"> |
|
107 | +<form class="list list-product" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>"> |
|
108 | 108 | <?= $this->csrf()->formfield(); ?> |
109 | 109 | |
110 | 110 | <table class="list-items table table-hover table-striped"> |
111 | 111 | <thead class="list-header"> |
112 | 112 | <tr> |
113 | 113 | <?= $this->partial( |
114 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php' ), |
|
115 | - ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/service/sort' )] |
|
114 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php'), |
|
115 | + ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/service/sort')] |
|
116 | 116 | ); |
117 | 117 | ?> |
118 | 118 | |
119 | 119 | <th class="actions"> |
120 | 120 | <a class="btn fa act-add" tabindex="1" |
121 | - href="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, $params, [], $newConfig ) ); ?>" |
|
122 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
123 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>"> |
|
121 | + href="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, $params, [], $newConfig)); ?>" |
|
122 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
123 | + aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>"> |
|
124 | 124 | </a> |
125 | 125 | |
126 | 126 | <?= $this->partial( |
127 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard.php' ), |
|
127 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard.php'), |
|
128 | 128 | ['fields' => $fields, 'data' => $columnList] |
129 | 129 | ); |
130 | 130 | ?> |
@@ -134,15 +134,15 @@ discard block |
||
134 | 134 | <tbody> |
135 | 135 | |
136 | 136 | <?= $this->partial( |
137 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php' ), [ |
|
138 | - 'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/service/filter', [] ), |
|
137 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php'), [ |
|
138 | + 'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/service/filter', []), |
|
139 | 139 | 'data' => [ |
140 | 140 | 'service.id' => ['op' => '=='], |
141 | 141 | 'service.status' => ['op' => '==', 'type' => 'select', 'val' => [ |
142 | - '1' => $this->translate( 'mshop/code', 'status:1' ), |
|
143 | - '0' => $this->translate( 'mshop/code', 'status:0' ), |
|
144 | - '-1' => $this->translate( 'mshop/code', 'status:-1' ), |
|
145 | - '-2' => $this->translate( 'mshop/code', 'status:-2' ), |
|
142 | + '1' => $this->translate('mshop/code', 'status:1'), |
|
143 | + '0' => $this->translate('mshop/code', 'status:0'), |
|
144 | + '-1' => $this->translate('mshop/code', 'status:-1'), |
|
145 | + '-2' => $this->translate('mshop/code', 'status:-2'), |
|
146 | 146 | ]], |
147 | 147 | 'service.typeid' => ['op' => '==', 'type' => 'select', 'val' => $typeList], |
148 | 148 | 'service.position' => ['op' => '>=', 'type' => 'number'], |
@@ -159,67 +159,67 @@ discard block |
||
159 | 159 | ] ); |
160 | 160 | ?> |
161 | 161 | |
162 | - <?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?> |
|
163 | - <?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?> |
|
164 | - <tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>"> |
|
165 | - <?php if( in_array( 'service.id', $fields ) ) : ?> |
|
166 | - <td class="service-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td> |
|
162 | + <?php foreach ($this->get('items', []) as $id => $item) : ?> |
|
163 | + <?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?> |
|
164 | + <tr class="<?= $this->site()->readonly($item->getSiteId()); ?>"> |
|
165 | + <?php if (in_array('service.id', $fields)) : ?> |
|
166 | + <td class="service-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td> |
|
167 | 167 | <?php endif; ?> |
168 | - <?php if( in_array( 'service.status', $fields ) ) : ?> |
|
169 | - <td class="service-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr( $item->getStatus() ); ?>"></div></a></td> |
|
168 | + <?php if (in_array('service.status', $fields)) : ?> |
|
169 | + <td class="service-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr($item->getStatus()); ?>"></div></a></td> |
|
170 | 170 | <?php endif; ?> |
171 | - <?php if( in_array( 'service.typeid', $fields ) ) : ?> |
|
172 | - <td class="service-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getType() ); ?></a></td> |
|
171 | + <?php if (in_array('service.typeid', $fields)) : ?> |
|
172 | + <td class="service-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getType()); ?></a></td> |
|
173 | 173 | <?php endif; ?> |
174 | - <?php if( in_array( 'service.position', $fields ) ) : ?> |
|
175 | - <td class="service-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getPosition() ); ?></a></td> |
|
174 | + <?php if (in_array('service.position', $fields)) : ?> |
|
175 | + <td class="service-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getPosition()); ?></a></td> |
|
176 | 176 | <?php endif; ?> |
177 | - <?php if( in_array( 'service.code', $fields ) ) : ?> |
|
178 | - <td class="service-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getCode() ); ?></a></td> |
|
177 | + <?php if (in_array('service.code', $fields)) : ?> |
|
178 | + <td class="service-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getCode()); ?></a></td> |
|
179 | 179 | <?php endif; ?> |
180 | - <?php if( in_array( 'service.label', $fields ) ) : ?> |
|
181 | - <td class="service-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getLabel() ); ?></a></td> |
|
180 | + <?php if (in_array('service.label', $fields)) : ?> |
|
181 | + <td class="service-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getLabel()); ?></a></td> |
|
182 | 182 | <?php endif; ?> |
183 | - <?php if( in_array( 'service.provider', $fields ) ) : ?> |
|
184 | - <td class="service-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getProvider() ); ?></a></td> |
|
183 | + <?php if (in_array('service.provider', $fields)) : ?> |
|
184 | + <td class="service-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getProvider()); ?></a></td> |
|
185 | 185 | <?php endif; ?> |
186 | - <?php if( in_array( 'service.datestart', $fields ) ) : ?> |
|
187 | - <td class="service-datestart"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateStart() ); ?></a></td> |
|
186 | + <?php if (in_array('service.datestart', $fields)) : ?> |
|
187 | + <td class="service-datestart"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateStart()); ?></a></td> |
|
188 | 188 | <?php endif; ?> |
189 | - <?php if( in_array( 'service.dateend', $fields ) ) : ?> |
|
190 | - <td class="service-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateEnd() ); ?></a></td> |
|
189 | + <?php if (in_array('service.dateend', $fields)) : ?> |
|
190 | + <td class="service-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateEnd()); ?></a></td> |
|
191 | 191 | <?php endif; ?> |
192 | - <?php if( in_array( 'service.config', $fields ) ) : ?> |
|
192 | + <?php if (in_array('service.config', $fields)) : ?> |
|
193 | 193 | <td class="service-config config-item"> |
194 | 194 | <a class="items-field" href="<?= $url; ?>"> |
195 | - <?php foreach( $item->getConfig() as $key => $value ) : ?> |
|
196 | - <span class="config-key"><?= $enc->html( $key ); ?></span> |
|
197 | - <span class="config-value"><?= $enc->html( !is_scalar( $value ) ? json_encode( $value ) : $value ); ?></span> |
|
195 | + <?php foreach ($item->getConfig() as $key => $value) : ?> |
|
196 | + <span class="config-key"><?= $enc->html($key); ?></span> |
|
197 | + <span class="config-value"><?= $enc->html(!is_scalar($value) ? json_encode($value) : $value); ?></span> |
|
198 | 198 | <br/> |
199 | 199 | <?php endforeach; ?> |
200 | 200 | </a> |
201 | 201 | </td> |
202 | 202 | <?php endif; ?> |
203 | - <?php if( in_array( 'service.ctime', $fields ) ) : ?> |
|
204 | - <td class="service-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td> |
|
203 | + <?php if (in_array('service.ctime', $fields)) : ?> |
|
204 | + <td class="service-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td> |
|
205 | 205 | <?php endif; ?> |
206 | - <?php if( in_array( 'service.mtime', $fields ) ) : ?> |
|
207 | - <td class="service-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td> |
|
206 | + <?php if (in_array('service.mtime', $fields)) : ?> |
|
207 | + <td class="service-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td> |
|
208 | 208 | <?php endif; ?> |
209 | - <?php if( in_array( 'service.editor', $fields ) ) : ?> |
|
210 | - <td class="service-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td> |
|
209 | + <?php if (in_array('service.editor', $fields)) : ?> |
|
210 | + <td class="service-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td> |
|
211 | 211 | <?php endif; ?> |
212 | 212 | |
213 | 213 | <td class="actions"> |
214 | 214 | <a class="btn act-copy fa" tabindex="1" |
215 | - href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>" |
|
216 | - title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>" |
|
217 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a> |
|
218 | - <?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?> |
|
215 | + href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>" |
|
216 | + title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>" |
|
217 | + aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a> |
|
218 | + <?php if (!$this->site()->readonly($item->getSiteId())) : ?> |
|
219 | 219 | <a class="btn act-delete fa" tabindex="1" |
220 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'service', 'id' => $id] + $params, [], $delConfig ) ); ?>" |
|
221 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
222 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
220 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'service', 'id' => $id] + $params, [], $delConfig)); ?>" |
|
221 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
222 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
223 | 223 | <?php endif; ?> |
224 | 224 | </td> |
225 | 225 | </tr> |
@@ -227,18 +227,18 @@ discard block |
||
227 | 227 | </tbody> |
228 | 228 | </table> |
229 | 229 | |
230 | - <?php if( $this->get( 'items', [] ) === [] ) : ?> |
|
231 | - <?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?> |
|
230 | + <?php if ($this->get('items', []) === []) : ?> |
|
231 | + <?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?> |
|
232 | 232 | <?php endif; ?> |
233 | 233 | </form> |
234 | 234 | |
235 | 235 | <?= $this->partial( |
236 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
237 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ), |
|
238 | - 'page' => $this->session( 'aimeos/admin/jqadm/service/page', [] )] |
|
236 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
237 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'), |
|
238 | + 'page' => $this->session('aimeos/admin/jqadm/service/page', [])] |
|
239 | 239 | ); |
240 | 240 | ?> |
241 | 241 | |
242 | 242 | <?php $this->block()->stop(); ?> |
243 | 243 | |
244 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?> |
|
244 | +<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?> |
@@ -8,30 +8,30 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | |
11 | -$target = $this->config( 'admin/jqadm/url/search/target' ); |
|
12 | -$controller = $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 | +$target = $this->config('admin/jqadm/url/search/target'); |
|
12 | +$controller = $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 | -$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 | -$copyTarget = $this->config( 'admin/jqadm/url/copy/target' ); |
|
27 | -$copyCntl = $this->config( 'admin/jqadm/url/copy/controller', 'Jqadm' ); |
|
28 | -$copyAction = $this->config( 'admin/jqadm/url/copy/action', 'copy' ); |
|
29 | -$copyConfig = $this->config( 'admin/jqadm/url/copy/config', [] ); |
|
26 | +$copyTarget = $this->config('admin/jqadm/url/copy/target'); |
|
27 | +$copyCntl = $this->config('admin/jqadm/url/copy/controller', 'Jqadm'); |
|
28 | +$copyAction = $this->config('admin/jqadm/url/copy/action', 'copy'); |
|
29 | +$copyConfig = $this->config('admin/jqadm/url/copy/config', []); |
|
30 | 30 | |
31 | -$delTarget = $this->config( 'admin/jqadm/url/delete/target' ); |
|
32 | -$delCntl = $this->config( 'admin/jqadm/url/delete/controller', 'Jqadm' ); |
|
33 | -$delAction = $this->config( 'admin/jqadm/url/delete/action', 'delete' ); |
|
34 | -$delConfig = $this->config( 'admin/jqadm/url/delete/config', [] ); |
|
31 | +$delTarget = $this->config('admin/jqadm/url/delete/target'); |
|
32 | +$delCntl = $this->config('admin/jqadm/url/delete/controller', 'Jqadm'); |
|
33 | +$delAction = $this->config('admin/jqadm/url/delete/action', 'delete'); |
|
34 | +$delConfig = $this->config('admin/jqadm/url/delete/config', []); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** admin/jqadm/plugin/fields |
@@ -49,45 +49,45 @@ discard block |
||
49 | 49 | * @category Developer |
50 | 50 | */ |
51 | 51 | $default = ['plugin.status', 'plugin.label', 'plugin.provider', 'plugin.position']; |
52 | -$default = $this->config( 'admin/jqadm/plugin/fields', $default ); |
|
53 | -$fields = $this->session( 'aimeos/admin/jqadm/plugin/fields', $default ); |
|
52 | +$default = $this->config('admin/jqadm/plugin/fields', $default); |
|
53 | +$fields = $this->session('aimeos/admin/jqadm/plugin/fields', $default); |
|
54 | 54 | |
55 | -$searchParams = $params = $this->get( 'pageParams', [] ); |
|
55 | +$searchParams = $params = $this->get('pageParams', []); |
|
56 | 56 | $searchParams['page']['start'] = 0; |
57 | 57 | |
58 | 58 | $typeList = []; |
59 | -foreach( $this->get( 'itemTypes', [] ) as $id => $typeItem ) { |
|
59 | +foreach ($this->get('itemTypes', []) as $id => $typeItem) { |
|
60 | 60 | $typeList[$id] = $typeItem->getCode(); |
61 | 61 | } |
62 | 62 | |
63 | 63 | $columnList = [ |
64 | - 'plugin.id' => $this->translate( 'admin', 'ID' ), |
|
65 | - 'plugin.status' => $this->translate( 'admin', 'Status' ), |
|
66 | - 'plugin.typeid' => $this->translate( 'admin', 'Type' ), |
|
67 | - 'plugin.position' => $this->translate( 'admin', 'Position' ), |
|
68 | - 'plugin.label' => $this->translate( 'admin', 'Label' ), |
|
69 | - 'plugin.provider' => $this->translate( 'admin', 'Provider' ), |
|
70 | - 'plugin.config' => $this->translate( 'admin', 'Config' ), |
|
71 | - 'plugin.ctime' => $this->translate( 'admin', 'Created' ), |
|
72 | - 'plugin.mtime' => $this->translate( 'admin', 'Modified' ), |
|
73 | - 'plugin.editor' => $this->translate( 'admin', 'Editor' ), |
|
64 | + 'plugin.id' => $this->translate('admin', 'ID'), |
|
65 | + 'plugin.status' => $this->translate('admin', 'Status'), |
|
66 | + 'plugin.typeid' => $this->translate('admin', 'Type'), |
|
67 | + 'plugin.position' => $this->translate('admin', 'Position'), |
|
68 | + 'plugin.label' => $this->translate('admin', 'Label'), |
|
69 | + 'plugin.provider' => $this->translate('admin', 'Provider'), |
|
70 | + 'plugin.config' => $this->translate('admin', 'Config'), |
|
71 | + 'plugin.ctime' => $this->translate('admin', 'Created'), |
|
72 | + 'plugin.mtime' => $this->translate('admin', 'Modified'), |
|
73 | + 'plugin.editor' => $this->translate('admin', 'Editor'), |
|
74 | 74 | ]; |
75 | 75 | |
76 | 76 | ?> |
77 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
77 | +<?php $this->block()->start('jqadm_content'); ?> |
|
78 | 78 | |
79 | 79 | <nav class="main-navbar"> |
80 | 80 | |
81 | 81 | <span class="navbar-brand"> |
82 | - <?= $enc->html( $this->translate( 'admin', 'Plugin' ) ); ?> |
|
83 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span> |
|
82 | + <?= $enc->html($this->translate('admin', 'Plugin')); ?> |
|
83 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span> |
|
84 | 84 | </span> |
85 | 85 | |
86 | 86 | <?= $this->partial( |
87 | - $this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php' ), [ |
|
88 | - 'filter' => $this->session( 'aimeos/admin/jqadm/plugin/filter', [] ), |
|
89 | - 'filterAttributes' => $this->get( 'filterAttributes', [] ), |
|
90 | - 'filterOperators' => $this->get( 'filterOperators', [] ), |
|
87 | + $this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php'), [ |
|
88 | + 'filter' => $this->session('aimeos/admin/jqadm/plugin/filter', []), |
|
89 | + 'filterAttributes' => $this->get('filterAttributes', []), |
|
90 | + 'filterOperators' => $this->get('filterOperators', []), |
|
91 | 91 | 'params' => $params, |
92 | 92 | ] |
93 | 93 | ); ?> |
@@ -95,33 +95,33 @@ discard block |
||
95 | 95 | |
96 | 96 | |
97 | 97 | <?= $this->partial( |
98 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
99 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ), |
|
100 | - 'page' => $this->session( 'aimeos/admin/jqadm/plugin/page', [] )] |
|
98 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
99 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'), |
|
100 | + 'page' => $this->session('aimeos/admin/jqadm/plugin/page', [])] |
|
101 | 101 | ); |
102 | 102 | ?> |
103 | 103 | |
104 | -<form class="list list-product" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>"> |
|
104 | +<form class="list list-product" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>"> |
|
105 | 105 | <?= $this->csrf()->formfield(); ?> |
106 | 106 | |
107 | 107 | <table class="list-items table table-hover table-striped"> |
108 | 108 | <thead class="list-header"> |
109 | 109 | <tr> |
110 | 110 | <?= $this->partial( |
111 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php' ), |
|
112 | - ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/plugin/sort' )] |
|
111 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php'), |
|
112 | + ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/plugin/sort')] |
|
113 | 113 | ); |
114 | 114 | ?> |
115 | 115 | |
116 | 116 | <th class="actions"> |
117 | 117 | <a class="btn fa act-add" tabindex="1" |
118 | - href="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, $params, [], $newConfig ) ); ?>" |
|
119 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
120 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>"> |
|
118 | + href="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, $params, [], $newConfig)); ?>" |
|
119 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
120 | + aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>"> |
|
121 | 121 | </a> |
122 | 122 | |
123 | 123 | <?= $this->partial( |
124 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard.php' ), |
|
124 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard.php'), |
|
125 | 125 | ['fields' => $fields, 'data' => $columnList] |
126 | 126 | ); |
127 | 127 | ?> |
@@ -131,15 +131,15 @@ discard block |
||
131 | 131 | <tbody> |
132 | 132 | |
133 | 133 | <?= $this->partial( |
134 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php' ), [ |
|
135 | - 'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/plugin/filter', [] ), |
|
134 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php'), [ |
|
135 | + 'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/plugin/filter', []), |
|
136 | 136 | 'data' => [ |
137 | 137 | 'plugin.id' => ['op' => '=='], |
138 | 138 | 'plugin.status' => ['op' => '==', 'type' => 'select', 'val' => [ |
139 | - '1' => $this->translate( 'mshop/code', 'status:1' ), |
|
140 | - '0' => $this->translate( 'mshop/code', 'status:0' ), |
|
141 | - '-1' => $this->translate( 'mshop/code', 'status:-1' ), |
|
142 | - '-2' => $this->translate( 'mshop/code', 'status:-2' ), |
|
139 | + '1' => $this->translate('mshop/code', 'status:1'), |
|
140 | + '0' => $this->translate('mshop/code', 'status:0'), |
|
141 | + '-1' => $this->translate('mshop/code', 'status:-1'), |
|
142 | + '-2' => $this->translate('mshop/code', 'status:-2'), |
|
143 | 143 | ]], |
144 | 144 | 'plugin.typeid' => ['op' => '==', 'type' => 'select', 'val' => $typeList], |
145 | 145 | 'plugin.position' => ['op' => '>=', 'type' => 'number'], |
@@ -153,58 +153,58 @@ discard block |
||
153 | 153 | ] ); |
154 | 154 | ?> |
155 | 155 | |
156 | - <?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?> |
|
157 | - <?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?> |
|
158 | - <tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>"> |
|
159 | - <?php if( in_array( 'plugin.id', $fields ) ) : ?> |
|
160 | - <td class="plugin-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td> |
|
156 | + <?php foreach ($this->get('items', []) as $id => $item) : ?> |
|
157 | + <?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?> |
|
158 | + <tr class="<?= $this->site()->readonly($item->getSiteId()); ?>"> |
|
159 | + <?php if (in_array('plugin.id', $fields)) : ?> |
|
160 | + <td class="plugin-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td> |
|
161 | 161 | <?php endif; ?> |
162 | - <?php if( in_array( 'plugin.status', $fields ) ) : ?> |
|
163 | - <td class="plugin-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr( $item->getStatus() ); ?>"></div></a></td> |
|
162 | + <?php if (in_array('plugin.status', $fields)) : ?> |
|
163 | + <td class="plugin-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr($item->getStatus()); ?>"></div></a></td> |
|
164 | 164 | <?php endif; ?> |
165 | - <?php if( in_array( 'plugin.typeid', $fields ) ) : ?> |
|
166 | - <td class="plugin-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getType() ); ?></a></td> |
|
165 | + <?php if (in_array('plugin.typeid', $fields)) : ?> |
|
166 | + <td class="plugin-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getType()); ?></a></td> |
|
167 | 167 | <?php endif; ?> |
168 | - <?php if( in_array( 'plugin.position', $fields ) ) : ?> |
|
169 | - <td class="plugin-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getPosition() ); ?></a></td> |
|
168 | + <?php if (in_array('plugin.position', $fields)) : ?> |
|
169 | + <td class="plugin-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getPosition()); ?></a></td> |
|
170 | 170 | <?php endif; ?> |
171 | - <?php if( in_array( 'plugin.label', $fields ) ) : ?> |
|
172 | - <td class="plugin-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getLabel() ); ?></a></td> |
|
171 | + <?php if (in_array('plugin.label', $fields)) : ?> |
|
172 | + <td class="plugin-label"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getLabel()); ?></a></td> |
|
173 | 173 | <?php endif; ?> |
174 | - <?php if( in_array( 'plugin.provider', $fields ) ) : ?> |
|
175 | - <td class="plugin-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getProvider() ); ?></a></td> |
|
174 | + <?php if (in_array('plugin.provider', $fields)) : ?> |
|
175 | + <td class="plugin-provider"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getProvider()); ?></a></td> |
|
176 | 176 | <?php endif; ?> |
177 | - <?php if( in_array( 'plugin.config', $fields ) ) : ?> |
|
177 | + <?php if (in_array('plugin.config', $fields)) : ?> |
|
178 | 178 | <td class="plugin-config config-item"> |
179 | 179 | <a class="items-field" href="<?= $url; ?>"> |
180 | - <?php foreach( $item->getConfig() as $key => $value ) : ?> |
|
181 | - <span class="config-key"><?= $enc->html( $key ); ?></span> |
|
182 | - <span class="config-value"><?= $enc->html( !is_scalar( $value ) ? json_encode( $value ) : $value ); ?></span> |
|
180 | + <?php foreach ($item->getConfig() as $key => $value) : ?> |
|
181 | + <span class="config-key"><?= $enc->html($key); ?></span> |
|
182 | + <span class="config-value"><?= $enc->html(!is_scalar($value) ? json_encode($value) : $value); ?></span> |
|
183 | 183 | <br/> |
184 | 184 | <?php endforeach; ?> |
185 | 185 | </a> |
186 | 186 | </td> |
187 | 187 | <?php endif; ?> |
188 | - <?php if( in_array( 'plugin.ctime', $fields ) ) : ?> |
|
189 | - <td class="plugin-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td> |
|
188 | + <?php if (in_array('plugin.ctime', $fields)) : ?> |
|
189 | + <td class="plugin-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td> |
|
190 | 190 | <?php endif; ?> |
191 | - <?php if( in_array( 'plugin.mtime', $fields ) ) : ?> |
|
192 | - <td class="plugin-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td> |
|
191 | + <?php if (in_array('plugin.mtime', $fields)) : ?> |
|
192 | + <td class="plugin-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td> |
|
193 | 193 | <?php endif; ?> |
194 | - <?php if( in_array( 'plugin.editor', $fields ) ) : ?> |
|
195 | - <td class="plugin-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td> |
|
194 | + <?php if (in_array('plugin.editor', $fields)) : ?> |
|
195 | + <td class="plugin-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td> |
|
196 | 196 | <?php endif; ?> |
197 | 197 | |
198 | 198 | <td class="actions"> |
199 | 199 | <a class="btn act-copy fa" tabindex="1" |
200 | - href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>" |
|
201 | - title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>" |
|
202 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a> |
|
203 | - <?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?> |
|
200 | + href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>" |
|
201 | + title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>" |
|
202 | + aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a> |
|
203 | + <?php if (!$this->site()->readonly($item->getSiteId())) : ?> |
|
204 | 204 | <a class="btn act-delete fa" tabindex="1" |
205 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'plugin', 'id' => $id] + $params, [], $delConfig ) ); ?>" |
|
206 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
207 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
205 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'plugin', 'id' => $id] + $params, [], $delConfig)); ?>" |
|
206 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
207 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
208 | 208 | <?php endif; ?> |
209 | 209 | </td> |
210 | 210 | </tr> |
@@ -212,18 +212,18 @@ discard block |
||
212 | 212 | </tbody> |
213 | 213 | </table> |
214 | 214 | |
215 | - <?php if( $this->get( 'items', [] ) === [] ) : ?> |
|
216 | - <?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?> |
|
215 | + <?php if ($this->get('items', []) === []) : ?> |
|
216 | + <?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?> |
|
217 | 217 | <?php endif; ?> |
218 | 218 | </form> |
219 | 219 | |
220 | 220 | <?= $this->partial( |
221 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
222 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ), |
|
223 | - 'page' => $this->session( 'aimeos/admin/jqadm/plugin/page', [] )] |
|
221 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
222 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'), |
|
223 | + 'page' => $this->session('aimeos/admin/jqadm/plugin/page', [])] |
|
224 | 224 | ); |
225 | 225 | ?> |
226 | 226 | |
227 | 227 | <?php $this->block()->stop(); ?> |
228 | 228 | |
229 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?> |
|
229 | +<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?> |
@@ -8,34 +8,34 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | |
11 | -$target = $this->config( 'admin/jqadm/url/search/target' ); |
|
12 | -$controller = $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 | +$target = $this->config('admin/jqadm/url/search/target'); |
|
12 | +$controller = $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 | -$newTarget = $this->config( 'admin/jqadm/url/create/target' ); |
|
18 | -$newCntl = $this->config( 'admin/jqadm/url/create/controller', 'Jqadm' ); |
|
19 | -$newAction = $this->config( 'admin/jqadm/url/create/action', 'create' ); |
|
20 | -$newConfig = $this->config( 'admin/jqadm/url/create/config', [] ); |
|
17 | +$newTarget = $this->config('admin/jqadm/url/create/target'); |
|
18 | +$newCntl = $this->config('admin/jqadm/url/create/controller', 'Jqadm'); |
|
19 | +$newAction = $this->config('admin/jqadm/url/create/action', 'create'); |
|
20 | +$newConfig = $this->config('admin/jqadm/url/create/config', []); |
|
21 | 21 | |
22 | 22 | |
23 | -$getTarget = $this->config( 'admin/jqadm/url/get/target' ); |
|
24 | -$getCntl = $this->config( 'admin/jqadm/url/get/controller', 'Jqadm' ); |
|
25 | -$getAction = $this->config( 'admin/jqadm/url/get/action', 'get' ); |
|
26 | -$getConfig = $this->config( 'admin/jqadm/url/get/config', [] ); |
|
23 | +$getTarget = $this->config('admin/jqadm/url/get/target'); |
|
24 | +$getCntl = $this->config('admin/jqadm/url/get/controller', 'Jqadm'); |
|
25 | +$getAction = $this->config('admin/jqadm/url/get/action', 'get'); |
|
26 | +$getConfig = $this->config('admin/jqadm/url/get/config', []); |
|
27 | 27 | |
28 | 28 | |
29 | -$copyTarget = $this->config( 'admin/jqadm/url/copy/target' ); |
|
30 | -$copyCntl = $this->config( 'admin/jqadm/url/copy/controller', 'Jqadm' ); |
|
31 | -$copyAction = $this->config( 'admin/jqadm/url/copy/action', 'copy' ); |
|
32 | -$copyConfig = $this->config( 'admin/jqadm/url/copy/config', [] ); |
|
29 | +$copyTarget = $this->config('admin/jqadm/url/copy/target'); |
|
30 | +$copyCntl = $this->config('admin/jqadm/url/copy/controller', 'Jqadm'); |
|
31 | +$copyAction = $this->config('admin/jqadm/url/copy/action', 'copy'); |
|
32 | +$copyConfig = $this->config('admin/jqadm/url/copy/config', []); |
|
33 | 33 | |
34 | 34 | |
35 | -$delTarget = $this->config( 'admin/jqadm/url/delete/target' ); |
|
36 | -$delCntl = $this->config( 'admin/jqadm/url/delete/controller', 'Jqadm' ); |
|
37 | -$delAction = $this->config( 'admin/jqadm/url/delete/action', 'delete' ); |
|
38 | -$delConfig = $this->config( 'admin/jqadm/url/delete/config', [] ); |
|
35 | +$delTarget = $this->config('admin/jqadm/url/delete/target'); |
|
36 | +$delCntl = $this->config('admin/jqadm/url/delete/controller', 'Jqadm'); |
|
37 | +$delAction = $this->config('admin/jqadm/url/delete/action', 'delete'); |
|
38 | +$delConfig = $this->config('admin/jqadm/url/delete/config', []); |
|
39 | 39 | |
40 | 40 | |
41 | 41 | /** admin/jqadm/attribute/fields |
@@ -53,45 +53,45 @@ discard block |
||
53 | 53 | * @category Developer |
54 | 54 | */ |
55 | 55 | $default = ['attribute.status', 'attribute.typeid', 'attribute.code', 'attribute.label']; |
56 | -$default = $this->config( 'admin/jqadm/attribute/fields', $default ); |
|
57 | -$fields = $this->session( 'aimeos/admin/jqadm/attribute/fields', $default ); |
|
56 | +$default = $this->config('admin/jqadm/attribute/fields', $default); |
|
57 | +$fields = $this->session('aimeos/admin/jqadm/attribute/fields', $default); |
|
58 | 58 | |
59 | -$searchParams = $params = $this->get( 'pageParams', [] ); |
|
59 | +$searchParams = $params = $this->get('pageParams', []); |
|
60 | 60 | $searchParams['page']['start'] = 0; |
61 | 61 | |
62 | 62 | $typeList = []; |
63 | -foreach( $this->get( 'itemTypes', [] ) as $id => $typeItem ) { |
|
63 | +foreach ($this->get('itemTypes', []) as $id => $typeItem) { |
|
64 | 64 | $typeList[$id] = $typeItem->getCode(); |
65 | 65 | } |
66 | 66 | |
67 | 67 | $columnList = [ |
68 | - 'attribute.id' => $this->translate( 'admin', 'ID' ), |
|
69 | - 'attribute.domain' => $this->translate( 'admin', 'Domain' ), |
|
70 | - 'attribute.status' => $this->translate( 'admin', 'Status' ), |
|
71 | - 'attribute.typeid' => $this->translate( 'admin', 'Type' ), |
|
72 | - 'attribute.code' => $this->translate( 'admin', 'Code' ), |
|
73 | - 'attribute.label' => $this->translate( 'admin', 'Label' ), |
|
74 | - 'attribute.position' => $this->translate( 'admin', 'Position' ), |
|
75 | - 'attribute.ctime' => $this->translate( 'admin', 'Created' ), |
|
76 | - 'attribute.mtime' => $this->translate( 'admin', 'Modified' ), |
|
77 | - 'attribute.editor' => $this->translate( 'admin', 'Editor' ), |
|
68 | + 'attribute.id' => $this->translate('admin', 'ID'), |
|
69 | + 'attribute.domain' => $this->translate('admin', 'Domain'), |
|
70 | + 'attribute.status' => $this->translate('admin', 'Status'), |
|
71 | + 'attribute.typeid' => $this->translate('admin', 'Type'), |
|
72 | + 'attribute.code' => $this->translate('admin', 'Code'), |
|
73 | + 'attribute.label' => $this->translate('admin', 'Label'), |
|
74 | + 'attribute.position' => $this->translate('admin', 'Position'), |
|
75 | + 'attribute.ctime' => $this->translate('admin', 'Created'), |
|
76 | + 'attribute.mtime' => $this->translate('admin', 'Modified'), |
|
77 | + 'attribute.editor' => $this->translate('admin', 'Editor'), |
|
78 | 78 | ]; |
79 | 79 | |
80 | 80 | ?> |
81 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
81 | +<?php $this->block()->start('jqadm_content'); ?> |
|
82 | 82 | |
83 | 83 | <nav class="main-navbar"> |
84 | 84 | |
85 | 85 | <span class="navbar-brand"> |
86 | - <?= $enc->html( $this->translate( 'admin', 'Attribute' ) ); ?> |
|
87 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span> |
|
86 | + <?= $enc->html($this->translate('admin', 'Attribute')); ?> |
|
87 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span> |
|
88 | 88 | </span> |
89 | 89 | |
90 | 90 | <?= $this->partial( |
91 | - $this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php' ), [ |
|
92 | - 'filter' => $this->session( 'aimeos/admin/jqadm/attribute/filter', [] ), |
|
93 | - 'filterAttributes' => $this->get( 'filterAttributes', [] ), |
|
94 | - 'filterOperators' => $this->get( 'filterOperators', [] ), |
|
91 | + $this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php'), [ |
|
92 | + 'filter' => $this->session('aimeos/admin/jqadm/attribute/filter', []), |
|
93 | + 'filterAttributes' => $this->get('filterAttributes', []), |
|
94 | + 'filterOperators' => $this->get('filterOperators', []), |
|
95 | 95 | 'params' => $params, |
96 | 96 | ] |
97 | 97 | ); ?> |
@@ -99,33 +99,33 @@ discard block |
||
99 | 99 | |
100 | 100 | |
101 | 101 | <?= $this->partial( |
102 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
103 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ), |
|
104 | - 'page' => $this->session( 'aimeos/admin/jqadm/attribute/page', [] )] |
|
102 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
103 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'), |
|
104 | + 'page' => $this->session('aimeos/admin/jqadm/attribute/page', [])] |
|
105 | 105 | ); |
106 | 106 | ?> |
107 | 107 | |
108 | -<form class="list list-attribute" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>"> |
|
108 | +<form class="list list-attribute" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>"> |
|
109 | 109 | <?= $this->csrf()->formfield(); ?> |
110 | 110 | |
111 | 111 | <table class="list-items table table-hover table-striped"> |
112 | 112 | <thead class="list-header"> |
113 | 113 | <tr> |
114 | 114 | <?= $this->partial( |
115 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php' ), |
|
116 | - ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/attribute/sort' )] |
|
115 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php'), |
|
116 | + ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/attribute/sort')] |
|
117 | 117 | ); |
118 | 118 | ?> |
119 | 119 | |
120 | 120 | <th class="actions"> |
121 | 121 | <a class="btn fa act-add" tabindex="1" |
122 | - href="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, $params, [], $newConfig ) ); ?>" |
|
123 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
124 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>"> |
|
122 | + href="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, $params, [], $newConfig)); ?>" |
|
123 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
124 | + aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>"> |
|
125 | 125 | </a> |
126 | 126 | |
127 | 127 | <?= $this->partial( |
128 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard.php' ), |
|
128 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard.php'), |
|
129 | 129 | ['fields' => $fields, 'data' => $columnList] |
130 | 130 | ); |
131 | 131 | ?> |
@@ -135,21 +135,21 @@ discard block |
||
135 | 135 | <tbody> |
136 | 136 | |
137 | 137 | <?= $this->partial( |
138 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php' ), [ |
|
139 | - 'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/attribute/filter', [] ), |
|
138 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php'), [ |
|
139 | + 'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/attribute/filter', []), |
|
140 | 140 | 'data' => [ |
141 | 141 | 'attribute.id' => ['op' => '=='], |
142 | 142 | 'attribute.domain' => ['op' => '==', 'type' => 'select', 'val' => [ |
143 | - 'product' => $this->translate( 'admin', 'product' ), |
|
144 | - 'catalog' => $this->translate( 'admin', 'catalog' ), |
|
145 | - 'media' => $this->translate( 'admin', 'media' ), |
|
146 | - 'text' => $this->translate( 'admin', 'text' ), |
|
143 | + 'product' => $this->translate('admin', 'product'), |
|
144 | + 'catalog' => $this->translate('admin', 'catalog'), |
|
145 | + 'media' => $this->translate('admin', 'media'), |
|
146 | + 'text' => $this->translate('admin', 'text'), |
|
147 | 147 | ]], |
148 | 148 | 'attribute.status' => ['op' => '==', 'type' => 'select', 'val' => [ |
149 | - '1' => $this->translate( 'mshop/code', 'status:1' ), |
|
150 | - '0' => $this->translate( 'mshop/code', 'status:0' ), |
|
151 | - '-1' => $this->translate( 'mshop/code', 'status:-1' ), |
|
152 | - '-2' => $this->translate( 'mshop/code', 'status:-2' ), |
|
149 | + '1' => $this->translate('mshop/code', 'status:1'), |
|
150 | + '0' => $this->translate('mshop/code', 'status:0'), |
|
151 | + '-1' => $this->translate('mshop/code', 'status:-1'), |
|
152 | + '-2' => $this->translate('mshop/code', 'status:-2'), |
|
153 | 153 | ]], |
154 | 154 | 'attribute.typeid' => ['op' => '==', 'type' => 'select', 'val' => $typeList], |
155 | 155 | 'attribute.code' => [], |
@@ -162,50 +162,50 @@ discard block |
||
162 | 162 | ] ); |
163 | 163 | ?> |
164 | 164 | |
165 | - <?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?> |
|
166 | - <?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?> |
|
167 | - <tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>"> |
|
168 | - <?php if( in_array( 'attribute.id', $fields ) ) : ?> |
|
169 | - <td class="attribute-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td> |
|
165 | + <?php foreach ($this->get('items', []) as $id => $item) : ?> |
|
166 | + <?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?> |
|
167 | + <tr class="<?= $this->site()->readonly($item->getSiteId()); ?>"> |
|
168 | + <?php if (in_array('attribute.id', $fields)) : ?> |
|
169 | + <td class="attribute-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td> |
|
170 | 170 | <?php endif; ?> |
171 | - <?php if( in_array( 'attribute.domain', $fields ) ) : ?> |
|
172 | - <td class="attribute-domain"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDomain() ); ?></a></td> |
|
171 | + <?php if (in_array('attribute.domain', $fields)) : ?> |
|
172 | + <td class="attribute-domain"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDomain()); ?></a></td> |
|
173 | 173 | <?php endif; ?> |
174 | - <?php if( in_array( 'attribute.status', $fields ) ) : ?> |
|
175 | - <td class="attribute-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr( $item->getStatus() ); ?>"></div></a></td> |
|
174 | + <?php if (in_array('attribute.status', $fields)) : ?> |
|
175 | + <td class="attribute-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr($item->getStatus()); ?>"></div></a></td> |
|
176 | 176 | <?php endif; ?> |
177 | - <?php if( in_array( 'attribute.typeid', $fields ) ) : ?> |
|
178 | - <td class="attribute-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getType() ); ?></a></td> |
|
177 | + <?php if (in_array('attribute.typeid', $fields)) : ?> |
|
178 | + <td class="attribute-type"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getType()); ?></a></td> |
|
179 | 179 | <?php endif; ?> |
180 | - <?php if( in_array( 'attribute.code', $fields ) ) : ?> |
|
181 | - <td class="attribute-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getCode() ); ?></a></td> |
|
180 | + <?php if (in_array('attribute.code', $fields)) : ?> |
|
181 | + <td class="attribute-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getCode()); ?></a></td> |
|
182 | 182 | <?php endif; ?> |
183 | - <?php if( in_array( 'attribute.label', $fields ) ) : ?> |
|
184 | - <td class="attribute-label"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getLabel() ); ?></a></td> |
|
183 | + <?php if (in_array('attribute.label', $fields)) : ?> |
|
184 | + <td class="attribute-label"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getLabel()); ?></a></td> |
|
185 | 185 | <?php endif; ?> |
186 | - <?php if( in_array( 'attribute.position', $fields ) ) : ?> |
|
187 | - <td class="attribute-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getPosition() ); ?></a></td> |
|
186 | + <?php if (in_array('attribute.position', $fields)) : ?> |
|
187 | + <td class="attribute-position"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getPosition()); ?></a></td> |
|
188 | 188 | <?php endif; ?> |
189 | - <?php if( in_array( 'attribute.ctime', $fields ) ) : ?> |
|
190 | - <td class="attribute-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td> |
|
189 | + <?php if (in_array('attribute.ctime', $fields)) : ?> |
|
190 | + <td class="attribute-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td> |
|
191 | 191 | <?php endif; ?> |
192 | - <?php if( in_array( 'attribute.mtime', $fields ) ) : ?> |
|
193 | - <td class="attribute-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td> |
|
192 | + <?php if (in_array('attribute.mtime', $fields)) : ?> |
|
193 | + <td class="attribute-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td> |
|
194 | 194 | <?php endif; ?> |
195 | - <?php if( in_array( 'attribute.editor', $fields ) ) : ?> |
|
196 | - <td class="attribute-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td> |
|
195 | + <?php if (in_array('attribute.editor', $fields)) : ?> |
|
196 | + <td class="attribute-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td> |
|
197 | 197 | <?php endif; ?> |
198 | 198 | |
199 | 199 | <td class="actions"> |
200 | 200 | <a class="btn act-copy fa" tabindex="1" |
201 | - href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>" |
|
202 | - title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>" |
|
203 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a> |
|
204 | - <?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?> |
|
201 | + href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>" |
|
202 | + title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>" |
|
203 | + aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a> |
|
204 | + <?php if (!$this->site()->readonly($item->getSiteId())) : ?> |
|
205 | 205 | <a class="btn act-delete fa" tabindex="1" |
206 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'attribute', 'id' => $id] + $params, [], $delConfig ) ); ?>" |
|
207 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
208 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
206 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'attribute', 'id' => $id] + $params, [], $delConfig)); ?>" |
|
207 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
208 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
209 | 209 | <?php endif; ?> |
210 | 210 | </td> |
211 | 211 | </tr> |
@@ -213,18 +213,18 @@ discard block |
||
213 | 213 | </tbody> |
214 | 214 | </table> |
215 | 215 | |
216 | - <?php if( $this->get( 'items', [] ) === [] ) : ?> |
|
217 | - <div class="noitems"><?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?></div> |
|
216 | + <?php if ($this->get('items', []) === []) : ?> |
|
217 | + <div class="noitems"><?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?></div> |
|
218 | 218 | <?php endif; ?> |
219 | 219 | </form> |
220 | 220 | |
221 | 221 | <?= $this->partial( |
222 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
223 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ), |
|
224 | - 'page' => $this->session( 'aimeos/admin/jqadm/attribute/page', [] )] |
|
222 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
223 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'), |
|
224 | + 'page' => $this->session('aimeos/admin/jqadm/attribute/page', [])] |
|
225 | 225 | ); |
226 | 226 | ?> |
227 | 227 | |
228 | 228 | <?php $this->block()->stop(); ?> |
229 | 229 | |
230 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?> |
|
230 | +<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?> |
@@ -8,30 +8,30 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | |
11 | -$target = $this->config( 'admin/jqadm/url/search/target' ); |
|
12 | -$controller = $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 | +$target = $this->config('admin/jqadm/url/search/target'); |
|
12 | +$controller = $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 | -$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 | -$copyTarget = $this->config( 'admin/jqadm/url/copy/target' ); |
|
27 | -$copyCntl = $this->config( 'admin/jqadm/url/copy/controller', 'Jqadm' ); |
|
28 | -$copyAction = $this->config( 'admin/jqadm/url/copy/action', 'copy' ); |
|
29 | -$copyConfig = $this->config( 'admin/jqadm/url/copy/config', [] ); |
|
26 | +$copyTarget = $this->config('admin/jqadm/url/copy/target'); |
|
27 | +$copyCntl = $this->config('admin/jqadm/url/copy/controller', 'Jqadm'); |
|
28 | +$copyAction = $this->config('admin/jqadm/url/copy/action', 'copy'); |
|
29 | +$copyConfig = $this->config('admin/jqadm/url/copy/config', []); |
|
30 | 30 | |
31 | -$delTarget = $this->config( 'admin/jqadm/url/delete/target' ); |
|
32 | -$delCntl = $this->config( 'admin/jqadm/url/delete/controller', 'Jqadm' ); |
|
33 | -$delAction = $this->config( 'admin/jqadm/url/delete/action', 'delete' ); |
|
34 | -$delConfig = $this->config( 'admin/jqadm/url/delete/config', [] ); |
|
31 | +$delTarget = $this->config('admin/jqadm/url/delete/target'); |
|
32 | +$delCntl = $this->config('admin/jqadm/url/delete/controller', 'Jqadm'); |
|
33 | +$delAction = $this->config('admin/jqadm/url/delete/action', 'delete'); |
|
34 | +$delConfig = $this->config('admin/jqadm/url/delete/config', []); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** admin/jqadm/supplier/fields |
@@ -49,38 +49,38 @@ discard block |
||
49 | 49 | * @category Developer |
50 | 50 | */ |
51 | 51 | $default = ['supplier.status', 'supplier.code', 'supplier.label']; |
52 | -$default = $this->config( 'admin/jqadm/supplier/fields', $default ); |
|
53 | -$fields = $this->session( 'aimeos/admin/jqadm/supplier/fields', $default ); |
|
52 | +$default = $this->config('admin/jqadm/supplier/fields', $default); |
|
53 | +$fields = $this->session('aimeos/admin/jqadm/supplier/fields', $default); |
|
54 | 54 | |
55 | -$searchParams = $params = $this->get( 'pageParams', [] ); |
|
55 | +$searchParams = $params = $this->get('pageParams', []); |
|
56 | 56 | $searchParams['page']['start'] = 0; |
57 | 57 | |
58 | 58 | $columnList = [ |
59 | - 'supplier.id' => $this->translate( 'admin', 'ID' ), |
|
60 | - 'supplier.status' => $this->translate( 'admin', 'Status' ), |
|
61 | - 'supplier.code' => $this->translate( 'admin', 'Code' ), |
|
62 | - 'supplier.label' => $this->translate( 'admin', 'Label' ), |
|
63 | - 'supplier.ctime' => $this->translate( 'admin', 'Created' ), |
|
64 | - 'supplier.mtime' => $this->translate( 'admin', 'Modified' ), |
|
65 | - 'supplier.editor' => $this->translate( 'admin', 'Editor' ), |
|
59 | + 'supplier.id' => $this->translate('admin', 'ID'), |
|
60 | + 'supplier.status' => $this->translate('admin', 'Status'), |
|
61 | + 'supplier.code' => $this->translate('admin', 'Code'), |
|
62 | + 'supplier.label' => $this->translate('admin', 'Label'), |
|
63 | + 'supplier.ctime' => $this->translate('admin', 'Created'), |
|
64 | + 'supplier.mtime' => $this->translate('admin', 'Modified'), |
|
65 | + 'supplier.editor' => $this->translate('admin', 'Editor'), |
|
66 | 66 | ]; |
67 | 67 | |
68 | 68 | |
69 | 69 | ?> |
70 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
70 | +<?php $this->block()->start('jqadm_content'); ?> |
|
71 | 71 | |
72 | 72 | <nav class="main-navbar"> |
73 | 73 | |
74 | 74 | <span class="navbar-brand"> |
75 | - <?= $enc->html( $this->translate( 'admin', 'Supplier' ) ); ?> |
|
76 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span> |
|
75 | + <?= $enc->html($this->translate('admin', 'Supplier')); ?> |
|
76 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span> |
|
77 | 77 | </span> |
78 | 78 | |
79 | 79 | <?= $this->partial( |
80 | - $this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php' ), [ |
|
81 | - 'filter' => $this->session( 'aimeos/admin/jqadm/supplier/filter', [] ), |
|
82 | - 'filterAttributes' => $this->get( 'filterAttributes', [] ), |
|
83 | - 'filterOperators' => $this->get( 'filterOperators', [] ), |
|
80 | + $this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php'), [ |
|
81 | + 'filter' => $this->session('aimeos/admin/jqadm/supplier/filter', []), |
|
82 | + 'filterAttributes' => $this->get('filterAttributes', []), |
|
83 | + 'filterOperators' => $this->get('filterOperators', []), |
|
84 | 84 | 'params' => $params, |
85 | 85 | ] |
86 | 86 | ); ?> |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | |
89 | 89 | |
90 | 90 | <?= $this->partial( |
91 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
92 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ), |
|
93 | - 'page' => $this->session( 'aimeos/admin/jqadm/supplier/page', [] )] |
|
91 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
92 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'), |
|
93 | + 'page' => $this->session('aimeos/admin/jqadm/supplier/page', [])] |
|
94 | 94 | ); |
95 | 95 | ?> |
96 | 96 | |
97 | -<form class="list list-supplier" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>"> |
|
97 | +<form class="list list-supplier" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>"> |
|
98 | 98 | <?= $this->csrf()->formfield(); ?> |
99 | 99 | |
100 | 100 | <table class="list-items table table-hover table-striped"> |
@@ -102,20 +102,20 @@ discard block |
||
102 | 102 | <tr> |
103 | 103 | |
104 | 104 | <?= $this->partial( |
105 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php' ), |
|
106 | - ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/supplier/sort' )] |
|
105 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php'), |
|
106 | + ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/supplier/sort')] |
|
107 | 107 | ); |
108 | 108 | ?> |
109 | 109 | |
110 | 110 | <th class="actions"> |
111 | 111 | <a class="btn fa act-add" tabindex="1" |
112 | - href="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, $params, [], $newConfig ) ); ?>" |
|
113 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
114 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>"> |
|
112 | + href="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, $params, [], $newConfig)); ?>" |
|
113 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
114 | + aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>"> |
|
115 | 115 | </a> |
116 | 116 | |
117 | 117 | <?= $this->partial( |
118 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard.php' ), |
|
118 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard.php'), |
|
119 | 119 | ['fields' => $fields, 'data' => $columnList] |
120 | 120 | ); |
121 | 121 | ?> |
@@ -125,15 +125,15 @@ discard block |
||
125 | 125 | <tbody> |
126 | 126 | |
127 | 127 | <?= $this->partial( |
128 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php' ), [ |
|
129 | - 'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/supplier/filter', [] ), |
|
128 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php'), [ |
|
129 | + 'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/supplier/filter', []), |
|
130 | 130 | 'data' => [ |
131 | 131 | 'supplier.id' => ['op' => '=='], |
132 | 132 | 'supplier.status' => ['op' => '==', 'type' => 'select', 'val' => [ |
133 | - '1' => $this->translate( 'mshop/code', 'status:1' ), |
|
134 | - '0' => $this->translate( 'mshop/code', 'status:0' ), |
|
135 | - '-1' => $this->translate( 'mshop/code', 'status:-1' ), |
|
136 | - '-2' => $this->translate( 'mshop/code', 'status:-2' ), |
|
133 | + '1' => $this->translate('mshop/code', 'status:1'), |
|
134 | + '0' => $this->translate('mshop/code', 'status:0'), |
|
135 | + '-1' => $this->translate('mshop/code', 'status:-1'), |
|
136 | + '-2' => $this->translate('mshop/code', 'status:-2'), |
|
137 | 137 | ]], |
138 | 138 | 'supplier.code' => [], |
139 | 139 | 'supplier.label' => [], |
@@ -144,41 +144,41 @@ discard block |
||
144 | 144 | ] ); |
145 | 145 | ?> |
146 | 146 | |
147 | - <?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?> |
|
148 | - <?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?> |
|
149 | - <tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>"> |
|
150 | - <?php if( in_array( 'supplier.id', $fields ) ) : ?> |
|
151 | - <td class="supplier-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td> |
|
147 | + <?php foreach ($this->get('items', []) as $id => $item) : ?> |
|
148 | + <?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?> |
|
149 | + <tr class="<?= $this->site()->readonly($item->getSiteId()); ?>"> |
|
150 | + <?php if (in_array('supplier.id', $fields)) : ?> |
|
151 | + <td class="supplier-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td> |
|
152 | 152 | <?php endif; ?> |
153 | - <?php if( in_array( 'supplier.status', $fields ) ) : ?> |
|
154 | - <td class="supplier-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr( $item->getStatus() ); ?>"></div></a></td> |
|
153 | + <?php if (in_array('supplier.status', $fields)) : ?> |
|
154 | + <td class="supplier-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr($item->getStatus()); ?>"></div></a></td> |
|
155 | 155 | <?php endif; ?> |
156 | - <?php if( in_array( 'supplier.code', $fields ) ) : ?> |
|
157 | - <td class="supplier-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html( $item->getCode() ); ?></a></td> |
|
156 | + <?php if (in_array('supplier.code', $fields)) : ?> |
|
157 | + <td class="supplier-code"><a class="items-field" href="<?= $url; ?>" tabindex="1"><?= $enc->html($item->getCode()); ?></a></td> |
|
158 | 158 | <?php endif; ?> |
159 | - <?php if( in_array( 'supplier.label', $fields ) ) : ?> |
|
160 | - <td class="supplier-label"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getLabel() ); ?></a></td> |
|
159 | + <?php if (in_array('supplier.label', $fields)) : ?> |
|
160 | + <td class="supplier-label"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getLabel()); ?></a></td> |
|
161 | 161 | <?php endif; ?> |
162 | - <?php if( in_array( 'supplier.ctime', $fields ) ) : ?> |
|
163 | - <td class="supplier-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td> |
|
162 | + <?php if (in_array('supplier.ctime', $fields)) : ?> |
|
163 | + <td class="supplier-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td> |
|
164 | 164 | <?php endif; ?> |
165 | - <?php if( in_array( 'supplier.mtime', $fields ) ) : ?> |
|
166 | - <td class="supplier-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td> |
|
165 | + <?php if (in_array('supplier.mtime', $fields)) : ?> |
|
166 | + <td class="supplier-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td> |
|
167 | 167 | <?php endif; ?> |
168 | - <?php if( in_array( 'supplier.editor', $fields ) ) : ?> |
|
169 | - <td class="supplier-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td> |
|
168 | + <?php if (in_array('supplier.editor', $fields)) : ?> |
|
169 | + <td class="supplier-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td> |
|
170 | 170 | <?php endif; ?> |
171 | 171 | |
172 | 172 | <td class="actions"> |
173 | 173 | <a class="btn act-copy fa" tabindex="1" |
174 | - href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>" |
|
175 | - title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>" |
|
176 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a> |
|
177 | - <?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?> |
|
174 | + href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>" |
|
175 | + title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>" |
|
176 | + aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a> |
|
177 | + <?php if (!$this->site()->readonly($item->getSiteId())) : ?> |
|
178 | 178 | <a class="btn act-delete fa" tabindex="1" |
179 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'supplier', 'id' => $id] + $params, [], $delConfig ) ); ?>" |
|
180 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
181 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
179 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'supplier', 'id' => $id] + $params, [], $delConfig)); ?>" |
|
180 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
181 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
182 | 182 | <?php endif; ?> |
183 | 183 | </td> |
184 | 184 | </tr> |
@@ -186,18 +186,18 @@ discard block |
||
186 | 186 | </tbody> |
187 | 187 | </table> |
188 | 188 | |
189 | - <?php if( $this->get( 'items', [] ) === [] ) : ?> |
|
190 | - <div class="noitems"><?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?></div> |
|
189 | + <?php if ($this->get('items', []) === []) : ?> |
|
190 | + <div class="noitems"><?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?></div> |
|
191 | 191 | <?php endif; ?> |
192 | 192 | </form> |
193 | 193 | |
194 | 194 | <?= $this->partial( |
195 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
196 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ), |
|
197 | - 'page' => $this->session( 'aimeos/admin/jqadm/supplier/page', [] )] |
|
195 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
196 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'), |
|
197 | + 'page' => $this->session('aimeos/admin/jqadm/supplier/page', [])] |
|
198 | 198 | ); |
199 | 199 | ?> |
200 | 200 | |
201 | 201 | <?php $this->block()->stop(); ?> |
202 | 202 | |
203 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?> |
|
203 | +<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?> |
@@ -286,6 +286,9 @@ |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | |
289 | + /** |
|
290 | + * @param string $method |
|
291 | + */ |
|
289 | 292 | public function getClientMock( $method ) |
290 | 293 | { |
291 | 294 | $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Subscription\Standard' ) |
@@ -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\Subscription\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\Subscription\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,10 +42,10 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getClientMock( 'getSubClients' ); |
|
45 | + $object = $this->getClientMock('getSubClients'); |
|
46 | 46 | |
47 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
48 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
47 | + $object->expects($this->once())->method('getSubClients') |
|
48 | + ->will($this->throwException(new \RuntimeException())); |
|
49 | 49 | |
50 | 50 | $object->create(); |
51 | 51 | } |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | |
54 | 54 | public function testCreateMShopException() |
55 | 55 | { |
56 | - $object = $this->getClientMock( 'getSubClients' ); |
|
56 | + $object = $this->getClientMock('getSubClients'); |
|
57 | 57 | |
58 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
59 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
58 | + $object->expects($this->once())->method('getSubClients') |
|
59 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
60 | 60 | |
61 | 61 | $object->create(); |
62 | 62 | } |
@@ -64,24 +64,24 @@ discard block |
||
64 | 64 | |
65 | 65 | public function testCopy() |
66 | 66 | { |
67 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' ); |
|
67 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription'); |
|
68 | 68 | |
69 | 69 | $param = ['site' => 'unittest', 'id' => $this->getSubscriptionId()]; |
70 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
71 | - $this->view->addHelper( 'param', $helper ); |
|
70 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
71 | + $this->view->addHelper('param', $helper); |
|
72 | 72 | |
73 | 73 | $result = $this->object->copy(); |
74 | 74 | |
75 | - $this->assertContains( '2010-01-01', $result ); |
|
75 | + $this->assertContains('2010-01-01', $result); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | 79 | public function testCopyException() |
80 | 80 | { |
81 | - $object = $this->getClientMock( 'getSubClients' ); |
|
81 | + $object = $this->getClientMock('getSubClients'); |
|
82 | 82 | |
83 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
84 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
83 | + $object->expects($this->once())->method('getSubClients') |
|
84 | + ->will($this->throwException(new \RuntimeException())); |
|
85 | 85 | |
86 | 86 | $object->copy(); |
87 | 87 | } |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | |
90 | 90 | public function testCopyMShopException() |
91 | 91 | { |
92 | - $object = $this->getClientMock( 'getSubClients' ); |
|
92 | + $object = $this->getClientMock('getSubClients'); |
|
93 | 93 | |
94 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
95 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
94 | + $object->expects($this->once())->method('getSubClients') |
|
95 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
96 | 96 | |
97 | 97 | $object->copy(); |
98 | 98 | } |
@@ -100,16 +100,16 @@ discard block |
||
100 | 100 | |
101 | 101 | public function testDelete() |
102 | 102 | { |
103 | - $this->assertNotNull( $this->object->delete() ); |
|
103 | + $this->assertNotNull($this->object->delete()); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
107 | 107 | public function testDeleteException() |
108 | 108 | { |
109 | - $object = $this->getClientMock( 'getSubClients' ); |
|
109 | + $object = $this->getClientMock('getSubClients'); |
|
110 | 110 | |
111 | - $object->expects( $this->exactly( 2 ) )->method( 'getSubClients' ) |
|
112 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
111 | + $object->expects($this->exactly(2))->method('getSubClients') |
|
112 | + ->will($this->throwException(new \RuntimeException())); |
|
113 | 113 | |
114 | 114 | $object->delete(); |
115 | 115 | } |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | |
118 | 118 | public function testDeleteMShopException() |
119 | 119 | { |
120 | - $object = $this->getClientMock( 'getSubClients' ); |
|
120 | + $object = $this->getClientMock('getSubClients'); |
|
121 | 121 | |
122 | - $object->expects( $this->exactly( 2 ) )->method( 'getSubClients' ) |
|
123 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
122 | + $object->expects($this->exactly(2))->method('getSubClients') |
|
123 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
124 | 124 | |
125 | 125 | $object->delete(); |
126 | 126 | } |
@@ -128,24 +128,24 @@ discard block |
||
128 | 128 | |
129 | 129 | public function testGet() |
130 | 130 | { |
131 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' ); |
|
131 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription'); |
|
132 | 132 | |
133 | 133 | $param = ['site' => 'unittest', 'id' => $this->getSubscriptionId()]; |
134 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
135 | - $this->view->addHelper( 'param', $helper ); |
|
134 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
135 | + $this->view->addHelper('param', $helper); |
|
136 | 136 | |
137 | 137 | $result = $this->object->get(); |
138 | 138 | |
139 | - $this->assertContains( '2010-01-01', $result ); |
|
139 | + $this->assertContains('2010-01-01', $result); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | |
143 | 143 | public function testGetException() |
144 | 144 | { |
145 | - $object = $this->getClientMock( 'getSubClients' ); |
|
145 | + $object = $this->getClientMock('getSubClients'); |
|
146 | 146 | |
147 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
148 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
147 | + $object->expects($this->once())->method('getSubClients') |
|
148 | + ->will($this->throwException(new \RuntimeException())); |
|
149 | 149 | |
150 | 150 | $object->get(); |
151 | 151 | } |
@@ -153,10 +153,10 @@ discard block |
||
153 | 153 | |
154 | 154 | public function testGetMShopException() |
155 | 155 | { |
156 | - $object = $this->getClientMock( 'getSubClients' ); |
|
156 | + $object = $this->getClientMock('getSubClients'); |
|
157 | 157 | |
158 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
159 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
158 | + $object->expects($this->once())->method('getSubClients') |
|
159 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
160 | 160 | |
161 | 161 | $object->get(); |
162 | 162 | } |
@@ -164,23 +164,23 @@ discard block |
||
164 | 164 | |
165 | 165 | public function testGetViewException() |
166 | 166 | { |
167 | - $object = new \Aimeos\Admin\JQAdm\Subscription\Standard( $this->context, [] ); |
|
167 | + $object = new \Aimeos\Admin\JQAdm\Subscription\Standard($this->context, []); |
|
168 | 168 | |
169 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
169 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
170 | 170 | $object->getView(); |
171 | 171 | } |
172 | 172 | |
173 | 173 | |
174 | 174 | public function testSave() |
175 | 175 | { |
176 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/product' ); |
|
177 | - $items = $manager->searchItems( $manager->createSearch()->setSlice( 0, 1 ) ); |
|
176 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/product'); |
|
177 | + $items = $manager->searchItems($manager->createSearch()->setSlice(0, 1)); |
|
178 | 178 | |
179 | - if( ( $item = reset( $items ) ) === false ) { |
|
180 | - throw new \Exception( 'No order product item found' ); |
|
179 | + if (($item = reset($items)) === false) { |
|
180 | + throw new \Exception('No order product item found'); |
|
181 | 181 | } |
182 | 182 | |
183 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' ); |
|
183 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription'); |
|
184 | 184 | |
185 | 185 | $param = array( |
186 | 186 | 'site' => 'unittest', |
@@ -195,21 +195,21 @@ discard block |
||
195 | 195 | ), |
196 | 196 | ); |
197 | 197 | |
198 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
199 | - $this->view->addHelper( 'param', $helper ); |
|
198 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
199 | + $this->view->addHelper('param', $helper); |
|
200 | 200 | |
201 | 201 | $this->object->save(); |
202 | 202 | |
203 | - $manager->deleteItem( $this->getSubscriptionId( '2006-06-06' ) ); |
|
203 | + $manager->deleteItem($this->getSubscriptionId('2006-06-06')); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
207 | 207 | public function testSaveException() |
208 | 208 | { |
209 | - $object = $this->getClientMock( 'fromArray' ); |
|
209 | + $object = $this->getClientMock('fromArray'); |
|
210 | 210 | |
211 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
212 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
211 | + $object->expects($this->once())->method('fromArray') |
|
212 | + ->will($this->throwException(new \RuntimeException())); |
|
213 | 213 | |
214 | 214 | $object->save(); |
215 | 215 | } |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | |
218 | 218 | public function testSaveMShopException() |
219 | 219 | { |
220 | - $object = $this->getClientMock( 'fromArray' ); |
|
220 | + $object = $this->getClientMock('fromArray'); |
|
221 | 221 | |
222 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
223 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
222 | + $object->expects($this->once())->method('fromArray') |
|
223 | + ->will($this->throwException(new \RuntimeException())); |
|
224 | 224 | |
225 | 225 | $object->save(); |
226 | 226 | } |
@@ -228,10 +228,10 @@ discard block |
||
228 | 228 | |
229 | 229 | public function testSaveJQAdmException() |
230 | 230 | { |
231 | - $object = $this->getClientMock( 'fromArray' ); |
|
231 | + $object = $this->getClientMock('fromArray'); |
|
232 | 232 | |
233 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
234 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
233 | + $object->expects($this->once())->method('fromArray') |
|
234 | + ->will($this->throwException(new \RuntimeException())); |
|
235 | 235 | |
236 | 236 | $object->save(); |
237 | 237 | } |
@@ -242,27 +242,27 @@ discard block |
||
242 | 242 | $param = array( |
243 | 243 | 'site' => 'unittest', 'lang' => 'de', |
244 | 244 | 'filter' => array( |
245 | - 'key' => array( 0 => 'subscription.dateend' ), |
|
246 | - 'op' => array( 0 => '>=' ), |
|
247 | - 'val' => array( 0 => '2010-01-01' ), |
|
245 | + 'key' => array(0 => 'subscription.dateend'), |
|
246 | + 'op' => array(0 => '>='), |
|
247 | + 'val' => array(0 => '2010-01-01'), |
|
248 | 248 | ), |
249 | - 'sort' => array( 'subscription.datenext', '-subscription.id' ), |
|
249 | + 'sort' => array('subscription.datenext', '-subscription.id'), |
|
250 | 250 | ); |
251 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
252 | - $this->view->addHelper( 'param', $helper ); |
|
251 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
252 | + $this->view->addHelper('param', $helper); |
|
253 | 253 | |
254 | 254 | $result = $this->object->search(); |
255 | 255 | |
256 | - $this->assertContains( '2010-01-01', $result ); |
|
256 | + $this->assertContains('2010-01-01', $result); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | |
260 | 260 | public function testSearchException() |
261 | 261 | { |
262 | - $object = $this->getClientMock( 'initCriteria' ); |
|
262 | + $object = $this->getClientMock('initCriteria'); |
|
263 | 263 | |
264 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
265 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
264 | + $object->expects($this->once())->method('initCriteria') |
|
265 | + ->will($this->throwException(new \RuntimeException())); |
|
266 | 266 | |
267 | 267 | $object->search(); |
268 | 268 | } |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | |
271 | 271 | public function testSearchMShopException() |
272 | 272 | { |
273 | - $object = $this->getClientMock( 'initCriteria' ); |
|
273 | + $object = $this->getClientMock('initCriteria'); |
|
274 | 274 | |
275 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
276 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
275 | + $object->expects($this->once())->method('initCriteria') |
|
276 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
277 | 277 | |
278 | 278 | $object->search(); |
279 | 279 | } |
@@ -281,27 +281,27 @@ discard block |
||
281 | 281 | |
282 | 282 | public function testGetSubClientInvalid() |
283 | 283 | { |
284 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
285 | - $this->object->getSubClient( '$unknown$' ); |
|
284 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
285 | + $this->object->getSubClient('$unknown$'); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | |
289 | 289 | public function testGetSubClientUnknown() |
290 | 290 | { |
291 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
292 | - $this->object->getSubClient( 'unknown' ); |
|
291 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
292 | + $this->object->getSubClient('unknown'); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | |
296 | - public function getClientMock( $method ) |
|
296 | + public function getClientMock($method) |
|
297 | 297 | { |
298 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Subscription\Standard' ) |
|
299 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
300 | - ->setMethods( [$method] ) |
|
298 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Subscription\Standard') |
|
299 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
300 | + ->setMethods([$method]) |
|
301 | 301 | ->getMock(); |
302 | 302 | |
303 | - $object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
304 | - $object->setView( $this->getViewNoRender() ); |
|
303 | + $object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
304 | + $object->setView($this->getViewNoRender()); |
|
305 | 305 | |
306 | 306 | return $object; |
307 | 307 | } |
@@ -309,33 +309,33 @@ discard block |
||
309 | 309 | |
310 | 310 | protected function getViewNoRender() |
311 | 311 | { |
312 | - $view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' ) |
|
313 | - ->setConstructorArgs( array( [] ) ) |
|
314 | - ->setMethods( array( 'render', 'config' ) ) |
|
312 | + $view = $this->getMockBuilder('\Aimeos\MW\View\Standard') |
|
313 | + ->setConstructorArgs(array([])) |
|
314 | + ->setMethods(array('render', 'config')) |
|
315 | 315 | ->getMock(); |
316 | 316 | |
317 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' ); |
|
317 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription'); |
|
318 | 318 | |
319 | 319 | $param = ['site' => 'unittest', 'id' => $this->getSubscriptionId()]; |
320 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
321 | - $view->addHelper( 'param', $helper ); |
|
320 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
321 | + $view->addHelper('param', $helper); |
|
322 | 322 | |
323 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
324 | - $view->addHelper( 'access', $helper ); |
|
323 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
324 | + $view->addHelper('access', $helper); |
|
325 | 325 | |
326 | 326 | return $view; |
327 | 327 | } |
328 | 328 | |
329 | 329 | |
330 | - protected function getSubscriptionId( $end = '2010-01-01' ) |
|
330 | + protected function getSubscriptionId($end = '2010-01-01') |
|
331 | 331 | { |
332 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' ); |
|
333 | - $search = $manager->createSearch()->setSlice( 0, 1 ); |
|
334 | - $search->setConditions( $search->compare( '==', 'subscription.dateend', $end ) ); |
|
335 | - $items = $manager->searchItems( $search ); |
|
332 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription'); |
|
333 | + $search = $manager->createSearch()->setSlice(0, 1); |
|
334 | + $search->setConditions($search->compare('==', 'subscription.dateend', $end)); |
|
335 | + $items = $manager->searchItems($search); |
|
336 | 336 | |
337 | - if( ( $item = reset( $items ) ) === false ) { |
|
338 | - throw new \Exception( sprintf( 'No subscription item found for end date "%1$s"', $end ) ); |
|
337 | + if (($item = reset($items)) === false) { |
|
338 | + throw new \Exception(sprintf('No subscription item found for end date "%1$s"', $end)); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | return $item->getId(); |
@@ -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\Subscription\Factory::createClient( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Subscription\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\Subscription\Factory::createClient( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Subscription\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\Subscription\Factory::createClient( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Subscription\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\Subscription\Factory::createClient( $this->context, '%subscription' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Subscription\Factory::createClient($this->context, '%subscription'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Subscription\Factory::createClient( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Subscription\Factory::createClient($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'subscription', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | |
234 | 228 | $msg = $context->getI18n()->dt( 'admin', 'Your export will be available in a few minutes for download' ); |
235 | 229 | $view->info = $view->get( 'info', [] ) + ['subscription-item' => $msg]; |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -279,14 +271,12 @@ discard block |
||
279 | 271 | $view->tabindex = ++$idx + 1; |
280 | 272 | $view->itemBody .= $client->get(); |
281 | 273 | } |
282 | - } |
|
283 | - catch( \Aimeos\MShop\Exception $e ) |
|
274 | + } catch( \Aimeos\MShop\Exception $e ) |
|
284 | 275 | { |
285 | 276 | $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
286 | 277 | $view->errors = $view->get( 'errors', [] ) + $error; |
287 | 278 | $this->logException( $e ); |
288 | - } |
|
289 | - catch( \Exception $e ) |
|
279 | + } catch( \Exception $e ) |
|
290 | 280 | { |
291 | 281 | $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
292 | 282 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -323,18 +313,15 @@ discard block |
||
323 | 313 | |
324 | 314 | $this->nextAction( $view, $view->param( 'next' ), 'subscription', $view->item->getId(), 'save' ); |
325 | 315 | return; |
326 | - } |
|
327 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
316 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
328 | 317 | { |
329 | 318 | // fall through to create |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -376,14 +363,12 @@ discard block |
||
376 | 363 | foreach( $this->getSubClients() as $client ) { |
377 | 364 | $view->itemBody .= $client->search(); |
378 | 365 | } |
379 | - } |
|
380 | - catch( \Aimeos\MShop\Exception $e ) |
|
366 | + } catch( \Aimeos\MShop\Exception $e ) |
|
381 | 367 | { |
382 | 368 | $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
383 | 369 | $view->errors = $view->get( 'errors', [] ) + $error; |
384 | 370 | $this->logException( $e ); |
385 | - } |
|
386 | - catch( \Exception $e ) |
|
371 | + } catch( \Exception $e ) |
|
387 | 372 | { |
388 | 373 | $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
389 | 374 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Subscription; |
12 | 12 | |
13 | -sprintf( 'subscription' ); // for translation |
|
13 | +sprintf('subscription'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,39 +35,39 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
43 | - $baseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
42 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
43 | + $baseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
44 | 44 | |
45 | - $view->item = $manager->getItem( $id ); |
|
46 | - $view->itemBase = $baseManager->getItem( $view->item->getOrderBaseId(), ['order/base/address', 'order/base/product'] ); |
|
47 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->item = $manager->getItem($id); |
|
46 | + $view->itemBase = $baseManager->getItem($view->item->getOrderBaseId(), ['order/base/address', 'order/base/product']); |
|
47 | + $view->itemData = $this->toArray($view->item, true); |
|
48 | 48 | $view->itemSubparts = $this->getSubClientNames(); |
49 | 49 | $view->itemBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $idx => $client ) |
|
51 | + foreach ($this->getSubClients() as $idx => $client) |
|
52 | 52 | { |
53 | 53 | $view->tabindex = ++$idx + 1; |
54 | 54 | $view->itemBody .= $client->copy(); |
55 | 55 | } |
56 | 56 | } |
57 | - catch( \Aimeos\MShop\Exception $e ) |
|
57 | + catch (\Aimeos\MShop\Exception $e) |
|
58 | 58 | { |
59 | - $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
60 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
61 | - $this->logException( $e ); |
|
59 | + $error = array('subscription-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
60 | + $view->errors = $view->get('errors', []) + $error; |
|
61 | + $this->logException($e); |
|
62 | 62 | } |
63 | - catch( \Exception $e ) |
|
63 | + catch (\Exception $e) |
|
64 | 64 | { |
65 | - $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
66 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
67 | - $this->logException( $e ); |
|
65 | + $error = array('subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
66 | + $view->errors = $view->get('errors', []) + $error; |
|
67 | + $this->logException($e); |
|
68 | 68 | } |
69 | 69 | |
70 | - return $this->render( $view ); |
|
70 | + return $this->render($view); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -83,17 +83,17 @@ discard block |
||
83 | 83 | |
84 | 84 | try |
85 | 85 | { |
86 | - $data = $view->param( 'item', [] ); |
|
86 | + $data = $view->param('item', []); |
|
87 | 87 | |
88 | - if( !isset( $view->item ) ) { |
|
89 | - $view->item = \Aimeos\MShop\Factory::createManager( $context, 'subscription' )->createItem(); |
|
88 | + if (!isset($view->item)) { |
|
89 | + $view->item = \Aimeos\MShop\Factory::createManager($context, 'subscription')->createItem(); |
|
90 | 90 | } |
91 | 91 | |
92 | - $baseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
93 | - $baseId = ( $view->item->getOrderBaseId() ?: $view->param( 'item/subscription.ordbaseid' ) ); |
|
92 | + $baseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
93 | + $baseId = ($view->item->getOrderBaseId() ?: $view->param('item/subscription.ordbaseid')); |
|
94 | 94 | |
95 | - if( $baseId ) { |
|
96 | - $view->itemBase = $baseManager->getItem( $baseId, ['order/base/address', 'order/base/product'] ); |
|
95 | + if ($baseId) { |
|
96 | + $view->itemBase = $baseManager->getItem($baseId, ['order/base/address', 'order/base/product']); |
|
97 | 97 | } else { |
98 | 98 | $view->itemBase = $baseManager->createItem(); |
99 | 99 | } |
@@ -104,26 +104,26 @@ discard block |
||
104 | 104 | $view->itemData = $data; |
105 | 105 | $view->itemBody = ''; |
106 | 106 | |
107 | - foreach( $this->getSubClients() as $idx => $client ) |
|
107 | + foreach ($this->getSubClients() as $idx => $client) |
|
108 | 108 | { |
109 | 109 | $view->tabindex = ++$idx + 1; |
110 | 110 | $view->itemBody .= $client->create(); |
111 | 111 | } |
112 | 112 | } |
113 | - catch( \Aimeos\MShop\Exception $e ) |
|
113 | + catch (\Aimeos\MShop\Exception $e) |
|
114 | 114 | { |
115 | - $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
116 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
117 | - $this->logException( $e ); |
|
115 | + $error = array('subscription-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
116 | + $view->errors = $view->get('errors', []) + $error; |
|
117 | + $this->logException($e); |
|
118 | 118 | } |
119 | - catch( \Exception $e ) |
|
119 | + catch (\Exception $e) |
|
120 | 120 | { |
121 | - $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
122 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
123 | - $this->logException( $e ); |
|
121 | + $error = array('subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
122 | + $view->errors = $view->get('errors', []) + $error; |
|
123 | + $this->logException($e); |
|
124 | 124 | } |
125 | 125 | |
126 | - return $this->render( $view ); |
|
126 | + return $this->render($view); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | |
@@ -137,38 +137,38 @@ discard block |
||
137 | 137 | $view = $this->getView(); |
138 | 138 | $context = $this->getContext(); |
139 | 139 | |
140 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
140 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
141 | 141 | $manager->begin(); |
142 | 142 | |
143 | 143 | try |
144 | 144 | { |
145 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
146 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
145 | + if (($id = $view->param('id')) === null) { |
|
146 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
147 | 147 | } |
148 | 148 | |
149 | - $view->item = $manager->getItem( $id ); |
|
149 | + $view->item = $manager->getItem($id); |
|
150 | 150 | |
151 | - foreach( $this->getSubClients() as $client ) { |
|
151 | + foreach ($this->getSubClients() as $client) { |
|
152 | 152 | $client->delete(); |
153 | 153 | } |
154 | 154 | |
155 | - $manager->deleteItem( $id ); |
|
155 | + $manager->deleteItem($id); |
|
156 | 156 | $manager->commit(); |
157 | 157 | |
158 | - $this->nextAction( $view, 'search', 'subscription', null, 'delete' ); |
|
158 | + $this->nextAction($view, 'search', 'subscription', null, 'delete'); |
|
159 | 159 | return; |
160 | 160 | } |
161 | - catch( \Aimeos\MShop\Exception $e ) |
|
161 | + catch (\Aimeos\MShop\Exception $e) |
|
162 | 162 | { |
163 | - $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
164 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
165 | - $this->logException( $e ); |
|
163 | + $error = array('subscription-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
164 | + $view->errors = $view->get('errors', []) + $error; |
|
165 | + $this->logException($e); |
|
166 | 166 | } |
167 | - catch( \Exception $e ) |
|
167 | + catch (\Exception $e) |
|
168 | 168 | { |
169 | - $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
170 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
171 | - $this->logException( $e ); |
|
169 | + $error = array('subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
170 | + $view->errors = $view->get('errors', []) + $error; |
|
171 | + $this->logException($e); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $manager->rollback(); |
@@ -189,34 +189,34 @@ discard block |
||
189 | 189 | |
190 | 190 | try |
191 | 191 | { |
192 | - $params = $this->storeSearchParams( $view->param(), 'subscription' ); |
|
192 | + $params = $this->storeSearchParams($view->param(), 'subscription'); |
|
193 | 193 | $msg = ['sitecode' => $context->getLocale()->getSite()->getCode()]; |
194 | 194 | |
195 | - if( isset( $params['filter'] ) ) { |
|
196 | - $msg['filter'] = $this->getCriteriaConditions( $params['filter'] ); |
|
195 | + if (isset($params['filter'])) { |
|
196 | + $msg['filter'] = $this->getCriteriaConditions($params['filter']); |
|
197 | 197 | } |
198 | 198 | |
199 | - if( isset( $params['sort'] ) ) { |
|
200 | - $msg['sort'] = $this->getCriteriaSortations( $params['sort'] ); |
|
199 | + if (isset($params['sort'])) { |
|
200 | + $msg['sort'] = $this->getCriteriaSortations($params['sort']); |
|
201 | 201 | } |
202 | 202 | |
203 | - $mq = $context->getMessageQueueManager()->get( 'mq-admin' )->getQueue( 'subscription-export' ); |
|
204 | - $mq->add( json_encode( $msg ) ); |
|
203 | + $mq = $context->getMessageQueueManager()->get('mq-admin')->getQueue('subscription-export'); |
|
204 | + $mq->add(json_encode($msg)); |
|
205 | 205 | |
206 | - $msg = $context->getI18n()->dt( 'admin', 'Your export will be available in a few minutes for download' ); |
|
207 | - $view->info = $view->get( 'info', [] ) + ['subscription-item' => $msg]; |
|
206 | + $msg = $context->getI18n()->dt('admin', 'Your export will be available in a few minutes for download'); |
|
207 | + $view->info = $view->get('info', []) + ['subscription-item' => $msg]; |
|
208 | 208 | } |
209 | - catch( \Aimeos\MShop\Exception $e ) |
|
209 | + catch (\Aimeos\MShop\Exception $e) |
|
210 | 210 | { |
211 | - $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
212 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
213 | - $this->logException( $e ); |
|
211 | + $error = array('subscription-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
212 | + $view->errors = $view->get('errors', []) + $error; |
|
213 | + $this->logException($e); |
|
214 | 214 | } |
215 | - catch( \Exception $e ) |
|
215 | + catch (\Exception $e) |
|
216 | 216 | { |
217 | - $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
218 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
219 | - $this->logException( $e ); |
|
217 | + $error = array('subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
218 | + $view->errors = $view->get('errors', []) + $error; |
|
219 | + $this->logException($e); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | return $this->search(); |
@@ -235,39 +235,39 @@ discard block |
||
235 | 235 | |
236 | 236 | try |
237 | 237 | { |
238 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
239 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
238 | + if (($id = $view->param('id')) === null) { |
|
239 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
240 | 240 | } |
241 | 241 | |
242 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
243 | - $baseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
242 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
243 | + $baseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
244 | 244 | |
245 | - $view->item = $manager->getItem( $id ); |
|
246 | - $view->itemBase = $baseManager->getItem( $view->item->getOrderBaseId(), ['order/base/address', 'order/base/product'] ); |
|
245 | + $view->item = $manager->getItem($id); |
|
246 | + $view->itemBase = $baseManager->getItem($view->item->getOrderBaseId(), ['order/base/address', 'order/base/product']); |
|
247 | 247 | $view->itemSubparts = $this->getSubClientNames(); |
248 | - $view->itemData = $this->toArray( $view->item ); |
|
248 | + $view->itemData = $this->toArray($view->item); |
|
249 | 249 | $view->itemBody = ''; |
250 | 250 | |
251 | - foreach( $this->getSubClients() as $idx => $client ) |
|
251 | + foreach ($this->getSubClients() as $idx => $client) |
|
252 | 252 | { |
253 | 253 | $view->tabindex = ++$idx + 1; |
254 | 254 | $view->itemBody .= $client->get(); |
255 | 255 | } |
256 | 256 | } |
257 | - catch( \Aimeos\MShop\Exception $e ) |
|
257 | + catch (\Aimeos\MShop\Exception $e) |
|
258 | 258 | { |
259 | - $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
260 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
261 | - $this->logException( $e ); |
|
259 | + $error = array('subscription-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
260 | + $view->errors = $view->get('errors', []) + $error; |
|
261 | + $this->logException($e); |
|
262 | 262 | } |
263 | - catch( \Exception $e ) |
|
263 | + catch (\Exception $e) |
|
264 | 264 | { |
265 | - $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
266 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
267 | - $this->logException( $e ); |
|
265 | + $error = array('subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
266 | + $view->errors = $view->get('errors', []) + $error; |
|
267 | + $this->logException($e); |
|
268 | 268 | } |
269 | 269 | |
270 | - return $this->render( $view ); |
|
270 | + return $this->render($view); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -281,40 +281,40 @@ discard block |
||
281 | 281 | $view = $this->getView(); |
282 | 282 | $context = $this->getContext(); |
283 | 283 | |
284 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
284 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
285 | 285 | $manager->begin(); |
286 | 286 | |
287 | 287 | try |
288 | 288 | { |
289 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
290 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
289 | + $item = $this->fromArray($view->param('item', [])); |
|
290 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
291 | 291 | $view->itemBody = ''; |
292 | 292 | |
293 | - foreach( $this->getSubClients() as $client ) { |
|
293 | + foreach ($this->getSubClients() as $client) { |
|
294 | 294 | $view->itemBody .= $client->save(); |
295 | 295 | } |
296 | 296 | |
297 | - $manager->saveItem( clone $view->item ); |
|
297 | + $manager->saveItem(clone $view->item); |
|
298 | 298 | $manager->commit(); |
299 | 299 | |
300 | - $this->nextAction( $view, $view->param( 'next' ), 'subscription', $view->item->getId(), 'save' ); |
|
300 | + $this->nextAction($view, $view->param('next'), 'subscription', $view->item->getId(), 'save'); |
|
301 | 301 | return; |
302 | 302 | } |
303 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
303 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
304 | 304 | { |
305 | 305 | // fall through to create |
306 | 306 | } |
307 | - catch( \Aimeos\MShop\Exception $e ) |
|
307 | + catch (\Aimeos\MShop\Exception $e) |
|
308 | 308 | { |
309 | - $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
310 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
311 | - $this->logException( $e ); |
|
309 | + $error = array('subscription-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
310 | + $view->errors = $view->get('errors', []) + $error; |
|
311 | + $this->logException($e); |
|
312 | 312 | } |
313 | - catch( \Exception $e ) |
|
313 | + catch (\Exception $e) |
|
314 | 314 | { |
315 | - $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
316 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
317 | - $this->logException( $e ); |
|
315 | + $error = array('subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
316 | + $view->errors = $view->get('errors', []) + $error; |
|
317 | + $this->logException($e); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | $manager->rollback(); |
@@ -336,35 +336,35 @@ discard block |
||
336 | 336 | try |
337 | 337 | { |
338 | 338 | $total = 0; |
339 | - $params = $this->storeSearchParams( $view->param(), 'subscription' ); |
|
340 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
339 | + $params = $this->storeSearchParams($view->param(), 'subscription'); |
|
340 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
341 | 341 | |
342 | 342 | $search = $manager->createSearch(); |
343 | - $search->setSortations( [$search->sort( '-', 'subscription.ctime' )] ); |
|
344 | - $search = $this->initCriteria( $search, $params ); |
|
343 | + $search->setSortations([$search->sort('-', 'subscription.ctime')]); |
|
344 | + $search = $this->initCriteria($search, $params); |
|
345 | 345 | |
346 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
347 | - $view->baseItems = $this->getOrderBaseItems( $view->items ); |
|
348 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
346 | + $view->items = $manager->searchItems($search, [], $total); |
|
347 | + $view->baseItems = $this->getOrderBaseItems($view->items); |
|
348 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
349 | 349 | $view->filterOperators = $search->getOperators(); |
350 | 350 | $view->total = $total; |
351 | 351 | $view->itemBody = ''; |
352 | 352 | |
353 | - foreach( $this->getSubClients() as $client ) { |
|
353 | + foreach ($this->getSubClients() as $client) { |
|
354 | 354 | $view->itemBody .= $client->search(); |
355 | 355 | } |
356 | 356 | } |
357 | - catch( \Aimeos\MShop\Exception $e ) |
|
357 | + catch (\Aimeos\MShop\Exception $e) |
|
358 | 358 | { |
359 | - $error = array( 'subscription-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
360 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
361 | - $this->logException( $e ); |
|
359 | + $error = array('subscription-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
360 | + $view->errors = $view->get('errors', []) + $error; |
|
361 | + $this->logException($e); |
|
362 | 362 | } |
363 | - catch( \Exception $e ) |
|
363 | + catch (\Exception $e) |
|
364 | 364 | { |
365 | - $error = array( 'subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
366 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
367 | - $this->logException( $e ); |
|
365 | + $error = array('subscription-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
366 | + $view->errors = $view->get('errors', []) + $error; |
|
367 | + $this->logException($e); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** admin/jqadm/subscription/template-list |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $tplconf = 'admin/jqadm/subscription/template-list'; |
390 | 390 | $default = 'subscription/list-standard.php'; |
391 | 391 | |
392 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
392 | + return $view->render($view->config($tplconf, $default)); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | * @param string|null $name Name of the sub-client (Default if null) |
401 | 401 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
402 | 402 | */ |
403 | - public function getSubClient( $type, $name = null ) |
|
403 | + public function getSubClient($type, $name = null) |
|
404 | 404 | { |
405 | 405 | /** admin/jqadm/subscription/decorators/excludes |
406 | 406 | * Excludes decorators added by the "common" option from the subscription JQAdm client |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | * @see admin/jqadm/subscription/decorators/excludes |
476 | 476 | * @see admin/jqadm/subscription/decorators/global |
477 | 477 | */ |
478 | - return $this->createSubClient( 'subscription/' . $type, $name ); |
|
478 | + return $this->createSubClient('subscription/' . $type, $name); |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | |
@@ -485,19 +485,19 @@ discard block |
||
485 | 485 | * @param \Aimeos\MShop\Subscription\Item\Iface[] $items List of subscription items |
486 | 486 | * @param \Aimeos\MShop\Order\Item\Base\Iface[] List of order base items |
487 | 487 | */ |
488 | - protected function getOrderBaseItems( array $items ) |
|
488 | + protected function getOrderBaseItems(array $items) |
|
489 | 489 | { |
490 | 490 | $baseIds = []; |
491 | - foreach( $items as $item ) { |
|
491 | + foreach ($items as $item) { |
|
492 | 492 | $baseIds[] = $item->getOrderBaseId(); |
493 | 493 | } |
494 | 494 | |
495 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/base' ); |
|
495 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order/base'); |
|
496 | 496 | |
497 | - $search = $manager->createSearch()->setSlice( 0, count( $baseIds ) ); |
|
498 | - $search->setConditions( $search->compare( '==', 'order.base.id', $baseIds ) ); |
|
497 | + $search = $manager->createSearch()->setSlice(0, count($baseIds)); |
|
498 | + $search->setConditions($search->compare('==', 'order.base.id', $baseIds)); |
|
499 | 499 | |
500 | - return $manager->searchItems( $search, ['order/base/address', 'order/base/product'] ); |
|
500 | + return $manager->searchItems($search, ['order/base/address', 'order/base/product']); |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * @since 2018.04 |
542 | 542 | * @category Developer |
543 | 543 | */ |
544 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/subscription/standard/subparts', [] ); |
|
544 | + return $this->getContext()->getConfig()->get('admin/jqadm/subscription/standard/subparts', []); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | |
@@ -551,17 +551,17 @@ discard block |
||
551 | 551 | * @param string[] Data array |
552 | 552 | * @return \Aimeos\MShop\Subscription\Item\Iface New subscription item object |
553 | 553 | */ |
554 | - protected function fromArray( array $data ) |
|
554 | + protected function fromArray(array $data) |
|
555 | 555 | { |
556 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'subscription' ); |
|
556 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'subscription'); |
|
557 | 557 | |
558 | - if( isset( $data['subscription.id'] ) && $data['subscription.id'] != '' ) { |
|
559 | - $item = $manager->getItem( $data['subscription.id'] ); |
|
558 | + if (isset($data['subscription.id']) && $data['subscription.id'] != '') { |
|
559 | + $item = $manager->getItem($data['subscription.id']); |
|
560 | 560 | } else { |
561 | 561 | $item = $manager->createItem(); |
562 | 562 | } |
563 | 563 | |
564 | - $item->fromArray( $data ); |
|
564 | + $item->fromArray($data); |
|
565 | 565 | |
566 | 566 | return $item; |
567 | 567 | } |
@@ -573,12 +573,12 @@ discard block |
||
573 | 573 | * @param \Aimeos\MShop\Subscription\Item\Iface $item Subscription item object |
574 | 574 | * @return string[] Multi-dimensional associative list of item data |
575 | 575 | */ |
576 | - protected function toArray( \Aimeos\MShop\Subscription\Item\Iface $item, $copy = false ) |
|
576 | + protected function toArray(\Aimeos\MShop\Subscription\Item\Iface $item, $copy = false) |
|
577 | 577 | { |
578 | 578 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
579 | - $data = $item->toArray( true ); |
|
579 | + $data = $item->toArray(true); |
|
580 | 580 | |
581 | - if( $copy === true ) |
|
581 | + if ($copy === true) |
|
582 | 582 | { |
583 | 583 | $data['subscription.siteid'] = $siteId; |
584 | 584 | $data['subscription.id'] = ''; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
595 | 595 | * @return string HTML output |
596 | 596 | */ |
597 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
597 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
598 | 598 | { |
599 | 599 | /** admin/jqadm/subscription/template-item |
600 | 600 | * Relative path to the HTML body template for the subscription item. |
@@ -618,6 +618,6 @@ discard block |
||
618 | 618 | $tplconf = 'admin/jqadm/subscription/template-item'; |
619 | 619 | $default = 'subscription/item-standard.php'; |
620 | 620 | |
621 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
621 | + return $view->render($view->config($tplconf, $default)); |
|
622 | 622 | } |
623 | 623 | } |
@@ -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/subscription/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/subscription/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/subscription/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\\Subscription\\' . $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\\Subscription\\' . $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\\Subscription\\' . $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, 'subscription' ); |
|
82 | + return self::addClientDecorators($context, $client, 'subscription'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |