Completed
Push — master ( 50ab65...b5b491 )
by Alexey
06:01
created
system/modules/Widgets/appAdminControllers/content/widgetChooser.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
 <select class ='form-control' id = 'widgetChooser' onchange="selectChange(this);">
30 30
   <option value = ''>Выберите виджет</option>
31 31
   <?php
32
-  foreach ($widgets as $code => $options) {
33
-      $name = is_string($options) ? $options : $options['name'];
34
-      echo "<option value = '{$code}' data-filename='{$code}'>{$name}</option>";
35
-  }
36
-  ?>
32
+    foreach ($widgets as $code => $options) {
33
+        $name = is_string($options) ? $options : $options['name'];
34
+        echo "<option value = '{$code}' data-filename='{$code}'>{$name}</option>";
35
+    }
36
+    ?>
37 37
 </select>
38 38
 <?php
39 39
 foreach ($widgets as $code => $options) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 </select>
38 38
 <?php
39 39
 foreach ($widgets as $code => $options) {
40
-    echo "<div id = 'params_" . str_replace('\\', '-', $code) . "' class = 'widgetParams' style='display:none;'>";
40
+    echo "<div id = 'params_".str_replace('\\', '-', $code)."' class = 'widgetParams' style='display:none;'>";
41 41
     if (isset($options['params']) && !is_array($options['params'])) {
42 42
         $options['params']();
43 43
     } elseif (isset($options['params'])) {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 if ($param['type'] == 'select') {
49 49
                     echo "<div class = 'form-group'>
50 50
                         <label>{$param['name']}</label>
51
-                        <select name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control' >";
51
+                        <select name = 'params[".str_replace('\\', '-', $code)."][]' class = 'form-control' >";
52 52
                     foreach ($param['model']::get_list() as $item) {
53 53
                         echo "<option value = '{$item->pk()}'>{$item->$param['showCol']}</option>";
54 54
                     }
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
                 } elseif ($param['type'] == 'textarea') {
58 58
                     echo "<div class = 'form-group'>
59 59
                         <label>{$param['name']}</label>
60
-                        <textarea name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control'></textarea>
60
+                        <textarea name = 'params[".str_replace('\\', '-', $code)."][]' class = 'form-control'></textarea>
61 61
                         </div>";
62 62
                 } else {
63 63
                     echo "<div class = 'form-group'>
64 64
                         <label>{$param['name']}</label>
65
-                        <input name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control' />
65
+                        <input name = 'params[".str_replace('\\', '-', $code)."][]' class = 'form-control' />
66 66
                         </div>";
67 67
                 }
68 68
             }
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/Template/chooseFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 <hr/>
4 4
 <?php
5 5
 foreach ($template->config['css'] as $file) {
6
-    if (file_exists($template->path . '/css/' . $file)) {
6
+    if (file_exists($template->path.'/css/'.$file)) {
7 7
         ?>
8
-        <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= 'css/' . $file; ?>'><?= $file; ?></a>
8
+        <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= 'css/'.$file; ?>'><?= $file; ?></a>
9 9
         <?php
10 10
     }
11 11
 }
Please login to merge, or discard this patch.
system/modules/Ecommerce/Ecommerce.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $name = '';
53 53
         foreach ($fields as $field) {
54 54
             if ($field->save && !empty($data[$field->id])) {
55
-                $name .= htmlspecialchars($data[$field->id]) . ' ';
55
+                $name .= htmlspecialchars($data[$field->id]).' ';
56 56
             }
57 57
         }
58 58
         $name = trim($name);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         $name = '';
110 110
         foreach ($fields as $field) {
111 111
             if ($field->save && !empty($data[$field->id])) {
112
-                $name .= htmlspecialchars($data[$field->id]) . ' ';
112
+                $name .= htmlspecialchars($data[$field->id]).' ';
113 113
             }
114 114
         }
115 115
         $name = trim($name);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             foreach ($options['sort'] as $col => $direction) {
197 197
                 switch ($col) {
198 198
                     case 'price':
199
-                        $selectOptions['order'][] = [Ecommerce\Item\Offer\Price::colPrefix() . 'price', strtolower($direction) == 'desc' ? 'desc' : 'asc'];
199
+                        $selectOptions['order'][] = [Ecommerce\Item\Offer\Price::colPrefix().'price', strtolower($direction) == 'desc' ? 'desc' : 'asc'];
200 200
                         break;
201 201
                     case 'name':
202 202
                         $selectOptions['order'][] = ['name', strtolower($direction) == 'desc' ? 'desc' : 'asc'];
@@ -215,22 +215,22 @@  discard block
 block discarded – undo
215 215
             $selectOptions['where'][] = ['image_file_id', 0, '!='];
216 216
         }
217 217
 
218
-        $selectOptions['join'][] = [Ecommerce\Item\Offer::table(), Ecommerce\Item::index() . ' = ' . Ecommerce\Item\Offer::colPrefix() . Ecommerce\Item::index(), 'inner'];
218
+        $selectOptions['join'][] = [Ecommerce\Item\Offer::table(), Ecommerce\Item::index().' = '.Ecommerce\Item\Offer::colPrefix().Ecommerce\Item::index(), 'inner'];
219 219
 
220 220
         $selectOptions['join'][] = [Ecommerce\Item\Offer\Price::table(),
221
-            Ecommerce\Item\Offer::index() . ' = ' . Ecommerce\Item\Offer\Price::colPrefix() . Ecommerce\Item\Offer::index() .
222
-            (empty($this->config['show_zero_price']) ? ' and ' . Ecommerce\Item\Offer\Price::colPrefix() . 'price>0' : ''),
221
+            Ecommerce\Item\Offer::index().' = '.Ecommerce\Item\Offer\Price::colPrefix().Ecommerce\Item\Offer::index().
222
+            (empty($this->config['show_zero_price']) ? ' and '.Ecommerce\Item\Offer\Price::colPrefix().'price>0' : ''),
223 223
             empty($this->config['show_without_price']) ? 'inner' : 'left'];
224 224
 
225 225
         $selectOptions['join'][] = [
226
-            Ecommerce\Item\Offer\Price\Type::table(), Ecommerce\Item\Offer\Price::colPrefix() . Ecommerce\Item\Offer\Price\Type::index() . ' = ' . Ecommerce\Item\Offer\Price\Type::index()
226
+            Ecommerce\Item\Offer\Price\Type::table(), Ecommerce\Item\Offer\Price::colPrefix().Ecommerce\Item\Offer\Price\Type::index().' = '.Ecommerce\Item\Offer\Price\Type::index()
227 227
         ];
228 228
 
229 229
         $selectOptions['where'][] = [
230 230
             [Ecommerce\Item\Offer\Price\Type::index(), NULL, 'is'],
231 231
             [
232
-                [Ecommerce\Item\Offer\Price\Type::colPrefix() . 'roles', '', '=', 'OR'],
233
-                [Ecommerce\Item\Offer\Price\Type::colPrefix() . 'roles', '%|' . \Users\User::$cur->role_id . '|%', 'LIKE', 'OR'],
232
+                [Ecommerce\Item\Offer\Price\Type::colPrefix().'roles', '', '=', 'OR'],
233
+                [Ecommerce\Item\Offer\Price\Type::colPrefix().'roles', '%|'.\Users\User::$cur->role_id.'|%', 'LIKE', 'OR'],
234 234
             ],
235 235
         ];
236 236
 
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
         if (!empty($this->config['view_filter'])) {
239 239
             if (!empty($this->config['view_filter']['options'])) {
240 240
                 foreach ($this->config['view_filter']['options'] as $optionId => $optionValue) {
241
-                    $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index() . ' = ' . 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item::index() . ' AND ' .
242
-                        'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item\Option::index() . ' = "' . (int) $optionId . '" AND ' .
243
-                        'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . 'value = "' . (int) $optionValue . '"',
244
-                        'inner', 'option' . $optionId];
241
+                    $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index().' = '.'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item::index().' AND '.
242
+                        'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item\Option::index().' = "'.(int) $optionId.'" AND '.
243
+                        'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().'value = "'.(int) $optionValue.'"',
244
+                        'inner', 'option'.$optionId];
245 245
                 }
246 246
             }
247 247
         }
@@ -251,19 +251,19 @@  discard block
 block discarded – undo
251 251
                 switch ($col) {
252 252
                     case 'price':
253 253
                         if (!empty($filter['min'])) {
254
-                            $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix() . 'price', (float) $filter['min'], '>='];
254
+                            $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix().'price', (float) $filter['min'], '>='];
255 255
                         }
