@@ -17,49 +17,49 @@ |
||
17 | 17 | */ |
18 | 18 | |
19 | 19 | |
20 | -$selected = function( array $filter, $key, $code ) { |
|
21 | - return ( isset( $filter[$key][0] ) && $filter[$key][0] == $code ? 'selected="selected"' : '' ); |
|
20 | +$selected = function(array $filter, $key, $code) { |
|
21 | + return (isset($filter[$key][0]) && $filter[$key][0] == $code ? 'selected="selected"' : ''); |
|
22 | 22 | }; |
23 | 23 | |
24 | 24 | |
25 | -$target = $this->config( 'admin/jqadm/url/search/target' ); |
|
26 | -$controller = $this->config( 'admin/jqadm/url/search/controller', 'Jqadm' ); |
|
27 | -$action = $this->config( 'admin/jqadm/url/search/action', 'search' ); |
|
28 | -$config = $this->config( 'admin/jqadm/url/search/config', [] ); |
|
25 | +$target = $this->config('admin/jqadm/url/search/target'); |
|
26 | +$controller = $this->config('admin/jqadm/url/search/controller', 'Jqadm'); |
|
27 | +$action = $this->config('admin/jqadm/url/search/action', 'search'); |
|
28 | +$config = $this->config('admin/jqadm/url/search/config', []); |
|
29 | 29 | |
30 | -$filter = $this->get( 'filter', [] ); |
|
31 | -$params = $this->get( 'params', [] ); |
|
30 | +$filter = $this->get('filter', []); |
|
31 | +$params = $this->get('params', []); |
|
32 | 32 | $params['page']['start'] = 0; |
33 | -unset( $params['filter'] ); |
|
33 | +unset($params['filter']); |
|
34 | 34 | |
35 | 35 | $enc = $this->encoder(); |
36 | 36 | |
37 | 37 | |
38 | 38 | ?> |
39 | -<form class="form-inline" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $params, [], $config ) ); ?>"> |
|
39 | +<form class="form-inline" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $params, [], $config)); ?>"> |
|
40 | 40 | <?= $this->csrf()->formfield(); ?> |
41 | 41 | |
42 | 42 | <i class="fa more"></i> |
43 | 43 | |
44 | 44 | <div class="input-group"> |
45 | - <select class="custom-select filter-key" name="<?= $this->formparam( ['filter', 'key', '0'] ); ?>"> |
|
46 | - <?php foreach( $this->get( 'filterAttributes', [] ) as $code => $attrItem ) : ?> |
|
47 | - <?php if( $attrItem->isPublic() ) : ?> |
|
48 | - <option value="<?= $enc->attr( $code ); ?>" data-type="<?= $enc->attr( $attrItem->getType() ); ?>" <?= $selected( $filter, 'key', $code ); ?> > |
|
49 | - <?= $enc->html( $this->translate( 'admin/ext', $attrItem->getLabel() ) ); ?> |
|
45 | + <select class="custom-select filter-key" name="<?= $this->formparam(['filter', 'key', '0']); ?>"> |
|
46 | + <?php foreach ($this->get('filterAttributes', []) as $code => $attrItem) : ?> |
|
47 | + <?php if ($attrItem->isPublic()) : ?> |
|
48 | + <option value="<?= $enc->attr($code); ?>" data-type="<?= $enc->attr($attrItem->getType()); ?>" <?= $selected($filter, 'key', $code); ?> > |
|
49 | + <?= $enc->html($this->translate('admin/ext', $attrItem->getLabel())); ?> |
|
50 | 50 | </option> |
51 | 51 | <?php endif; ?> |
52 | 52 | <?php endforeach; ?> |
53 | 53 | </select> |
54 | - <select class="custom-select filter-operator" name="<?= $this->formparam( ['filter', 'op', '0'] ); ?>"> |
|
55 | - <?php foreach( $this->get( 'filterOperators/compare', [] ) as $code ) : ?> |
|
56 | - <option value="<?= $enc->attr( $code ); ?>" <?= $selected( $filter, 'op', $code ); ?> > |
|
57 | - <?= $enc->html( $code ) . ( strlen( $code ) === 1 ? ' ' : '' ); ?> <?= $enc->html( $this->translate( 'admin/ext', $code ) ); ?> |
|
54 | + <select class="custom-select filter-operator" name="<?= $this->formparam(['filter', 'op', '0']); ?>"> |
|
55 | + <?php foreach ($this->get('filterOperators/compare', []) as $code) : ?> |
|
56 | + <option value="<?= $enc->attr($code); ?>" <?= $selected($filter, 'op', $code); ?> > |
|
57 | + <?= $enc->html($code) . (strlen($code) === 1 ? ' ' : ''); ?> <?= $enc->html($this->translate('admin/ext', $code)); ?> |
|
58 | 58 | </option> |
59 | 59 | <?php endforeach; ?> |
60 | 60 | </select> |
61 | - <input type="text" class="form-control filter-value" name="<?= $this->formparam( ['filter', 'val', '0'] ); ?>" |
|
62 | - value="<?= $enc->attr( ( isset( $filter['val'][0] ) ? $filter['val'][0] : '' ) ); ?>" > |
|
61 | + <input type="text" class="form-control filter-value" name="<?= $this->formparam(['filter', 'val', '0']); ?>" |
|
62 | + value="<?= $enc->attr((isset($filter['val'][0]) ? $filter['val'][0] : '')); ?>" > |
|
63 | 63 | <div class="input-group-append"> |
64 | 64 | <button class="btn btn-primary fa fa-search"></button> |
65 | 65 | </div> |
@@ -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( 'group-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( 'group-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( 'group-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( 'group-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', 'group', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'group-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( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'group-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( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'group', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'group-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( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -464,7 +464,7 @@ |
||
464 | 464 | * Creates new and updates existing items using the data array |
465 | 465 | * |
466 | 466 | * @param string[] Data array |
467 | - * @return \Aimeos\MShop\Group\Item\Iface New group item object |
|
467 | + * @return \Aimeos\MShop\Common\Item\Iface New group item object |
|
468 | 468 | */ |
469 | 469 | protected function fromArray( array $data ) |
470 | 470 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Group; |
12 | 12 | |
13 | -sprintf( 'group' ); // for translation |
|
13 | +sprintf('group'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop\Factory::createManager($context, 'customer/group')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['customer.group.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' ); |
|
129 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'group', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'group', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' ); |
|
185 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' ); |
|
225 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'group', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'group', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'group' ); |
|
281 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'group'); |
|
281 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/group/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/group/template-list'; |
327 | 327 | $default = 'group/list-standard.php'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $type, $name = null ) |
|
340 | + public function getSubClient($type, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/group/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the group JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/group/decorators/excludes |
413 | 413 | * @see admin/jqadm/group/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'group/' . $type, $name ); |
|
415 | + return $this->createSubClient('group/' . $type, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2018.07 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/group/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/group/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Group\Item\Iface New group item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/group' ); |
|
472 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/group'); |
|
473 | 473 | |
474 | - if( isset( $data['customer.group.id'] ) && $data['customer.group.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['customer.group.id'] ); |
|
474 | + if (isset($data['customer.group.id']) && $data['customer.group.id'] != '') { |
|
475 | + $item = $manager->getItem($data['customer.group.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Customer\Item\Group\Iface $item Group item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Customer\Item\Group\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Customer\Item\Group\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['customer.group.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
499 | 499 | $data['customer.group.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/group/template-item |
515 | 515 | * Relative path to the HTML body template for the group item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/group/template-item'; |
534 | 534 | $default = 'group/item-standard.php'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -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/group/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2018.07 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/group/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/group/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\\Group\\' . $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\\Group\\' . $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\\Group\\' . $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, 'group' ); |
|
82 | + return self::addClientDecorators($context, $client, 'group'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Group\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\Group\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/group' ); |
|
77 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/group'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'unitgroup' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('unitgroup')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'unitgroup', $result ); |
|
85 | + $this->assertContains('unitgroup', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/group' ); |
|
161 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/group'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'unitgroup' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('unitgroup')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'unitgroup', $result ); |
|
169 | + $this->assertContains('unitgroup', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Group\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Group\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
209 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/group' ); |
|
216 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/group'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -224,26 +224,26 @@ discard block |
||
224 | 224 | ), |
225 | 225 | ); |
226 | 226 | |
227 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
228 | - $this->view->addHelper( 'param', $helper ); |
|
227 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
228 | + $this->view->addHelper('param', $helper); |
|
229 | 229 | |
230 | 230 | $this->object->save(); |
231 | 231 | |
232 | - $manager->deleteItem( $manager->findItem( 'jqadm@test' )->getId() ); |
|
232 | + $manager->deleteItem($manager->findItem('jqadm@test')->getId()); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | |
236 | 236 | public function testSaveException() |
237 | 237 | { |
238 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
239 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
240 | - ->setMethods( array( 'fromArray' ) ) |
|
238 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
239 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
240 | + ->setMethods(array('fromArray')) |
|
241 | 241 | ->getMock(); |
242 | 242 | |
243 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
244 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
243 | + $object->expects($this->once())->method('fromArray') |
|
244 | + ->will($this->throwException(new \RuntimeException())); |
|
245 | 245 | |
246 | - $object->setView( $this->getViewNoRender() ); |
|
246 | + $object->setView($this->getViewNoRender()); |
|
247 | 247 | |
248 | 248 | $object->save(); |
249 | 249 | } |
@@ -251,15 +251,15 @@ discard block |
||
251 | 251 | |
252 | 252 | public function testSaveMShopException() |
253 | 253 | { |
254 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
255 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
256 | - ->setMethods( array( 'fromArray' ) ) |
|
254 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
255 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
256 | + ->setMethods(array('fromArray')) |
|
257 | 257 | ->getMock(); |
258 | 258 | |
259 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
260 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
259 | + $object->expects($this->once())->method('fromArray') |
|
260 | + ->will($this->throwException(new \RuntimeException())); |
|
261 | 261 | |
262 | - $object->setView( $this->getViewNoRender() ); |
|
262 | + $object->setView($this->getViewNoRender()); |
|
263 | 263 | |
264 | 264 | $object->save(); |
265 | 265 | } |
@@ -267,15 +267,15 @@ discard block |
||
267 | 267 | |
268 | 268 | public function testSaveJQAdmException() |
269 | 269 | { |
270 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
271 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
272 | - ->setMethods( array( 'fromArray' ) ) |
|
270 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
271 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
272 | + ->setMethods(array('fromArray')) |
|
273 | 273 | ->getMock(); |
274 | 274 | |
275 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
276 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
275 | + $object->expects($this->once())->method('fromArray') |
|
276 | + ->will($this->throwException(new \RuntimeException())); |
|
277 | 277 | |
278 | - $object->setView( $this->getViewNoRender() ); |
|
278 | + $object->setView($this->getViewNoRender()); |
|
279 | 279 | |
280 | 280 | $object->save(); |
281 | 281 | } |
@@ -286,32 +286,32 @@ discard block |
||
286 | 286 | $param = array( |
287 | 287 | 'type' => 'unittest', 'lang' => 'de', |
288 | 288 | 'filter' => array( |
289 | - 'key' => array( 0 => 'customer.group.code' ), |
|
290 | - 'op' => array( 0 => '==' ), |
|
291 | - 'val' => array( 0 => 'unitgroup' ), |
|
289 | + 'key' => array(0 => 'customer.group.code'), |
|
290 | + 'op' => array(0 => '=='), |
|
291 | + 'val' => array(0 => 'unitgroup'), |
|
292 | 292 | ), |
293 | - 'sort' => array( '-customer.group.id' ), |
|
293 | + 'sort' => array('-customer.group.id'), |
|
294 | 294 | ); |
295 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
296 | - $this->view->addHelper( 'param', $helper ); |
|
295 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
296 | + $this->view->addHelper('param', $helper); |
|
297 | 297 | |
298 | 298 | $result = $this->object->search(); |
299 | 299 | |
300 | - $this->assertContains( '>unitgroup<', $result ); |
|
300 | + $this->assertContains('>unitgroup<', $result); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
304 | 304 | public function testSearchException() |
305 | 305 | { |
306 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
307 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
308 | - ->setMethods( array( 'initCriteria' ) ) |
|
306 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
307 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
308 | + ->setMethods(array('initCriteria')) |
|
309 | 309 | ->getMock(); |
310 | 310 | |
311 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
312 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
311 | + $object->expects($this->once())->method('initCriteria') |
|
312 | + ->will($this->throwException(new \RuntimeException())); |
|
313 | 313 | |
314 | - $object->setView( $this->getViewNoRender() ); |
|
314 | + $object->setView($this->getViewNoRender()); |
|
315 | 315 | |
316 | 316 | $object->search(); |
317 | 317 | } |
@@ -319,15 +319,15 @@ discard block |
||
319 | 319 | |
320 | 320 | public function testSearchMShopException() |
321 | 321 | { |
322 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Group\Standard' ) |
|
323 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
324 | - ->setMethods( array( 'initCriteria' ) ) |
|
322 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Group\Standard') |
|
323 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
324 | + ->setMethods(array('initCriteria')) |
|
325 | 325 | ->getMock(); |
326 | 326 | |
327 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
328 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
327 | + $object->expects($this->once())->method('initCriteria') |
|
328 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
329 | 329 | |
330 | - $object->setView( $this->getViewNoRender() ); |
|
330 | + $object->setView($this->getViewNoRender()); |
|
331 | 331 | |
332 | 332 | $object->search(); |
333 | 333 | } |
@@ -335,33 +335,33 @@ discard block |
||
335 | 335 | |
336 | 336 | public function testGetSubClientInvalid() |
337 | 337 | { |
338 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
339 | - $this->object->getSubClient( '$unknown$' ); |
|
338 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
339 | + $this->object->getSubClient('$unknown$'); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | |
343 | 343 | public function testGetSubClientUnknown() |
344 | 344 | { |
345 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
346 | - $this->object->getSubClient( 'unknown' ); |
|
345 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
346 | + $this->object->getSubClient('unknown'); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | |
350 | 350 | protected function getViewNoRender() |
351 | 351 | { |
352 | - $view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' ) |
|
353 | - ->setConstructorArgs( array( [] ) ) |
|
354 | - ->setMethods( array( 'render', 'config' ) ) |
|
352 | + $view = $this->getMockBuilder('\Aimeos\MW\View\Standard') |
|
353 | + ->setConstructorArgs(array([])) |
|
354 | + ->setMethods(array('render', 'config')) |
|
355 | 355 | ->getMock(); |
356 | 356 | |
357 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/group' ); |
|
357 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/group'); |
|
358 | 358 | |
359 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'unitgroup' )->getId()]; |
|
360 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
361 | - $view->addHelper( 'param', $helper ); |
|
359 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('unitgroup')->getId()]; |
|
360 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
361 | + $view->addHelper('param', $helper); |
|
362 | 362 | |
363 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
364 | - $view->addHelper( 'access', $helper ); |
|
363 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
364 | + $view->addHelper('access', $helper); |
|
365 | 365 | |
366 | 366 | return $view; |
367 | 367 | } |
@@ -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\Group\Factory::createClient( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Group\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\Group\Factory::createClient( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Group\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\Group\Factory::createClient( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Group\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\Group\Factory::createClient( $this->context, '%group' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Group\Factory::createClient($this->context, '%group'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Group\Factory::createClient( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Group\Factory::createClient($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -5,38 +5,38 @@ discard block |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2018 |
6 | 6 | */ |
7 | 7 | |
8 | -$selected = function( $key, $code ) { |
|
9 | - return ( $key == $code ? 'selected="selected"' : '' ); |
|
8 | +$selected = function($key, $code) { |
|
9 | + return ($key == $code ? 'selected="selected"' : ''); |
|
10 | 10 | }; |
11 | 11 | |
12 | 12 | $enc = $this->encoder(); |
13 | 13 | |
14 | 14 | |
15 | -$target = $this->config( 'admin/jqadm/url/save/target' ); |
|
16 | -$cntl = $this->config( 'admin/jqadm/url/save/controller', 'Jqadm' ); |
|
17 | -$action = $this->config( 'admin/jqadm/url/save/action', 'save' ); |
|
18 | -$config = $this->config( 'admin/jqadm/url/save/config', [] ); |
|
15 | +$target = $this->config('admin/jqadm/url/save/target'); |
|
16 | +$cntl = $this->config('admin/jqadm/url/save/controller', 'Jqadm'); |
|
17 | +$action = $this->config('admin/jqadm/url/save/action', 'save'); |
|
18 | +$config = $this->config('admin/jqadm/url/save/config', []); |
|
19 | 19 | |
20 | -$params = $this->get( 'pageParams', [] ); |
|
20 | +$params = $this->get('pageParams', []); |
|
21 | 21 | |
22 | 22 | |
23 | 23 | ?> |
24 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
24 | +<?php $this->block()->start('jqadm_content'); ?> |
|
25 | 25 | |
26 | -<form class="item item-group form-horizontal" method="POST" enctype="multipart/form-data" action="<?= $enc->attr( $this->url( $target, $cntl, $action, $params, [], $config ) ); ?>"> |
|
27 | - <input id="item-id" type="hidden" name="<?= $enc->attr( $this->formparam( array( 'item', 'customer.group.id' ) ) ); ?>" value="<?= $enc->attr( $this->get( 'itemData/customer.group.id' ) ); ?>" /> |
|
28 | - <input id="item-next" type="hidden" name="<?= $enc->attr( $this->formparam( array( 'next' ) ) ); ?>" value="get" /> |
|
26 | +<form class="item item-group form-horizontal" method="POST" enctype="multipart/form-data" action="<?= $enc->attr($this->url($target, $cntl, $action, $params, [], $config)); ?>"> |
|
27 | + <input id="item-id" type="hidden" name="<?= $enc->attr($this->formparam(array('item', 'customer.group.id'))); ?>" value="<?= $enc->attr($this->get('itemData/customer.group.id')); ?>" /> |
|
28 | + <input id="item-next" type="hidden" name="<?= $enc->attr($this->formparam(array('next'))); ?>" value="get" /> |
|
29 | 29 | <?= $this->csrf()->formfield(); ?> |
30 | 30 | |
31 | 31 | <nav class="main-navbar"> |
32 | 32 | <span class="navbar-brand"> |
33 | - <?= $enc->html( $this->translate( 'admin', 'Group' ) ); ?>: |
|
34 | - <?= $enc->html( $this->get( 'itemData/customer.group.id' ) ); ?> - |
|
35 | - <?= $enc->html( $this->get( 'itemData/customer.group.label', $this->translate( 'admin', 'New' ) ) ) ?> |
|
36 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->match( $this->get( 'itemData/customer.group.siteid' ) ) ); ?>)</span> |
|
33 | + <?= $enc->html($this->translate('admin', 'Group')); ?>: |
|
34 | + <?= $enc->html($this->get('itemData/customer.group.id')); ?> - |
|
35 | + <?= $enc->html($this->get('itemData/customer.group.label', $this->translate('admin', 'New'))) ?> |
|
36 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->match($this->get('itemData/customer.group.siteid'))); ?>)</span> |
|
37 | 37 | </span> |
38 | 38 | <div class="item-actions"> |
39 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php' ), ['params' => $params] ); ?> |
|
39 | + <?= $this->partial($this->config('admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php'), ['params' => $params]); ?> |
|
40 | 40 | </div> |
41 | 41 | </nav> |
42 | 42 | |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | |
48 | 48 | <li class="nav-item basic"> |
49 | 49 | <a class="nav-link active" href="#basic" data-toggle="tab" role="tab" aria-expanded="true" aria-controls="basic"> |
50 | - <?= $enc->html( $this->translate( 'admin', 'Basic' ) ); ?> |
|
50 | + <?= $enc->html($this->translate('admin', 'Basic')); ?> |
|
51 | 51 | </a> |
52 | 52 | </li> |
53 | 53 | |
54 | - <?php foreach( array_values( $this->get( 'itemSubparts', [] ) ) as $idx => $subpart ) : ?> |
|
55 | - <li class="nav-item <?= $enc->attr( $subpart ); ?>"> |
|
56 | - <a class="nav-link" href="#<?= $enc->attr( $subpart ); ?>" data-toggle="tab" role="tab" tabindex="<?= ++$idx+1; ?>"> |
|
57 | - <?= $enc->html( $this->translate( 'admin', $subpart ) ); ?> |
|
54 | + <?php foreach (array_values($this->get('itemSubparts', [])) as $idx => $subpart) : ?> |
|
55 | + <li class="nav-item <?= $enc->attr($subpart); ?>"> |
|
56 | + <a class="nav-link" href="#<?= $enc->attr($subpart); ?>" data-toggle="tab" role="tab" tabindex="<?= ++$idx + 1; ?>"> |
|
57 | + <?= $enc->html($this->translate('admin', $subpart)); ?> |
|
58 | 58 | </a> |
59 | 59 | </li> |
60 | 60 | <?php endforeach; ?> |
@@ -63,61 +63,61 @@ discard block |
||
63 | 63 | |
64 | 64 | <div class="item-meta text-muted"> |
65 | 65 | <small> |
66 | - <?= $enc->html( $this->translate( 'admin', 'Modified' ) ); ?>: |
|
67 | - <span class="meta-value"><?= $enc->html( $this->get( 'itemData/customer.group.mtime' ) ); ?></span> |
|
66 | + <?= $enc->html($this->translate('admin', 'Modified')); ?>: |
|
67 | + <span class="meta-value"><?= $enc->html($this->get('itemData/customer.group.mtime')); ?></span> |
|
68 | 68 | </small> |
69 | 69 | <small> |
70 | - <?= $enc->html( $this->translate( 'admin', 'Created' ) ); ?>: |
|
71 | - <span class="meta-value"><?= $enc->html( $this->get( 'itemData/customer.group.ctime' ) ); ?></span> |
|
70 | + <?= $enc->html($this->translate('admin', 'Created')); ?>: |
|
71 | + <span class="meta-value"><?= $enc->html($this->get('itemData/customer.group.ctime')); ?></span> |
|
72 | 72 | </small> |
73 | 73 | <small> |
74 | - <?= $enc->html( $this->translate( 'admin', 'Editor' ) ); ?>: |
|
75 | - <span class="meta-value"><?= $enc->html( $this->get( 'itemData/customer.group.editor' ) ); ?></span> |
|
74 | + <?= $enc->html($this->translate('admin', 'Editor')); ?>: |
|
75 | + <span class="meta-value"><?= $enc->html($this->get('itemData/customer.group.editor')); ?></span> |
|
76 | 76 | </small> |
77 | 77 | </div> |
78 | 78 | </div> |
79 | 79 | |
80 | 80 | <div class="col-md-9 item-content tab-content"> |
81 | - <?php $readonly = ( $this->access( ['admin', 'super'] ) === false ? $this->site()->readonly( $this->get( 'itemData/customer.group.siteid' ) ) : '' ); ?> |
|
81 | + <?php $readonly = ($this->access(['admin', 'super']) === false ? $this->site()->readonly($this->get('itemData/customer.group.siteid')) : ''); ?> |
|
82 | 82 | |
83 | 83 | <div id="basic" class="row item-basic tab-pane fade show active" role="tabpanel" aria-labelledby="basic"> |
84 | 84 | |
85 | 85 | <div class="col-xl-6 content-block <?= $readonly ?>"> |
86 | 86 | <div class="form-group row mandatory"> |
87 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Code' ) ); ?></label> |
|
87 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Code')); ?></label> |
|
88 | 88 | <div class="col-sm-8"> |
89 | 89 | <input class="form-control item-code" type="text" required="required" tabindex="1" |
90 | - name="<?= $enc->attr( $this->formparam( array( 'item', 'customer.group.code' ) ) ); ?>" |
|
91 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Unique group code (required)' ) ); ?>" |
|
92 | - value="<?= $enc->attr( $this->get( 'itemData/customer.group.code' ) ); ?>" |
|
93 | - <?= $this->site()->readonly( $this->get( 'itemData/customer.group.siteid' ) ); ?> /> |
|
90 | + name="<?= $enc->attr($this->formparam(array('item', 'customer.group.code'))); ?>" |
|
91 | + placeholder="<?= $enc->attr($this->translate('admin', 'Unique group code (required)')); ?>" |
|
92 | + value="<?= $enc->attr($this->get('itemData/customer.group.code')); ?>" |
|
93 | + <?= $this->site()->readonly($this->get('itemData/customer.group.siteid')); ?> /> |
|
94 | 94 | </div> |
95 | 95 | <div class="col-sm-12 form-text text-muted help-text"> |
96 | - <?= $enc->html( $this->translate( 'admin', 'Alphanumeric string that can identify the group uniquely' ) ); ?> |
|
96 | + <?= $enc->html($this->translate('admin', 'Alphanumeric string that can identify the group uniquely')); ?> |
|
97 | 97 | </div> |
98 | 98 | </div> |
99 | 99 | <div class="form-group row mandatory"> |
100 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Label' ) ); ?></label> |
|
100 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Label')); ?></label> |
|
101 | 101 | <div class="col-sm-8"> |
102 | 102 | <input class="form-control item-label" type="text" required="required" tabindex="1" |
103 | - name="<?= $this->formparam( array( 'item', 'customer.group.label' ) ); ?>" |
|
104 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Internal name (required)' ) ); ?>" |
|
105 | - value="<?= $enc->attr( $this->get( 'itemData/customer.group.label' ) ); ?>" |
|
106 | - <?= $this->site()->readonly( $this->get( 'itemData/customer.group.siteid' ) ); ?> /> |
|
103 | + name="<?= $this->formparam(array('item', 'customer.group.label')); ?>" |
|
104 | + placeholder="<?= $enc->attr($this->translate('admin', 'Internal name (required)')); ?>" |
|
105 | + value="<?= $enc->attr($this->get('itemData/customer.group.label')); ?>" |
|
106 | + <?= $this->site()->readonly($this->get('itemData/customer.group.siteid')); ?> /> |
|
107 | 107 | </div> |
108 | 108 | <div class="col-sm-12 form-text text-muted help-text"> |
109 | - <?= $enc->html( $this->translate( 'admin', 'Group name describing for which members the group is for' ) ); ?> |
|
109 | + <?= $enc->html($this->translate('admin', 'Group name describing for which members the group is for')); ?> |
|
110 | 110 | </div> |
111 | 111 | </div> |
112 | 112 | </div> |
113 | 113 | </div> |
114 | 114 | |
115 | - <?= $this->get( 'itemBody' ); ?> |
|
115 | + <?= $this->get('itemBody'); ?> |
|
116 | 116 | |
117 | 117 | </div> |
118 | 118 | |
119 | 119 | <div class="item-actions"> |
120 | - <?= $this->partial( $this->config( 'admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php' ), ['params' => $params] ); ?> |
|
120 | + <?= $this->partial($this->config('admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php'), ['params' => $params]); ?> |
|
121 | 121 | </div> |
122 | 122 | </div> |
123 | 123 | </form> |
@@ -125,4 +125,4 @@ discard block |
||
125 | 125 | <?php $this->block()->stop(); ?> |
126 | 126 | |
127 | 127 | |
128 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?> |
|
128 | +<?= $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/group/fields |
@@ -49,37 +49,37 @@ discard block |
||
49 | 49 | * @category Developer |
50 | 50 | */ |
51 | 51 | $default = ['customer.group.status', 'customer.group.label', 'customer.group.code']; |
52 | -$default = $this->config( 'admin/jqadm/group/fields', $default ); |
|
53 | -$fields = $this->session( 'aimeos/admin/jqadm/group/fields', $default ); |
|
52 | +$default = $this->config('admin/jqadm/group/fields', $default); |
|
53 | +$fields = $this->session('aimeos/admin/jqadm/group/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 | - 'customer.group.id' => $this->translate( 'admin', 'ID' ), |
|
60 | - 'customer.group.code' => $this->translate( 'admin', 'Code' ), |
|
61 | - 'customer.group.label' => $this->translate( 'admin', 'Label' ), |
|
62 | - 'customer.group.ctime' => $this->translate( 'admin', 'Created' ), |
|
63 | - 'customer.group.mtime' => $this->translate( 'admin', 'Modified' ), |
|
64 | - 'customer.group.editor' => $this->translate( 'admin', 'Editor' ), |
|
59 | + 'customer.group.id' => $this->translate('admin', 'ID'), |
|
60 | + 'customer.group.code' => $this->translate('admin', 'Code'), |
|
61 | + 'customer.group.label' => $this->translate('admin', 'Label'), |
|
62 | + 'customer.group.ctime' => $this->translate('admin', 'Created'), |
|
63 | + 'customer.group.mtime' => $this->translate('admin', 'Modified'), |
|
64 | + 'customer.group.editor' => $this->translate('admin', 'Editor'), |
|
65 | 65 | ]; |
66 | 66 | |
67 | 67 | |
68 | 68 | ?> |
69 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
69 | +<?php $this->block()->start('jqadm_content'); ?> |
|
70 | 70 | |
71 | 71 | <nav class="main-navbar"> |
72 | 72 | |
73 | 73 | <span class="navbar-brand"> |
74 | - <?= $enc->html( $this->translate( 'admin', 'Group' ) ); ?> |
|
75 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span> |
|
74 | + <?= $enc->html($this->translate('admin', 'Group')); ?> |
|
75 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span> |
|
76 | 76 | </span> |
77 | 77 | |
78 | 78 | <?= $this->partial( |
79 | - $this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php' ), [ |
|
80 | - 'filter' => $this->session( 'aimeos/admin/jqadm/group/filter', [] ), |
|
81 | - 'filterAttributes' => $this->get( 'filterAttributes', [] ), |
|
82 | - 'filterOperators' => $this->get( 'filterOperators', [] ), |
|
79 | + $this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard.php'), [ |
|
80 | + 'filter' => $this->session('aimeos/admin/jqadm/group/filter', []), |
|
81 | + 'filterAttributes' => $this->get('filterAttributes', []), |
|
82 | + 'filterOperators' => $this->get('filterOperators', []), |
|
83 | 83 | 'params' => $params, |
84 | 84 | ] |
85 | 85 | ); ?> |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | |
88 | 88 | |
89 | 89 | <?= $this->partial( |
90 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
91 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ), |
|
92 | - 'page' => $this->session( 'aimeos/admin/jqadm/group/page', [] )] |
|
90 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
91 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'), |
|
92 | + 'page' => $this->session('aimeos/admin/jqadm/group/page', [])] |
|
93 | 93 | ); |
94 | 94 | ?> |
95 | 95 | |
96 | -<form class="list list-group" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>"> |
|
96 | +<form class="list list-group" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>"> |
|
97 | 97 | <?= $this->csrf()->formfield(); ?> |
98 | 98 | |
99 | 99 | <table class="list-items table table-hover table-striped"> |
@@ -101,20 +101,20 @@ discard block |
||
101 | 101 | <tr> |
102 | 102 | |
103 | 103 | <?= $this->partial( |
104 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php' ), |
|
105 | - ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/group/sort' )] |
|
104 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard.php'), |
|
105 | + ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/group/sort')] |
|
106 | 106 | ); |
107 | 107 | ?> |
108 | 108 | |
109 | 109 | <th class="actions"> |
110 | 110 | <a class="btn fa act-add" tabindex="1" |
111 | - href="<?= $enc->attr( $this->url( $newTarget, $newCntl, $newAction, $params, [], $newConfig ) ); ?>" |
|
112 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
113 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Add' ) ); ?>"> |
|
111 | + href="<?= $enc->attr($this->url($newTarget, $newCntl, $newAction, $params, [], $newConfig)); ?>" |
|
112 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
113 | + aria-label="<?= $enc->attr($this->translate('admin', 'Add')); ?>"> |
|
114 | 114 | </a> |
115 | 115 | |
116 | 116 | <?= $this->partial( |
117 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard.php' ), |
|
117 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard.php'), |
|
118 | 118 | ['fields' => $fields, 'data' => $columnList] |
119 | 119 | ); |
120 | 120 | ?> |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | <tbody> |
125 | 125 | |
126 | 126 | <?= $this->partial( |
127 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php' ), [ |
|
128 | - 'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/group/filter', [] ), |
|
127 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard.php'), [ |
|
128 | + 'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/group/filter', []), |
|
129 | 129 | 'data' => [ |
130 | 130 | 'customer.group.id' => ['op' => '=='], |
131 | 131 | 'customer.group.code' => [], |
@@ -137,38 +137,38 @@ discard block |
||
137 | 137 | ] ); |
138 | 138 | ?> |
139 | 139 | |
140 | - <?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?> |
|
141 | - <?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?> |
|
142 | - <tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>"> |
|
143 | - <?php if( in_array( 'customer.group.id', $fields ) ) : ?> |
|
144 | - <td class="group-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td> |
|
140 | + <?php foreach ($this->get('items', []) as $id => $item) : ?> |
|
141 | + <?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?> |
|
142 | + <tr class="<?= $this->site()->readonly($item->getSiteId()); ?>"> |
|
143 | + <?php if (in_array('customer.group.id', $fields)) : ?> |
|
144 | + <td class="group-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td> |
|
145 | 145 | <?php endif; ?> |
146 | - <?php if( in_array( 'customer.group.code', $fields ) ) : ?> |
|
147 | - <td class="group-code"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getCode() ); ?></a></td> |
|
146 | + <?php if (in_array('customer.group.code', $fields)) : ?> |
|
147 | + <td class="group-code"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getCode()); ?></a></td> |
|
148 | 148 | <?php endif; ?> |
149 | - <?php if( in_array( 'customer.group.label', $fields ) ) : ?> |
|
150 | - <td class="group-label"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getLabel() ); ?></a></td> |
|
149 | + <?php if (in_array('customer.group.label', $fields)) : ?> |
|
150 | + <td class="group-label"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getLabel()); ?></a></td> |
|
151 | 151 | <?php endif; ?> |
152 | - <?php if( in_array( 'customer.group.ctime', $fields ) ) : ?> |
|
153 | - <td class="group-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td> |
|
152 | + <?php if (in_array('customer.group.ctime', $fields)) : ?> |
|
153 | + <td class="group-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td> |
|
154 | 154 | <?php endif; ?> |
155 | - <?php if( in_array( 'customer.group.mtime', $fields ) ) : ?> |
|
156 | - <td class="group-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td> |
|
155 | + <?php if (in_array('customer.group.mtime', $fields)) : ?> |
|
156 | + <td class="group-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td> |
|
157 | 157 | <?php endif; ?> |
158 | - <?php if( in_array( 'customer.group.editor', $fields ) ) : ?> |
|
159 | - <td class="group-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td> |
|
158 | + <?php if (in_array('customer.group.editor', $fields)) : ?> |
|
159 | + <td class="group-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td> |
|
160 | 160 | <?php endif; ?> |
161 | 161 | |
162 | 162 | <td class="actions"> |
163 | 163 | <a class="btn act-copy fa" tabindex="1" |
164 | - href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>" |
|
165 | - title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>" |
|
166 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a> |
|
167 | - <?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?> |
|
164 | + href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>" |
|
165 | + title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>" |
|
166 | + aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a> |
|
167 | + <?php if (!$this->site()->readonly($item->getSiteId())) : ?> |
|
168 | 168 | <a class="btn act-delete fa" tabindex="1" |
169 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'group', 'id' => $id] + $params, [], $delConfig ) ); ?>" |
|
170 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
171 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
169 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'group', 'id' => $id] + $params, [], $delConfig)); ?>" |
|
170 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
171 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
172 | 172 | <?php endif; ?> |
173 | 173 | </td> |
174 | 174 | </tr> |
@@ -176,18 +176,18 @@ discard block |
||
176 | 176 | </tbody> |
177 | 177 | </table> |
178 | 178 | |
179 | - <?php if( $this->get( 'items', [] ) === [] ) : ?> |
|
180 | - <div class="noitems"><?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?></div> |
|
179 | + <?php if ($this->get('items', []) === []) : ?> |
|
180 | + <div class="noitems"><?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?></div> |
|
181 | 181 | <?php endif; ?> |
182 | 182 | </form> |
183 | 183 | |
184 | 184 | <?= $this->partial( |
185 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php' ), |
|
186 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ), |
|
187 | - 'page' => $this->session( 'aimeos/admin/jqadm/group/page', [] )] |
|
185 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard.php'), |
|
186 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'), |
|
187 | + 'page' => $this->session('aimeos/admin/jqadm/group/page', [])] |
|
188 | 188 | ); |
189 | 189 | ?> |
190 | 190 | |
191 | 191 | <?php $this->block()->stop(); ?> |
192 | 192 | |
193 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?> |
|
193 | +<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?> |
@@ -112,9 +112,12 @@ discard block |
||
112 | 112 | <?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?> |
113 | 113 | </div> |
114 | 114 | </div> |
115 | - <?php else : ?> |
|
115 | + <?php else { |
|
116 | + : ?> |
|
116 | 117 | <input class="text-langid" type="hidden" |
117 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
118 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); |
|
119 | +} |
|
120 | +?>'.replace('idx', idx)" |
|
118 | 121 | value="<?= $enc->attr( key( $languages ) ); ?>" /> |
119 | 122 | <?php endif; ?> |
120 | 123 | |
@@ -143,9 +146,12 @@ discard block |
||
143 | 146 | <?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?> |
144 | 147 | </div> |
145 | 148 | </div> |
146 | - <?php else : ?> |
|
149 | + <?php else { |
|
150 | + : ?> |
|
147 | 151 | <input class="item-typeid" type="hidden" |
148 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
152 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); |
|
153 | +} |
|
154 | +?>'.replace('idx', idx)" |
|
149 | 155 | value="<?= $enc->attr( key( $textTypes ) ); ?>" /> |
150 | 156 | <?php endif; ?> |
151 | 157 | |
@@ -198,9 +204,12 @@ discard block |
||
198 | 204 | <?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?> |
199 | 205 | </div> |
200 | 206 | </div> |
201 | - <?php else : ?> |
|
207 | + <?php else { |
|
208 | + : ?> |
|
202 | 209 | <input class="listitem-typeid" type="hidden" |
203 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'catalog.lists.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
210 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'catalog.lists.typeid' ) ) ); |
|
211 | +} |
|
212 | +?>'.replace('idx', idx)" |
|
204 | 213 | value="<?= $enc->attr( key( $listTypes ) ); ?>" |
205 | 214 | v-model="items[idx]['catalog.lists.typeid']" /> |
206 | 215 | <?php endif; ?> |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | ?> |
18 | 18 | <div id="text" class="item-text content-block tab-pane fade" role="tablist" aria-labelledby="text"> |
19 | 19 | <div id="item-text-group" role="tablist" aria-multiselectable="true" |
20 | - data-items="<?= $enc->attr( json_encode( $this->get( 'textData', [] ) ) ); ?>" |
|
21 | - data-listtypeid="<?= key( $this->get( 'textListTypes', [] ) ) ?>" |
|
22 | - data-keys="<?= $enc->attr( json_encode( $keys ) ) ?>" |
|
20 | + data-items="<?= $enc->attr(json_encode($this->get('textData', []))); ?>" |
|
21 | + data-listtypeid="<?= key($this->get('textListTypes', [])) ?>" |
|
22 | + data-keys="<?= $enc->attr(json_encode($keys)) ?>" |
|
23 | 23 | data-siteid="<?= $this->site()->siteid() ?>" > |
24 | 24 | |
25 | 25 | <div v-for="(entry, idx) in items" class="group-item card"> |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | v-bind:data-target="'#item-text-group-data-' + idx" data-toggle="collapse" role="tab" class="card-header header" |
29 | 29 | v-bind:aria-controls="'item-text-group-data-' + idx" aria-expanded="false"> |
30 | 30 | <div class="card-tools-left"> |
31 | - <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
32 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide this entry') ); ?>"> |
|
31 | + <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
32 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide this entry')); ?>"> |
|
33 | 33 | </div> |
34 | 34 | </div> |
35 | 35 | <span class="item-label header-label" v-html="getLabel(idx)"></span> |
36 | 36 | |
37 | 37 | <div class="card-tools-right"> |
38 | 38 | <div v-if="!checkSite('catalog.lists.siteid', idx)" |
39 | - class="btn btn-card-header act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
40 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
39 | + class="btn btn-card-header act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
40 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
41 | 41 | v-on:click.stop="removeItem(idx)"> |
42 | 42 | </div> |
43 | 43 | </div> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | v-bind:aria-labelledby="'item-text-group-item-' + idx" role="tabpanel" class="card-block collapse row"> |
48 | 48 | |
49 | 49 | <input type="hidden" v-model="items[idx]['text.id']" |
50 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.id' ) ) ); ?>'.replace('idx', idx)" /> |
|
50 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.id'))); ?>'.replace('idx', idx)" /> |
|
51 | 51 | |
52 | 52 | <div class="col-xl-6"> |
53 | 53 | |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | <textarea is="html-editor" class="form-control item-content" required="required" v-once |
57 | 57 | v-model="items[idx]['text.content']" |
58 | 58 | v-bind:value="items[idx]['text.content']" |
59 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.content' ) ) ); ?>'.replace('idx', idx)" |
|
59 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.content'))); ?>'.replace('idx', idx)" |
|
60 | 60 | v-bind:readonly="checkSite('text.siteid', idx)" |
61 | - v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
61 | + v-bind:tabindex="<?= $this->get('tabindex'); ?>" |
|
62 | 62 | ></textarea> |
63 | 63 | </div> |
64 | 64 | </div> |
@@ -68,101 +68,101 @@ discard block |
||
68 | 68 | <div class="col-xl-6"> |
69 | 69 | |
70 | 70 | <div class="form-group row mandatory"> |
71 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label> |
|
71 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label> |
|
72 | 72 | <div class="col-sm-8"> |
73 | - <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
74 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.status' ) ) ); ?>'.replace('idx', idx)" |
|
73 | + <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
74 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.status'))); ?>'.replace('idx', idx)" |
|
75 | 75 | v-bind:readonly="checkSite('text.siteid', idx)" |
76 | 76 | v-model="items[idx]['text.status']" > |
77 | 77 | <option value="1" v-bind:selected="entry['text.status'] == 1" > |
78 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?> |
|
78 | + <?= $enc->html($this->translate('mshop/code', 'status:1')); ?> |
|
79 | 79 | </option> |
80 | 80 | <option value="0" v-bind:selected="entry['text.status'] == 0" > |
81 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?> |
|
81 | + <?= $enc->html($this->translate('mshop/code', 'status:0')); ?> |
|
82 | 82 | </option> |
83 | 83 | <option value="-1" v-bind:selected="entry['text.status'] == -1" > |
84 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?> |
|
84 | + <?= $enc->html($this->translate('mshop/code', 'status:-1')); ?> |
|
85 | 85 | </option> |
86 | 86 | <option value="-2" v-bind:selected="entry['text.status'] == -2" > |
87 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?> |
|
87 | + <?= $enc->html($this->translate('mshop/code', 'status:-2')); ?> |
|
88 | 88 | </option> |
89 | 89 | </select> |
90 | 90 | </div> |
91 | 91 | </div> |
92 | 92 | |
93 | - <?php $languages = $this->get( 'pageLangItems', [] ); ?> |
|
94 | - <?php if( count( $languages ) > 1 ) : ?> |
|
93 | + <?php $languages = $this->get('pageLangItems', []); ?> |
|
94 | + <?php if (count($languages) > 1) : ?> |
|
95 | 95 | <div class="form-group row mandatory"> |
96 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label> |
|
96 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Language')); ?></label> |
|
97 | 97 | <div class="col-sm-8"> |
98 | - <select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
99 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
98 | + <select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
99 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)" |
|
100 | 100 | v-bind:readonly="checkSite('text.siteid', idx)" |
101 | 101 | v-model="items[idx]['text.languageid']" > |
102 | 102 | |
103 | 103 | <option value="" disable > |
104 | - <?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?> |
|
104 | + <?= $enc->attr($this->translate('admin', 'Please select')); ?> |
|
105 | 105 | </option> |
106 | 106 | |
107 | - <?php foreach( $languages as $langId => $langItem ) : ?> |
|
108 | - <option value="<?= $enc->attr( $langId ); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr( $langId ) ?>'" > |
|
109 | - <?= $enc->html( $langItem->getLabel() ); ?> |
|
107 | + <?php foreach ($languages as $langId => $langItem) : ?> |
|
108 | + <option value="<?= $enc->attr($langId); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr($langId) ?>'" > |
|
109 | + <?= $enc->html($langItem->getLabel()); ?> |
|
110 | 110 | </option> |
111 | 111 | <?php endforeach; ?> |
112 | 112 | </select> |
113 | 113 | </div> |
114 | 114 | <div class="col-sm-12 form-text text-muted help-text"> |
115 | - <?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?> |
|
115 | + <?= $enc->html($this->translate('admin', 'Language of the entered text')); ?> |
|
116 | 116 | </div> |
117 | 117 | </div> |
118 | 118 | <?php else : ?> |
119 | 119 | <input class="text-langid" type="hidden" |
120 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
121 | - value="<?= $enc->attr( key( $languages ) ); ?>" /> |
|
120 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)" |
|
121 | + value="<?= $enc->attr(key($languages)); ?>" /> |
|
122 | 122 | <?php endif; ?> |
123 | 123 | |
124 | - <?php $textTypes = $this->get( 'textTypes', [] ); ?> |
|
125 | - <?php if( count( $textTypes ) > 1 ) : ?> |
|
124 | + <?php $textTypes = $this->get('textTypes', []); ?> |
|
125 | + <?php if (count($textTypes) > 1) : ?> |
|
126 | 126 | <div class="form-group row mandatory"> |
127 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Type' ) ); ?></label> |
|
127 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Type')); ?></label> |
|
128 | 128 | <div class="col-sm-8"> |
129 | - <select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
130 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
129 | + <select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
130 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)" |
|
131 | 131 | v-bind:readonly="checkSite('text.siteid', idx)" |
132 | 132 | v-model="items[idx]['text.typeid']" > |
133 | 133 | |
134 | 134 | <option value="" disable > |
135 | - <?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?> |
|
135 | + <?= $enc->attr($this->translate('admin', 'Please select')); ?> |
|
136 | 136 | </option> |
137 | 137 | |
138 | - <?php foreach( (array) $textTypes as $typeId => $typeItem ) : ?> |
|
139 | - <option value="<?= $enc->attr( $typeId ); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr( $typeId ) ?>'" > |
|
140 | - <?= $enc->html( $typeItem->getLabel() ); ?> |
|
138 | + <?php foreach ((array) $textTypes as $typeId => $typeItem) : ?> |
|
139 | + <option value="<?= $enc->attr($typeId); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr($typeId) ?>'" > |
|
140 | + <?= $enc->html($typeItem->getLabel()); ?> |
|
141 | 141 | </option> |
142 | 142 | <?php endforeach; ?> |
143 | 143 | </select> |
144 | 144 | </div> |
145 | 145 | <div class="col-sm-12 form-text text-muted help-text"> |
146 | - <?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?> |
|
146 | + <?= $enc->html($this->translate('admin', 'Types for additional texts like per one lb/kg or per month')); ?> |
|
147 | 147 | </div> |
148 | 148 | </div> |
149 | 149 | <?php else : ?> |
150 | 150 | <input class="item-typeid" type="hidden" |
151 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
152 | - value="<?= $enc->attr( key( $textTypes ) ); ?>" /> |
|
151 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)" |
|
152 | + value="<?= $enc->attr(key($textTypes)); ?>" /> |
|
153 | 153 | <?php endif; ?> |
154 | 154 | |
155 | 155 | <div class="form-group row optional"> |
156 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Label' ) ); ?></label> |
|
156 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Label')); ?></label> |
|
157 | 157 | <div class="col-sm-8"> |
158 | - <input class="form-control item-label" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
159 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.label' ) ) ); ?>'.replace('idx', idx)" |
|
160 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Label' ) ); ?>" |
|
158 | + <input class="form-control item-label" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
159 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.label'))); ?>'.replace('idx', idx)" |
|
160 | + placeholder="<?= $enc->attr($this->translate('admin', 'Label')); ?>" |
|
161 | 161 | v-bind:readonly="checkSite('text.siteid', idx)" |
162 | 162 | v-model="items[idx]['text.label']" /> |
163 | 163 | </div> |
164 | 164 | <div class="col-sm-12 form-text text-muted help-text"> |
165 | - <?= $enc->html( $this->translate( 'admin', 'Description of the text content if it\'s in a foreign language' ) ); ?> |
|
165 | + <?= $enc->html($this->translate('admin', 'Description of the text content if it\'s in a foreign language')); ?> |
|
166 | 166 | </div> |
167 | 167 | </div> |
168 | 168 | |
@@ -171,70 +171,70 @@ discard block |
||
171 | 171 | |
172 | 172 | <div v-on:click="toggle(idx)" class="col-xl-12 advanced" v-bind:class="{ 'collapsed': !advanced[idx] }"> |
173 | 173 | <div class="card-tools-left"> |
174 | - <div class="btn act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
175 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide advanced data') ); ?>"> |
|
174 | + <div class="btn act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
175 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide advanced data')); ?>"> |
|
176 | 176 | </div> |
177 | 177 | </div> |
178 | - <span class="header-label"><?= $enc->html( $this->translate( 'admin', 'Advanced' ) ); ?></span> |
|
178 | + <span class="header-label"><?= $enc->html($this->translate('admin', 'Advanced')); ?></span> |
|
179 | 179 | </div> |
180 | 180 | |
181 | 181 | <div v-show="advanced[idx]" class="col-xl-6 content-block secondary"> |
182 | 182 | |
183 | 183 | <input type="hidden" v-model="items[idx]['catalog.lists.type']" |
184 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'catalog.lists.type' ) ) ); ?>'.replace( 'idx', idx )" /> |
|
184 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'catalog.lists.type'))); ?>'.replace( 'idx', idx )" /> |
|
185 | 185 | |
186 | - <?php $listTypes = $this->get( 'textListTypes', [] ); ?> |
|
187 | - <?php if( count( $listTypes ) > 1 ) : ?> |
|
186 | + <?php $listTypes = $this->get('textListTypes', []); ?> |
|
187 | + <?php if (count($listTypes) > 1) : ?> |
|
188 | 188 | <div class="form-group row mandatory"> |
189 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'List type' ) ); ?></label> |
|
189 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'List type')); ?></label> |
|
190 | 190 | <div class="col-sm-8"> |
191 | - <select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
192 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'catalog.lists.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
191 | + <select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
192 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'catalog.lists.typeid'))); ?>'.replace('idx', idx)" |
|
193 | 193 | v-bind:readonly="checkSite('catalog.lists.siteid', idx)" |
194 | 194 | v-model="items[idx]['catalog.lists.typeid']" > |
195 | 195 | |
196 | - <?php foreach( $this->get( 'textListTypes', [] ) as $id => $typeItem ) : ?> |
|
197 | - <option value="<?= $enc->attr( $id ); ?>" v-bind:selected="entry['catalog.lists.typeid'] == '<?= $enc->attr( $id ) ?>'" > |
|
198 | - <?= $enc->html( $typeItem->getLabel() ); ?> |
|
196 | + <?php foreach ($this->get('textListTypes', []) as $id => $typeItem) : ?> |
|
197 | + <option value="<?= $enc->attr($id); ?>" v-bind:selected="entry['catalog.lists.typeid'] == '<?= $enc->attr($id) ?>'" > |
|
198 | + <?= $enc->html($typeItem->getLabel()); ?> |
|
199 | 199 | </option> |
200 | 200 | <?php endforeach; ?> |
201 | 201 | </select> |
202 | 202 | </div> |
203 | 203 | <div class="col-sm-12 form-text text-muted help-text"> |
204 | - <?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?> |
|
204 | + <?= $enc->html($this->translate('admin', 'Second level type for grouping items')); ?> |
|
205 | 205 | </div> |
206 | 206 | </div> |
207 | 207 | <?php else : ?> |
208 | 208 | <input class="listitem-typeid" type="hidden" |
209 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'catalog.lists.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
210 | - value="<?= $enc->attr( key( $listTypes ) ); ?>" |
|
209 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'catalog.lists.typeid'))); ?>'.replace('idx', idx)" |
|
210 | + value="<?= $enc->attr(key($listTypes)); ?>" |
|
211 | 211 | v-model="items[idx]['catalog.lists.typeid']" /> |
212 | 212 | <?php endif; ?> |
213 | 213 | |
214 | 214 | <div class="form-group row optional"> |
215 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Start date' ) ); ?></label> |
|
215 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Start date')); ?></label> |
|
216 | 216 | <div class="col-sm-8"> |
217 | - <input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
218 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'catalog.lists.datestart' ) ) ); ?>'.replace('idx', idx)" |
|
219 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>" |
|
217 | + <input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
218 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'catalog.lists.datestart'))); ?>'.replace('idx', idx)" |
|
219 | + placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>" |
|
220 | 220 | v-bind:readonly="checkSite('catalog.lists.siteid', idx)" |
221 | 221 | v-model="items[idx]['catalog.lists.datestart']" /> |
222 | 222 | </div> |
223 | 223 | <div class="col-sm-12 form-text text-muted help-text"> |
224 | - <?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site after that date and time' ) ); ?> |
|
224 | + <?= $enc->html($this->translate('admin', 'The item is only shown on the web site after that date and time')); ?> |
|
225 | 225 | </div> |
226 | 226 | </div> |
227 | 227 | <div class="form-group row optional"> |
228 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'End date' ) ); ?></label> |
|
228 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'End date')); ?></label> |
|
229 | 229 | <div class="col-sm-8"> |
230 | - <input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
231 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'catalog.lists.dateend' ) ) ); ?>'.replace('idx', idx)" |
|
232 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>" |
|
230 | + <input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
231 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'catalog.lists.dateend'))); ?>'.replace('idx', idx)" |
|
232 | + placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>" |
|
233 | 233 | v-bind:readonly="checkSite('catalog.lists.siteid', idx)" |
234 | 234 | v-model="items[idx]['catalog.lists.dateend']" /> |
235 | 235 | </div> |
236 | 236 | <div class="col-sm-12 form-text text-muted help-text"> |
237 | - <?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site until that date and time' ) ); ?> |
|
237 | + <?= $enc->html($this->translate('admin', 'The item is only shown on the web site until that date and time')); ?> |
|
238 | 238 | </div> |
239 | 239 | </div> |
240 | 240 | </div> |
@@ -244,17 +244,17 @@ discard block |
||
244 | 244 | <thead> |
245 | 245 | <tr> |
246 | 246 | <th> |
247 | - <span class="help"><?= $enc->html( $this->translate( 'admin', 'Option' ) ); ?></span> |
|
247 | + <span class="help"><?= $enc->html($this->translate('admin', 'Option')); ?></span> |
|
248 | 248 | <div class="form-text text-muted help-text"> |
249 | - <?= $enc->html( $this->translate( 'admin', 'Configuration options, will be available as key/value pairs in the list item' ) ); ?> |
|
249 | + <?= $enc->html($this->translate('admin', 'Configuration options, will be available as key/value pairs in the list item')); ?> |
|
250 | 250 | </div> |
251 | 251 | </th> |
252 | 252 | <th> |
253 | - <?= $enc->html( $this->translate( 'admin', 'Value' ) ); ?> |
|
253 | + <?= $enc->html($this->translate('admin', 'Value')); ?> |
|
254 | 254 | </th> |
255 | 255 | <th class="actions"> |
256 | - <div class="btn act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
257 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
256 | + <div class="btn act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
257 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
258 | 258 | v-bind:readonly="checkSite('catalog.lists.siteid', idx)" |
259 | 259 | v-on:click="addConfig(idx)" > |
260 | 260 | </div> |
@@ -267,21 +267,21 @@ discard block |
||
267 | 267 | <td> |
268 | 268 | <input is="auto-complete" |
269 | 269 | v-model="items[idx]['config']['key'][pos]" |
270 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'key', '' ) ) ); ?>'.replace('idx', idx)" |
|
270 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'key', ''))); ?>'.replace('idx', idx)" |
|
271 | 271 | v-bind:readonly="checkSite('catalog.lists.siteid', idx)" |
272 | - v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
272 | + v-bind:tabindex="<?= $this->get('tabindex'); ?>" |
|
273 | 273 | v-bind:keys="[]" /> |
274 | 274 | </td> |
275 | 275 | <td> |
276 | - <input type="text" class="form-control" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
277 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'val', '' ) ) ); ?>'.replace('idx', idx)" |
|
276 | + <input type="text" class="form-control" tabindex="<?= $this->get('tabindex'); ?>" |
|
277 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'val', ''))); ?>'.replace('idx', idx)" |
|
278 | 278 | v-bind:readonly="checkSite('catalog.lists.siteid', idx)" |
279 | 279 | v-model="items[idx]['config']['val'][pos]" /> |
280 | 280 | </td> |
281 | 281 | <td class="actions"> |
282 | 282 | <div v-if="!checkSite('catalog.lists.siteid', idx)" v-on:click="removeConfig(idx, pos)" |
283 | - class="btn act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
284 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>"> |
|
283 | + class="btn act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
284 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>"> |
|
285 | 285 | </div> |
286 | 286 | </td> |
287 | 287 | </tr> |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | </table> |
291 | 291 | </div> |
292 | 292 | |
293 | - <?= $this->get( 'textBody' ); ?> |
|
293 | + <?= $this->get('textBody'); ?> |
|
294 | 294 | |
295 | 295 | </div> |
296 | 296 | </div> |
297 | 297 | |
298 | 298 | <div class="card-tools-more"> |
299 | - <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
300 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
299 | + <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
300 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
301 | 301 | v-on:click="addItem('catalog.lists.')" > |
302 | 302 | </div> |
303 | 303 | </div> |
@@ -112,9 +112,12 @@ discard block |
||
112 | 112 | <?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?> |
113 | 113 | </div> |
114 | 114 | </div> |
115 | - <?php else : ?> |
|
115 | + <?php else { |
|
116 | + : ?> |
|
116 | 117 | <input class="text-langid" type="hidden" |
117 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
118 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); |
|
119 | +} |
|
120 | +?>'.replace('idx', idx)" |
|
118 | 121 | value="<?= $enc->attr( key( $languages ) ); ?>" /> |
119 | 122 | <?php endif; ?> |
120 | 123 | |
@@ -143,9 +146,12 @@ discard block |
||
143 | 146 | <?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?> |
144 | 147 | </div> |
145 | 148 | </div> |
146 | - <?php else : ?> |
|
149 | + <?php else { |
|
150 | + : ?> |
|
147 | 151 | <input class="item-typeid" type="hidden" |
148 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
152 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); |
|
153 | +} |
|
154 | +?>'.replace('idx', idx)" |
|
149 | 155 | value="<?= $enc->attr( key( $textTypes ) ); ?>" /> |
150 | 156 | <?php endif; ?> |
151 | 157 | |
@@ -198,9 +204,12 @@ discard block |
||
198 | 204 | <?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?> |
199 | 205 | </div> |
200 | 206 | </div> |
201 | - <?php else : ?> |
|
207 | + <?php else { |
|
208 | + : ?> |
|
202 | 209 | <input class="listitem-typeid" type="hidden" |
203 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'supplier.lists.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
210 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'supplier.lists.typeid' ) ) ); |
|
211 | +} |
|
212 | +?>'.replace('idx', idx)" |
|
204 | 213 | value="<?= $enc->attr( key( $listTypes ) ); ?>" |
205 | 214 | v-model="items[idx]['supplier.lists.typeid']" /> |
206 | 215 | <?php endif; ?> |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | ?> |
18 | 18 | <div id="text" class="item-text content-block tab-pane fade" role="tablist" aria-labelledby="text"> |
19 | 19 | <div id="item-text-group" role="tablist" aria-multiselectable="true" |
20 | - data-items="<?= $enc->attr( json_encode( $this->get( 'textData', [] ) ) ); ?>" |
|
21 | - data-listtypeid="<?= key( $this->get( 'textListTypes', [] ) ) ?>" |
|
22 | - data-keys="<?= $enc->attr( json_encode( $keys ) ) ?>" |
|
20 | + data-items="<?= $enc->attr(json_encode($this->get('textData', []))); ?>" |
|
21 | + data-listtypeid="<?= key($this->get('textListTypes', [])) ?>" |
|
22 | + data-keys="<?= $enc->attr(json_encode($keys)) ?>" |
|
23 | 23 | data-siteid="<?= $this->site()->siteid() ?>" > |
24 | 24 | |
25 | 25 | <div v-for="(entry, idx) in items" class="group-item card"> |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | v-bind:data-target="'#item-text-group-data-' + idx" data-toggle="collapse" role="tab" class="card-header header" |
29 | 29 | v-bind:aria-controls="'item-text-group-data-' + idx" aria-expanded="false"> |
30 | 30 | <div class="card-tools-left"> |
31 | - <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
32 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide this entry') ); ?>"> |
|
31 | + <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
32 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide this entry')); ?>"> |
|
33 | 33 | </div> |
34 | 34 | </div> |
35 | 35 | <span class="item-label header-label" v-html="getLabel(idx)"></span> |
36 | 36 | |
37 | 37 | <div class="card-tools-right"> |
38 | 38 | <div v-if="!checkSite('supplier.lists.siteid', idx)" |
39 | - class="btn btn-card-header act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
40 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
39 | + class="btn btn-card-header act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
40 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
41 | 41 | v-on:click.stop="removeItem(idx)"> |
42 | 42 | </div> |
43 | 43 | </div> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | v-bind:aria-labelledby="'item-text-group-item-' + idx" role="tabpanel" class="card-block collapse row"> |
48 | 48 | |
49 | 49 | <input type="hidden" v-model="items[idx]['text.id']" |
50 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.id' ) ) ); ?>'.replace('idx', idx)" /> |
|
50 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.id'))); ?>'.replace('idx', idx)" /> |
|
51 | 51 | |
52 | 52 | <div class="col-xl-6"> |
53 | 53 | |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | <textarea is="html-editor" class="form-control item-content" required="required" v-once |
57 | 57 | v-model="items[idx]['text.content']" |
58 | 58 | v-bind:value="items[idx]['text.content']" |
59 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.content' ) ) ); ?>'.replace('idx', idx)" |
|
59 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.content'))); ?>'.replace('idx', idx)" |
|
60 | 60 | v-bind:readonly="checkSite('text.siteid', idx)" |
61 | - v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
61 | + v-bind:tabindex="<?= $this->get('tabindex'); ?>" |
|
62 | 62 | ></textarea> |
63 | 63 | </div> |
64 | 64 | </div> |
@@ -68,101 +68,101 @@ discard block |
||
68 | 68 | <div class="col-xl-6"> |
69 | 69 | |
70 | 70 | <div class="form-group row mandatory"> |
71 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label> |
|
71 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label> |
|
72 | 72 | <div class="col-sm-8"> |
73 | - <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
74 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.status' ) ) ); ?>'.replace('idx', idx)" |
|
73 | + <select class="form-control custom-select item-status" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
74 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.status'))); ?>'.replace('idx', idx)" |
|
75 | 75 | v-bind:readonly="checkSite('text.siteid', idx)" |
76 | 76 | v-model="items[idx]['text.status']" > |
77 | 77 | <option value="1" v-bind:selected="entry['text.status'] == 1" > |
78 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?> |
|
78 | + <?= $enc->html($this->translate('mshop/code', 'status:1')); ?> |
|
79 | 79 | </option> |
80 | 80 | <option value="0" v-bind:selected="entry['text.status'] == 0" > |
81 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?> |
|
81 | + <?= $enc->html($this->translate('mshop/code', 'status:0')); ?> |
|
82 | 82 | </option> |
83 | 83 | <option value="-1" v-bind:selected="entry['text.status'] == -1" > |
84 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?> |
|
84 | + <?= $enc->html($this->translate('mshop/code', 'status:-1')); ?> |
|
85 | 85 | </option> |
86 | 86 | <option value="-2" v-bind:selected="entry['text.status'] == -2" > |
87 | - <?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?> |
|
87 | + <?= $enc->html($this->translate('mshop/code', 'status:-2')); ?> |
|
88 | 88 | </option> |
89 | 89 | </select> |
90 | 90 | </div> |
91 | 91 | </div> |
92 | 92 | |
93 | - <?php $languages = $this->get( 'pageLangItems', [] ); ?> |
|
94 | - <?php if( count( $languages ) > 1 ) : ?> |
|
93 | + <?php $languages = $this->get('pageLangItems', []); ?> |
|
94 | + <?php if (count($languages) > 1) : ?> |
|
95 | 95 | <div class="form-group row mandatory"> |
96 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label> |
|
96 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Language')); ?></label> |
|
97 | 97 | <div class="col-sm-8"> |
98 | - <select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
99 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
98 | + <select class="form-control custom-select item-languageid" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
99 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)" |
|
100 | 100 | v-bind:readonly="checkSite('text.siteid', idx)" |
101 | 101 | v-model="items[idx]['text.languageid']" > |
102 | 102 | |
103 | 103 | <option value="" disable > |
104 | - <?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?> |
|
104 | + <?= $enc->attr($this->translate('admin', 'Please select')); ?> |
|
105 | 105 | </option> |
106 | 106 | |
107 | - <?php foreach( $languages as $langId => $langItem ) : ?> |
|
108 | - <option value="<?= $enc->attr( $langId ); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr( $langId ) ?>'" > |
|
109 | - <?= $enc->html( $langItem->getLabel() ); ?> |
|
107 | + <?php foreach ($languages as $langId => $langItem) : ?> |
|
108 | + <option value="<?= $enc->attr($langId); ?>" v-bind:selected="entry['text.languageid'] == '<?= $enc->attr($langId) ?>'" > |
|
109 | + <?= $enc->html($langItem->getLabel()); ?> |
|
110 | 110 | </option> |
111 | 111 | <?php endforeach; ?> |
112 | 112 | </select> |
113 | 113 | </div> |
114 | 114 | <div class="col-sm-12 form-text text-muted help-text"> |
115 | - <?= $enc->html( $this->translate( 'admin', 'Language of the entered text' ) ); ?> |
|
115 | + <?= $enc->html($this->translate('admin', 'Language of the entered text')); ?> |
|
116 | 116 | </div> |
117 | 117 | </div> |
118 | 118 | <?php else : ?> |
119 | 119 | <input class="text-langid" type="hidden" |
120 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
121 | - value="<?= $enc->attr( key( $languages ) ); ?>" /> |
|
120 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.languageid'))); ?>'.replace('idx', idx)" |
|
121 | + value="<?= $enc->attr(key($languages)); ?>" /> |
|
122 | 122 | <?php endif; ?> |
123 | 123 | |
124 | - <?php $textTypes = $this->get( 'textTypes', [] ); ?> |
|
125 | - <?php if( count( $textTypes ) > 1 ) : ?> |
|
124 | + <?php $textTypes = $this->get('textTypes', []); ?> |
|
125 | + <?php if (count($textTypes) > 1) : ?> |
|
126 | 126 | <div class="form-group row mandatory"> |
127 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Type' ) ); ?></label> |
|
127 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Type')); ?></label> |
|
128 | 128 | <div class="col-sm-8"> |
129 | - <select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
130 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
129 | + <select class="form-control custom-select item-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
130 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)" |
|
131 | 131 | v-bind:readonly="checkSite('text.siteid', idx)" |
132 | 132 | v-model="items[idx]['text.typeid']" > |
133 | 133 | |
134 | 134 | <option value="" disable > |
135 | - <?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?> |
|
135 | + <?= $enc->attr($this->translate('admin', 'Please select')); ?> |
|
136 | 136 | </option> |
137 | 137 | |
138 | - <?php foreach( (array) $textTypes as $typeId => $typeItem ) : ?> |
|
139 | - <option value="<?= $enc->attr( $typeId ); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr( $typeId ) ?>'" > |
|
140 | - <?= $enc->html( $typeItem->getLabel() ); ?> |
|
138 | + <?php foreach ((array) $textTypes as $typeId => $typeItem) : ?> |
|
139 | + <option value="<?= $enc->attr($typeId); ?>" v-bind:selected="entry['text.typeid'] == '<?= $enc->attr($typeId) ?>'" > |
|
140 | + <?= $enc->html($typeItem->getLabel()); ?> |
|
141 | 141 | </option> |
142 | 142 | <?php endforeach; ?> |
143 | 143 | </select> |
144 | 144 | </div> |
145 | 145 | <div class="col-sm-12 form-text text-muted help-text"> |
146 | - <?= $enc->html( $this->translate( 'admin', 'Types for additional texts like per one lb/kg or per month' ) ); ?> |
|
146 | + <?= $enc->html($this->translate('admin', 'Types for additional texts like per one lb/kg or per month')); ?> |
|
147 | 147 | </div> |
148 | 148 | </div> |
149 | 149 | <?php else : ?> |
150 | 150 | <input class="item-typeid" type="hidden" |
151 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
152 | - value="<?= $enc->attr( key( $textTypes ) ); ?>" /> |
|
151 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.typeid'))); ?>'.replace('idx', idx)" |
|
152 | + value="<?= $enc->attr(key($textTypes)); ?>" /> |
|
153 | 153 | <?php endif; ?> |
154 | 154 | |
155 | 155 | <div class="form-group row optional"> |
156 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Label' ) ); ?></label> |
|
156 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Label')); ?></label> |
|
157 | 157 | <div class="col-sm-8"> |
158 | - <input class="form-control item-label" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
159 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'text.label' ) ) ); ?>'.replace('idx', idx)" |
|
160 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Label' ) ); ?>" |
|
158 | + <input class="form-control item-label" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
159 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'text.label'))); ?>'.replace('idx', idx)" |
|
160 | + placeholder="<?= $enc->attr($this->translate('admin', 'Label')); ?>" |
|
161 | 161 | v-bind:readonly="checkSite('text.siteid', idx)" |
162 | 162 | v-model="items[idx]['text.label']" /> |
163 | 163 | </div> |
164 | 164 | <div class="col-sm-12 form-text text-muted help-text"> |
165 | - <?= $enc->html( $this->translate( 'admin', 'Description of the text content if it\'s in a foreign language' ) ); ?> |
|
165 | + <?= $enc->html($this->translate('admin', 'Description of the text content if it\'s in a foreign language')); ?> |
|
166 | 166 | </div> |
167 | 167 | </div> |
168 | 168 | |
@@ -171,70 +171,70 @@ discard block |
||
171 | 171 | |
172 | 172 | <div v-on:click="toggle(idx)" class="col-xl-12 advanced" v-bind:class="{ 'collapsed': !advanced[idx] }"> |
173 | 173 | <div class="card-tools-left"> |
174 | - <div class="btn act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
175 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide advanced data') ); ?>"> |
|
174 | + <div class="btn act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
175 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide advanced data')); ?>"> |
|
176 | 176 | </div> |
177 | 177 | </div> |
178 | - <span class="header-label"><?= $enc->html( $this->translate( 'admin', 'Advanced' ) ); ?></span> |
|
178 | + <span class="header-label"><?= $enc->html($this->translate('admin', 'Advanced')); ?></span> |
|
179 | 179 | </div> |
180 | 180 | |
181 | 181 | <div v-show="advanced[idx]" class="col-xl-6 content-block secondary"> |
182 | 182 | |
183 | 183 | <input type="hidden" v-model="items[idx]['supplier.lists.type']" |
184 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'supplier.lists.type' ) ) ); ?>'.replace( 'idx', idx )" /> |
|
184 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'supplier.lists.type'))); ?>'.replace( 'idx', idx )" /> |
|
185 | 185 | |
186 | - <?php $listTypes = $this->get( 'textListTypes', [] ); ?> |
|
187 | - <?php if( count( $listTypes ) > 1 ) : ?> |
|
186 | + <?php $listTypes = $this->get('textListTypes', []); ?> |
|
187 | + <?php if (count($listTypes) > 1) : ?> |
|
188 | 188 | <div class="form-group row mandatory"> |
189 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'List type' ) ); ?></label> |
|
189 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'List type')); ?></label> |
|
190 | 190 | <div class="col-sm-8"> |
191 | - <select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
192 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'supplier.lists.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
191 | + <select class="form-control custom-select listitem-typeid" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
192 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'supplier.lists.typeid'))); ?>'.replace('idx', idx)" |
|
193 | 193 | v-bind:readonly="checkSite('supplier.lists.siteid', idx)" |
194 | 194 | v-model="items[idx]['supplier.lists.typeid']" > |
195 | 195 | |
196 | - <?php foreach( $this->get( 'textListTypes', [] ) as $id => $typeItem ) : ?> |
|
197 | - <option value="<?= $enc->attr( $id ); ?>" v-bind:selected="entry['supplier.lists.typeid'] == '<?= $enc->attr( $id ) ?>'" > |
|
198 | - <?= $enc->html( $typeItem->getLabel() ); ?> |
|
196 | + <?php foreach ($this->get('textListTypes', []) as $id => $typeItem) : ?> |
|
197 | + <option value="<?= $enc->attr($id); ?>" v-bind:selected="entry['supplier.lists.typeid'] == '<?= $enc->attr($id) ?>'" > |
|
198 | + <?= $enc->html($typeItem->getLabel()); ?> |
|
199 | 199 | </option> |
200 | 200 | <?php endforeach; ?> |
201 | 201 | </select> |
202 | 202 | </div> |
203 | 203 | <div class="col-sm-12 form-text text-muted help-text"> |
204 | - <?= $enc->html( $this->translate( 'admin', 'Second level type for grouping items' ) ); ?> |
|
204 | + <?= $enc->html($this->translate('admin', 'Second level type for grouping items')); ?> |
|
205 | 205 | </div> |
206 | 206 | </div> |
207 | 207 | <?php else : ?> |
208 | 208 | <input class="listitem-typeid" type="hidden" |
209 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'supplier.lists.typeid' ) ) ); ?>'.replace('idx', idx)" |
|
210 | - value="<?= $enc->attr( key( $listTypes ) ); ?>" |
|
209 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'supplier.lists.typeid'))); ?>'.replace('idx', idx)" |
|
210 | + value="<?= $enc->attr(key($listTypes)); ?>" |
|
211 | 211 | v-model="items[idx]['supplier.lists.typeid']" /> |
212 | 212 | <?php endif; ?> |
213 | 213 | |
214 | 214 | <div class="form-group row optional"> |
215 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Start date' ) ); ?></label> |
|
215 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Start date')); ?></label> |
|
216 | 216 | <div class="col-sm-8"> |
217 | - <input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
218 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'supplier.lists.datestart' ) ) ); ?>'.replace('idx', idx)" |
|
219 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>" |
|
217 | + <input class="form-control listitem-datestart" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
218 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'supplier.lists.datestart'))); ?>'.replace('idx', idx)" |
|
219 | + placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>" |
|
220 | 220 | v-bind:readonly="checkSite('supplier.lists.siteid', idx)" |
221 | 221 | v-model="items[idx]['supplier.lists.datestart']" /> |
222 | 222 | </div> |
223 | 223 | <div class="col-sm-12 form-text text-muted help-text"> |
224 | - <?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site after that date and time' ) ); ?> |
|
224 | + <?= $enc->html($this->translate('admin', 'The item is only shown on the web site after that date and time')); ?> |
|
225 | 225 | </div> |
226 | 226 | </div> |
227 | 227 | <div class="form-group row optional"> |
228 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'End date' ) ); ?></label> |
|
228 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'End date')); ?></label> |
|
229 | 229 | <div class="col-sm-8"> |
230 | - <input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
231 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'supplier.lists.dateend' ) ) ); ?>'.replace('idx', idx)" |
|
232 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'YYYY-MM-DD hh:mm:ss (optional)' ) ); ?>" |
|
230 | + <input class="form-control listitem-dateend" type="datetime-local" tabindex="<?= $this->get('tabindex'); ?>" |
|
231 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'supplier.lists.dateend'))); ?>'.replace('idx', idx)" |
|
232 | + placeholder="<?= $enc->attr($this->translate('admin', 'YYYY-MM-DD hh:mm:ss (optional)')); ?>" |
|
233 | 233 | v-bind:readonly="checkSite('supplier.lists.siteid', idx)" |
234 | 234 | v-model="items[idx]['supplier.lists.dateend']" /> |
235 | 235 | </div> |
236 | 236 | <div class="col-sm-12 form-text text-muted help-text"> |
237 | - <?= $enc->html( $this->translate( 'admin', 'The item is only shown on the web site until that date and time' ) ); ?> |
|
237 | + <?= $enc->html($this->translate('admin', 'The item is only shown on the web site until that date and time')); ?> |
|
238 | 238 | </div> |
239 | 239 | </div> |
240 | 240 | </div> |
@@ -244,17 +244,17 @@ discard block |
||
244 | 244 | <thead> |
245 | 245 | <tr> |
246 | 246 | <th> |
247 | - <span class="help"><?= $enc->html( $this->translate( 'admin', 'Option' ) ); ?></span> |
|
247 | + <span class="help"><?= $enc->html($this->translate('admin', 'Option')); ?></span> |
|
248 | 248 | <div class="form-text text-muted help-text"> |
249 | - <?= $enc->html( $this->translate( 'admin', 'Configuration options, will be available as key/value pairs in the list item' ) ); ?> |
|
249 | + <?= $enc->html($this->translate('admin', 'Configuration options, will be available as key/value pairs in the list item')); ?> |
|
250 | 250 | </div> |
251 | 251 | </th> |
252 | 252 | <th> |
253 | - <?= $enc->html( $this->translate( 'admin', 'Value' ) ); ?> |
|
253 | + <?= $enc->html($this->translate('admin', 'Value')); ?> |
|
254 | 254 | </th> |
255 | 255 | <th class="actions"> |
256 | - <div class="btn act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
257 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
256 | + <div class="btn act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
257 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
258 | 258 | v-bind:readonly="checkSite('supplier.lists.siteid', idx)" |
259 | 259 | v-on:click="addConfig(idx)" > |
260 | 260 | </div> |
@@ -267,21 +267,21 @@ discard block |
||
267 | 267 | <td> |
268 | 268 | <input is="auto-complete" |
269 | 269 | v-model="items[idx]['config']['key'][pos]" |
270 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'key', '' ) ) ); ?>'.replace('idx', idx)" |
|
270 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'key', ''))); ?>'.replace('idx', idx)" |
|
271 | 271 | v-bind:readonly="checkSite('supplier.lists.siteid', idx)" |
272 | - v-bind:tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
272 | + v-bind:tabindex="<?= $this->get('tabindex'); ?>" |
|
273 | 273 | v-bind:keys="[]" /> |
274 | 274 | </td> |
275 | 275 | <td> |
276 | - <input type="text" class="form-control" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
277 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'text', 'idx', 'config', 'val', '' ) ) ); ?>'.replace('idx', idx)" |
|
276 | + <input type="text" class="form-control" tabindex="<?= $this->get('tabindex'); ?>" |
|
277 | + v-bind:name="'<?= $enc->attr($this->formparam(array('text', 'idx', 'config', 'val', ''))); ?>'.replace('idx', idx)" |
|
278 | 278 | v-bind:readonly="checkSite('supplier.lists.siteid', idx)" |
279 | 279 | v-model="items[idx]['config']['val'][pos]" /> |
280 | 280 | </td> |
281 | 281 | <td class="actions"> |
282 | 282 | <div v-if="!checkSite('supplier.lists.siteid', idx)" v-on:click="removeConfig(idx, pos)" |
283 | - class="btn act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
284 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>"> |
|
283 | + class="btn act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
284 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>"> |
|
285 | 285 | </div> |
286 | 286 | </td> |
287 | 287 | </tr> |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | </table> |
291 | 291 | </div> |
292 | 292 | |
293 | - <?= $this->get( 'textBody' ); ?> |
|
293 | + <?= $this->get('textBody'); ?> |
|
294 | 294 | |
295 | 295 | </div> |
296 | 296 | </div> |
297 | 297 | |
298 | 298 | <div class="card-tools-more"> |
299 | - <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
300 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
299 | + <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
300 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
301 | 301 | v-on:click="addItem('supplier.lists.')" > |
302 | 302 | </div> |
303 | 303 | </div> |