Completed
Push — master ( 100a0b...5e98ad )
by Alexey
04:13
created
system/modules/Menu/widgets/menu.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,18 +9,20 @@
 block discarded – undo
9 9
 $menu = \Menu\Menu::get($code, 'code');
10 10
 if ($menu) {
11 11
     foreach ($menu->items(['where' => ['parent_id', 0], 'order' => ['weight', 'asc']]) as $item) {
12
-        if (urldecode($_SERVER['REQUEST_URI']) == $item->href)
13
-            $active = ' class = "active" ';
14
-        else
15
-            $active = '';
12
+        if (urldecode($_SERVER['REQUEST_URI']) == $item->href) {
13
+                    $active = ' class = "active" ';
14
+        } else {
15
+                    $active = '';
16
+        }
16 17
         echo "<li {$active}><a href = '{$item->href}'>{$item->name}</a>";
17 18
         if ($item->childs(['order' => ['weight', 'asc']])) {
18 19
             echo "<ul>";
19 20
             foreach ($item->childs as $item) {
20
-                if (urldecode($_SERVER['REQUEST_URI']) == $item->href)
21
-                    $active = ' class = "active" ';
22
-                else
23
-                    $active = '';
21
+                if (urldecode($_SERVER['REQUEST_URI']) == $item->href) {
22
+                                    $active = ' class = "active" ';
23
+                } else {
24
+                                    $active = '';
25
+                }
24 26
                 echo "<li {$active}><a href = '{$item->href}'>{$item->name}</a>";
25 27
             }
26 28
             echo "</ul>";
Please login to merge, or discard this patch.
system/modules/Dashboard/appAdminControllers/content/siteConfig.php 1 patch
Braces   +24 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,27 +2,45 @@
 block discarded – undo
2 2
 <form action = '' method = 'POST' enctype="multipart/form-data">
3 3
   <div class ="form-group">
4 4
     <label>Название сайта</label>
5
-    <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) echo \App::$primary->config['site']['name']; ?>' />
5
+    <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) {
6
+    echo \App::$primary->config['site']['name'];
7
+}
8
+?>' />
6 9
   </div>
7 10
   <div class ="form-group">
8 11
     <label>Название компании</label>
9
-    <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) echo \App::$primary->config['site']['company_name']; ?>' />
12
+    <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) {
13
+    echo \App::$primary->config['site']['company_name'];
14
+}
15
+?>' />
10 16
   </div>
11 17
   <div class ="form-group">
12 18
     <label>Основной домен</label>
13
-    <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) echo \App::$primary->config['site']['domain']; ?>' />
19
+    <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) {
20
+    echo \App::$primary->config['site']['domain'];
21
+}
22
+?>' />
14 23
   </div>
15 24
   <div class ="form-group">
16 25
     <label>Контактный email</label>
17
-    <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) echo \App::$primary->config['site']['email']; ?>' />
26
+    <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) {
27
+    echo \App::$primary->config['site']['email'];
28
+}
29
+?>' />
18 30
   </div>
19 31
   <div class ="form-group">
20 32
     <label>Ключевые слова</label>
21
-    <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) echo \App::$primary->config['site']['keywords']; ?>' />
33
+    <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) {
34
+    echo \App::$primary->config['site']['keywords'];
35
+}
36
+?>' />
22 37
   </div>
23 38
   <div class ="form-group">
24 39
     <label>Краткое описание сайта</label>
25
-    <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' />
40
+    <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) {
41
+    echo \App::$primary->config['site']['description'];
42
+}
43
+?>' />
26 44
   </div>
27 45
   <?php
28 46
   $form = new Ui\Form();
Please login to merge, or discard this patch.
system/modules/Db/objects/Mysql/Query.php 1 patch
Braces   +34 added lines, -26 removed lines patch added patch discarded remove patch
@@ -126,12 +126,14 @@  discard block
 block discarded – undo
126 126
         if (!is_array($order)) {
127 127
             $this->order[] = "{$order} {$type}";
128 128
         } else {
129
-            foreach ($order as $item)
130
-                if (!is_array($item)) {
129
+            foreach ($order as $item) {
130
+                            if (!is_array($item)) {
131 131
                     call_user_func_array(array($this, 'order'), $order);
132
+            }
132 133
                     break;
133
-                } else
134
-                    $this->order($item);
134
+                } else {
135
+                                    $this->order($item);
136
+                }
135 137
         }
136 138
     }
137 139
 
@@ -140,8 +142,9 @@  discard block
 block discarded – undo
140 142
         $start = intval($start);
141 143
         $len = intval($len);
142 144
         $this->limit = "LIMIT {$start}";