256 256
                         if (!empty($filter['max'])) {
257
-                            $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix() . 'price', (float) $filter['max'], '<='];
257
+                            $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix().'price', (float) $filter['max'], '<='];
258 258
                         }
259 259
                         break;
260 260
                     case 'options':
261 261
                         foreach ($filter as $optionId => $optionValue) {
262 262
                             $optionId = (int) $optionId;
263
-                            $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index() . ' = ' . 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item::index() . ' AND ' .
264
-                                'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item\Option::index() . ' = "' . (int) $optionId . '" AND ' .
265
-                                'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . 'value = ' . \App::$cur->db->connection->pdo->quote($optionValue) . '',
266
-                                'inner', 'option' . $optionId];
263
+                            $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index().' = '.'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item::index().' AND '.
264
+                                'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item\Option::index().' = "'.(int) $optionId.'" AND '.
265
+                                'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().'value = '.\App::$cur->db->connection->pdo->quote($optionValue).'',
266
+                                'inner', 'option'.$optionId];
267 267
                         }
268 268
                         break;
269 269
                     case 'offerOptions':
@@ -272,17 +272,17 @@  discard block
 block discarded – undo
272 272
                             $optionId = (int) $optionId;
273 273
                             if (is_array($optionValue)) {
274 274
                                 $optionValueArr = [];
275
-                                foreach ($optionValue as $val){
275
+                                foreach ($optionValue as $val) {
276 276
                                     $optionValueArr[] = \App::$cur->db->connection->pdo->quote($val);
277 277
                                 }
278
-                                $qstr = 'IN (' . implode(',', $optionValueArr) . ')';
278
+                                $qstr = 'IN ('.implode(',', $optionValueArr).')';
279 279
                             } else {
280
-                                $qstr = '= ' . \App::$cur->db->connection->pdo->quote($optionValue);
280
+                                $qstr = '= '.\App::$cur->db->connection->pdo->quote($optionValue);
281 281
                             }
282
-                            $selectOptions['join'][] = [Ecommerce\Item\Offer\Param::table(), Ecommerce\Item\Offer::index() . ' = ' . 'offerOption' . $optionId . '.' . Ecommerce\Item\Offer\Param::colPrefix() . Ecommerce\Item\Offer::index() . ' AND ' .
283
-                                'offerOption' . $optionId . '.' . Ecommerce\Item\Offer\Param::colPrefix() . Ecommerce\Item\Offer\Option::index() . ' = "' . (int) $optionId . '" AND ' .
284
-                                'offerOption' . $optionId . '.' . Ecommerce\Item\Offer\Param::colPrefix() . 'value '.$qstr,
285
-                                'inner', 'offerOption' . $optionId];
282
+                            $selectOptions['join'][] = [Ecommerce\Item\Offer\Param::table(), Ecommerce\Item\Offer::index().' = '.'offerOption'.$optionId.'.'.Ecommerce\Item\Offer\Param::colPrefix().Ecommerce\Item\Offer::index().' AND '.
283
+                                'offerOption'.$optionId.'.'.Ecommerce\Item\Offer\Param::colPrefix().Ecommerce\Item\Offer\Option::index().' = "'.(int) $optionId.'" AND '.
284
+                                'offerOption'.$optionId.'.'.Ecommerce\Item\Offer\Param::colPrefix().'value '.$qstr,
285
+                                'inner', 'offerOption'.$optionId];
286 286
                         }