143
-        if ($len !== 0)
144
-            $this->limit .= ",{$len}";
145
+        if ($len !== 0) {
146
+                    $this->limit .= ",{$len}";
147
+        }
145 148
     }
146 149
 
147 150
     public function buildJoin($table, $where = false, $type = 'LEFT', $alias = '')
@@ -154,10 +157,12 @@  discard block
 block discarded – undo
154 157
             }
155 158
         } else {
156 159
             $join .= " {$type} JOIN {$this->curInstance->table_prefix}{$table}";
157
-            if ($alias)
158
-                $join .= " AS `{$alias}`";
159
-            if ($where)
160
-                $join .= " ON {$where}";
160
+            if ($alias) {
161
+                            $join .= " AS `{$alias}`";
162
+            }
163
+            if ($where) {
164
+                            $join .= " ON {$where}";
165
+            }
161 166
         }
162 167
         return $join;
163 168
     }
@@ -177,13 +182,15 @@  discard block
 block discarded – undo
177 182
                 $operation = '=';
178 183
             }
179 184
 
180
-            if ($concatenation === false)
181
-                $concatenation = 'AND';
182
-            elseif ($concatenation === true)
183
-                $concatenation = '';
185
+            if ($concatenation === false) {
186
+                            $concatenation = 'AND';
187
+            } elseif ($concatenation === true) {
188
+                            $concatenation = '';
189
+            }
184 190
 
185
-            if ($this->whereString == NULL)
186
-                $this->whereString = ' WHERE ';
191
+            if ($this->whereString == NULL) {
192
+                            $this->whereString = ' WHERE ';
193
+            }
187 194
 
188 195
             if (stristr($operation, 'IN') || stristr($operation, 'NOT IN')) {
189 196
                 if (is_array($value)) {
@@ -209,12 +216,12 @@  discard block
 block discarded – undo
209 216
                 $value = "?";
210 217
             }
211 218
 
212
-            if (substr($this->whereString, -1, 1) == '(' || substr($this->whereString, -2, 2) == 'E ')
213
-                $this->whereString .= " {$where} {$operation} {$value} ";
214
-            else
215
-                $this->whereString .= "{$concatenation} {$where} {$operation} {$value} ";
216
-        }
217
-        else {
219
+            if (substr($this->whereString, -1, 1) == '(' || substr($this->whereString, -2, 2) == 'E ') {
220
+                            $this->whereString .= " {$where} {$operation} {$value} ";
221
+            } else {
222
+                            $this->whereString .= "{$concatenation} {$where} {$operation} {$value} ";
223
+            }
224
+        } else {
218 225
             $i = -1;
219 226
             while (isset($where[++$i])) {
220 227
                 $item = $where[$i];
@@ -229,10 +236,11 @@  discard block
 block discarded – undo
229 236
                         $this->whereString .= "{$concatenation} ";
230 237
                     }
231 238
 
232
-                    if ($this->whereString != NULL)
233
-                        $this->whereString .= '(';
234
-                    else
235
-                        $this->whereString = 'WHERE (';
239
+                    if ($this->whereString != NULL) {
240
+                                            $this->whereString .= '(';
241
+                    } else {
242
+                                            $this->whereString = 'WHERE (';
243
+                    }
236 244
                 }
237 245
 
238 246
                 if (!is_array($item)) {
Please login to merge, or discard this patch.
system/Inji/Model.php 1 patch
Braces   +40 added lines, -32 removed lines patch added patch discarded remove patch
@@ -260,8 +260,7 @@  discard block
 block discarded – undo
260 260
                             } else {
261 261
                                 $value = $item->$colName;
262 262
                             }
263
-                        }
264
-                        else {
263
+                        } else {
265 264
                             $value = $item->$colName;
266 265
                         }
267 266
                         break;
@@ -751,17 +750,21 @@  discard block
 block discarded – undo
751 750
         if (!$query) {
752 751
             return [];
753 752
         }
754
-        if (!empty($options['where']))
755
-            $query->where($options['where']);
753
+        if (!empty($options['where'])) {
754
+                    $query->where($options['where']);
755
+        }
756 756
         if (!empty($options['group'])) {
757 757
             $query->group($options['group']);
758 758
         }
759
-        if (!empty($options['order']))
760
-            $query->order($options['order']);
761
-        if (!empty($options['join']))
762
-            $query->join($options['join']);
763
-        if (!empty($options['distinct']))
764
-            $query->distinct = $options['distinct'];
759
+        if (!empty($options['order'])) {
760
+                    $query->order($options['order']);
761
+        }
762
+        if (!empty($options['join'])) {
763
+                    $query->join($options['join']);
764
+        }
765
+        if (!empty($options['distinct'])) {
766
+                    $query->distinct = $options['distinct'];
767
+        }
765 768
 