287 287
                         break;
288 288
                 }
@@ -297,13 +297,13 @@  discard block
 block discarded – undo
297 297
                     continue;
298 298
                 }
299 299
                 $category = \Ecommerce\Category::get($categoryId);
300
-                $where[] = ['tree_path', $category->tree_path . (int) $categoryId . '/%', 'LIKE', $first ? 'AND' : 'OR'];
300
+                $where[] = ['tree_path', $category->tree_path.(int) $categoryId.'/%', 'LIKE', $first ? 'AND' : 'OR'];
301 301
                 $first = false;
302 302
             }
303 303
             $selectOptions['where'][] = $where;
304 304
         } elseif (!empty($options['parent'])) {
305 305
             $category = \Ecommerce\Category::get($options['parent']);
306
-            $selectOptions['where'][] = ['tree_path', $category->tree_path . (int) $options['parent'] . '/%', 'LIKE'];
306
+            $selectOptions['where'][] = ['tree_path', $category->tree_path.(int) $options['parent'].'/%', 'LIKE'];
307 307
         }
308 308
 
309 309
         //search
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             foreach (explode(' ', $searchStr) as $part) {
314 314
                 $part = trim($part);
315 315
                 if ($part && strlen($part) > 2) {
316
-                    $searchArr[] = ['search_index', '%' . $part . '%', 'LIKE'];
316
+                    $searchArr[] = ['search_index', '%'.$part.'%', 'LIKE'];
317 317
                 }
318 318
             }
319 319
             if (!empty($searchArr)) {
@@ -332,19 +332,19 @@  discard block
 block discarded – undo
332 332
             }
333 333
             $selectOptions['where'][] = [
334 334
                 '(
335
-          (SELECT COALESCE(sum(`' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count`),0) 
336
-            FROM ' . \App::$cur->db->table_prefix . \Ecommerce\Item\Offer\Warehouse::table() . ' iciw 
337
-            WHERE iciw.' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index() . ' = ' . \Ecommerce\Item\Offer::index() . '
338
-                ' . ($warehouseIds ? ' AND iciw.' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Warehouse::index() . ' IN(' . implode(',', $warehouseIds) . ')' : '') . '
335
+          (SELECT COALESCE(sum(`' . \Ecommerce\Item\Offer\Warehouse::colPrefix().'count`),0) 
336
+            FROM ' . \App::$cur->db->table_prefix.\Ecommerce\Item\Offer\Warehouse::table().' iciw 
337
+            WHERE iciw.' . \Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index().' = '.\Ecommerce\Item\Offer::index().'
338
+                ' . ($warehouseIds ? ' AND iciw.'.\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Warehouse::index().' IN('.implode(',', $warehouseIds).')' : '').'
339 339
             )
340 340
           -
341
-          (SELECT COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0)
342
-            FROM ' . \App::$cur->db->table_prefix . \Ecommerce\Warehouse\Block::table() . ' iewb
343
-            inner JOIN ' . \App::$cur->db->table_prefix . \Ecommerce\Cart::table() . ' icc ON icc.' . \Ecommerce\Cart::index() . ' = iewb.' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND (
344
-                (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) ||
345
-                (`' . \Ecommerce\Cart::colPrefix() . \Ecommerce\Cart\Status::index() . '` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
341
+          (SELECT COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix().'count) ,0)
342
+            FROM ' . \App::$cur->db->table_prefix.\Ecommerce\Warehouse\Block::table().' iewb
343
+            inner JOIN ' . \App::$cur->db->table_prefix.\Ecommerce\Cart::table().' icc ON icc.'.\Ecommerce\Cart::index().' = iewb.'.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND (
344
+                (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) ||
345
+                (`' . \Ecommerce\Cart::colPrefix().\Ecommerce\Cart\Status::index().'` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
346 346
             )
347
-            WHERE iewb.' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index() . ' = ' . \Ecommerce\Item\Offer::index() . ')
347
+            WHERE iewb.' . \Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index().' = '.\Ecommerce\Item\Offer::index().')
348 348
           )',
349 349
                 0,
350 350
                 '>'
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         $items = Ecommerce\Item::getList($selectOptions);
374 374
         $items = Ecommerce\Item\Param::getList([
375 375
                     'where' => ['item_id', array_keys($items), 'IN'],
376
-                    'join' => [[Ecommerce\Item\Option::table(), Ecommerce\Item\Option::index() . ' = ' . \Ecommerce\Item\Param::colPrefix() . Ecommerce\Item\Option::index() . ' and ' . \Ecommerce\Item\Option::colPrefix() . 'searchable = 1', 'inner']],
376
+                    'join' => [[Ecommerce\Item\Option::table(), Ecommerce\Item\Option::index().' = '.\Ecommerce\Item\Param::colPrefix().Ecommerce\Item\Option::index().' and '.\Ecommerce\Item\Option::colPrefix().'searchable = 1', 'inner']],
377 377
                     'distinct' => \Ecommerce\Item\Option::index()
378 378
         ]);
379 379
         return $items;
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
         if (is_array($counts)) {
407 407
             $sum = 0;
408 408
             foreach ($counts as $count) {
409
-                $sum +=$count['count'];
409
+                $sum += $count['count'];
410 410
             }
411 411
             return $sum;
412 412
         }
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 
443 443
         if (!empty($conf['files']['aditionTemplateFiels'])) {
444 444
             foreach ($conf['files']['aditionTemplateFiels'] as $file) {
445
-                $return[$file['file']] = '- ' . $file['name'];
445
+                $return[$file['file']] = '- '.$file['name'];
446 446
             }
447 447
         }
448 448
         return $return;
Please login to merge, or discard this patch.