766 769
         foreach (static::$relJoins as $join) {
767 770
             $query->join($join[0], $join[1]);
@@ -787,14 +790,14 @@  discard block
 block discarded – undo
787 790
         }
788 791
         static::$needJoin = [];
789 792
 
790
-        if (!empty($options['limit']))
791
-            $limit = (int) $options['limit'];
792
-        else {
793
+        if (!empty($options['limit'])) {
794
+                    $limit = (int) $options['limit'];
795
+        } else {
793 796
             $limit = 0;
794 797
         }
795
-        if (!empty($options['start']))
796
-            $start = (int) $options['start'];
797
-        else {
798
+        if (!empty($options['start'])) {
799
+                    $start = (int) $options['start'];
800
+        } else {
798 801
             $start = 0;
799 802
         }
800 803
         if ($limit || $start) {
@@ -1061,21 +1064,23 @@  discard block
 block discarded – undo
1061 1064
         if (!empty($options['where'])) {
1062 1065
             static::fixPrefix($options['where'], 'first');
1063 1066
         }
1064
-        if (!empty($options['where']))
1065
-            $query->where($options['where']);
1066
-        if (!empty($options['join']))
1067
-            $query->join($options['join']);
1067
+        if (!empty($options['where'])) {
1068
+                    $query->where($options['where']);
1069
+        }
1070
+        if (!empty($options['join'])) {
1071
+                    $query->join($options['join']);
1072
+        }
1068 1073
         if (!empty($options['order'])) {
1069 1074
             $query->order($options['order']);
1070 1075
         }
1071
-        if (!empty($options['limit']))
1072
-            $limit = (int) $options['limit'];
1073
-        else {
1076
+        if (!empty($options['limit'])) {
1077
+                    $limit = (int) $options['limit'];
1078
+        } else {
1074 1079
             $limit = 0;
1075 1080
         }
1076
-        if (!empty($options['start']))
1077
-            $start = (int) $options['start'];
1078
-        else {
1081
+        if (!empty($options['start'])) {
1082
+                    $start = (int) $options['start'];
1083
+        } else {
1079 1084
             $start = 0;
1080 1085
         }
1081 1086
         if ($limit || $start) {
@@ -1153,8 +1158,9 @@  discard block
 block discarded – undo
1153 1158
 
1154 1159
         $values = [];
1155 1160
         foreach ($cols as $col => $param) {
1156
-            if (isset($params[$col]))
1157
-                $values[$col] = $params[$col];
1161
+            if (isset($params[$col])) {
1162
+                            $values[$col] = $params[$col];
1163
+            }
1158 1164
         }
1159 1165
         if (empty($values)) {
1160 1166
             return false;
@@ -1337,8 +1343,9 @@  discard block
 block discarded – undo
1337 1343
         $values = [];
1338 1344
 
1339 1345
         foreach ($this->cols() as $col => $param) {
1340
-            if (isset($this->_params[$col]))
1341
-                $values[$col] = $this->_params[$col];
1346
+            if (isset($this->_params[$col])) {
1347
+                            $values[$col] = $this->_params[$col];
1348
+            }
1342 1349
         }
1343 1350
         if (empty($values) && empty($options['empty'])) {
1344 1351
             return false;
@@ -1498,8 +1505,9 @@  discard block
 block discarded – undo
1498 1505
     {
1499 1506
 
1500 1507
         foreach (static::relations() as $relName => $rel) {
1501
-            if ($rel['col'] == $col)
1502
-                return $relName;
1508
+            if ($rel['col'] == $col) {
1509
+                            return $relName;
1510
+            }
1503 1511
         }
1504 1512
         return NULL;
1505 1513
     }
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/CartController.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -271,10 +271,11 @@
 block discarded – undo
271 271
     $item->sales ++;
272 272
     $item->save();
273 273
 
274
-    if (empty($_GET['count']))
275
-      $count = 1;
276
-    else
277
-      $count = (float) $_GET['count'];
274
+    if (empty($_GET['count'])) {
275
+          $count = 1;
276
+    } else {
277
+          $count = (float) $_GET['count'];
278
+    }
278 279
 
279 280
     $cart = $this->ecommerce->getCurCart();
280 281
     $stages = Ecommerce\Cart\Stage::getList();
Please login to merge, or discard this patch.
system/modules/Db/objects/Mysql/Mysql.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,14 +29,18 @@
 block discarded – undo
29 29
    */
30 30
   public function init($connect_options) {
31 31
     extract($connect_options);
32
-    if (isset($db_name))
33
-      $this->db_name = $db_name;
34
-    if (isset($encoding))
35
-      $this->encoding = $encoding;
36
-    if (isset($table_prefix))
37
-      $this->table_prefix = $table_prefix;
38
-    if (isset($noConnectAbort))
39
-      $this->noConnectAbort = $noConnectAbort;
32
+    if (isset($db_name)) {
33
+          $this->db_name = $db_name;
34
+    }
35
+    if (isset($encoding)) {
36
+          $this->encoding = $encoding;
37
+    }
38
+    if (isset($table_prefix)) {
39
+          $this->table_prefix = $table_prefix;
40
+    }
41
+    if (isset($noConnectAbort)) {
42
+          $this->noConnectAbort = $noConnectAbort;
43
+    }
40 44
 
41 45
     $dsn = "mysql:host=$host;port=$port;dbname=$db_name;charset=$encoding";
42 46
     $dt = new \DateTime();
Please login to merge, or discard this patch.
system/Inji/Tools.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,8 +55,9 @@  discard block
 block discarded – undo
55 55
    * @return boolean
56 56
    */
57 57
   public static function createDir($path) {
58
-    if (file_exists($path))
59
-      return true;
58
+    if (file_exists($path)) {
59
+          return true;
60
+    }
60 61
 
61 62
     $path = explode('/', $path);
62 63
     $cur = '';
@@ -100,10 +101,11 @@  discard block
 block discarded – undo
100 101
       return false;
101 102
     }
102 103
 
103
-    if ($img_width / $max_width > $img_height / $max_height)
104
-      $separator = $img_width / $max_width;
105
-    else
106
-      $separator = $img_height / $max_height;
104
+    if ($img_width / $max_width > $img_height / $max_height) {
105
+          $separator = $img_width / $max_width;
106
+    } else {
107
+          $separator = $img_height / $max_height;
108
+    }
107 109
 
108 110
     if ($crop === true || $crop == 'q') {
109 111
       if ($img_width > $img_height) {
Please login to merge, or discard this patch.
system/modules/Files/Files.php 1 patch
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -22,16 +22,19 @@  discard block
 block discarded – undo
22 22
 
23 23
     $sitePath = App::$primary->path;
24 24
 
25
-    if (!is_uploaded_file($file['tmp_name']))
26
-      return 0;
25
+    if (!is_uploaded_file($file['tmp_name'])) {
26
+          return 0;
27
+    }
27 28
 
28 29
     $fileinfo = pathinfo($file['name']);
29
-    if (empty($fileinfo['extension']))
30
-      return 0;
30
+    if (empty($fileinfo['extension'])) {
31
+          return 0;
32
+    }
31 33
 
32 34
     $type = Files\Type::get($fileinfo['extension'], 'ext');
33
-    if (!$type)
34
-      return 0;
35
+    if (!$type) {
36
+          return 0;
37
+    }
35 38
 
36 39
     if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
37 40
       return 0;
@@ -47,8 +50,9 @@  discard block
 block discarded – undo
47 50
     }
48 51
     $fileObject->name = $fileinfo['filename'];
49 52
     $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
50
-    if ($fileObject->id && file_exists($sitePath . $fileObject->path))
51
-      unlink($sitePath . $fileObject->path);
53
+    if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
54
+          unlink($sitePath . $fileObject->path);
55
+    }
52 56
 
53 57
     Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
54 58
 
@@ -84,12 +88,14 @@  discard block
 block discarded – undo
84 88
     $sitePath = App::$primary->path;
85 89
 
86 90
     $fileinfo = pathinfo($url);
87
-    if (empty($fileinfo['extension']))
88
-      return 0;
91
+    if (empty($fileinfo['extension'])) {
92
+          return 0;
93
+    }
89 94
 
90 95
     $type = Files\Type::get($fileinfo['extension'], 'ext');
91
-    if (!$type)
92
-      return 0;
96
+    if (!$type) {
97
+          return 0;
98
+    }
93 99
 
94 100
     if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
95 101
       return 0;
@@ -105,8 +111,9 @@  discard block
 block discarded – undo
105 111
     }
106 112
     $fileObject->name = $fileinfo['filename'];
107 113
     $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
108
-    if ($fileObject->id && file_exists($sitePath . $fileObject->path))
109
-      unlink($sitePath . $fileObject->path);
114
+    if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
115
+          unlink($sitePath . $fileObject->path);
116
+    }
110 117
 
111 118
     Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
112 119
 
Please login to merge, or discard this patch.