Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/Ecommerce/appControllers/content/Cart/orderDetail.php 2 patches
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
                 <tr>
18 18
                     <td class="text-left" style="width: 50%;">              
19 19
                       <?php
20
-                      foreach ($orderDeatilCols as $col => $label) {
21
-                          echo "<b>{$label}</b> " . $cart->$col . "<br>";
22
-                      }
23
-                      ?>
20
+                        foreach ($orderDeatilCols as $col => $label) {
21
+                            echo "<b>{$label}</b> " . $cart->$col . "<br>";
22
+                        }
23
+                        ?>
24 24
                     </td>
25 25
                     <td class="text-left">              
26 26
                         <b>Способ оплаты</b> <?= $cart->payType ? $cart->payType->name : '' ?><br>
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
                 <tr>
40 40
                     <td class="text-left">
41 41
                       <?php
42
-                      if ($cart->infos) {
43
-                          foreach ($cart->infos as $info) {
44
-                              echo "<b>{$info->field->name()}</b> " . $info->value . "<br>";
45
-                          }
46
-                      }
47
-                      ?>
42
+                        if ($cart->infos) {
43
+                            foreach ($cart->infos as $info) {
44
+                                echo "<b>{$info->field->name()}</b> " . $info->value . "<br>";
45
+                            }
46
+                        }
47
+                        ?>
48 48
                     </td>
49 49
                 </tr>
50 50
             </tbody>
@@ -65,45 +65,45 @@  discard block
 block discarded – undo
65 65
                 </thead>
66 66
                 <tbody>
67 67
                   <?php
68
-                  $sums = [];
69
-                  foreach ($cart->cartItems as $cartItem) {
70
-                      $item = $cartItem->item;
71
-                      $itemName = $item->name();
72
-                      if (!isset($sums[$cartItem->price->currency_id])) {
73
-                          $sums[$cartItem->price->currency_id] = $cartItem->price->price;
74
-                      } else {
75
-                          $sums[$cartItem->price->currency_id] += $cartItem->price->price;
76
-                      }
77
-                      ?>
68
+                    $sums = [];
69
+                    foreach ($cart->cartItems as $cartItem) {
70
+                        $item = $cartItem->item;
71
+                        $itemName = $item->name();
72
+                        if (!isset($sums[$cartItem->price->currency_id])) {
73
+                            $sums[$cartItem->price->currency_id] = $cartItem->price->price;
74
+                        } else {
75
+                            $sums[$cartItem->price->currency_id] += $cartItem->price->price;
76
+                        }
77
+                        ?>
78 78
                         <tr>
79 79
                             <td class="text-left"><?= $itemName; ?></td>
80 80
                             <td class="text-right"><?= $cartItem->count; ?></td>
81 81
                             <td class="text-right"><?= $cartItem->price->price; ?> 
82 82
                               <?php
83
-                              if (App::$cur->money) {
84
-                                  $currency = Money\Currency::get($cartItem->price->currency_id);
85
-                                  if ($currency) {
86
-                                      echo $currency->acronym();
87
-                                  } else {
88
-                                      echo 'руб.';
89
-                                  }
90
-                              } else {
91
-                                  echo 'руб.';
92
-                              }
93
-                              ?></td>
83
+                                if (App::$cur->money) {
84
+                                    $currency = Money\Currency::get($cartItem->price->currency_id);
85
+                                    if ($currency) {
86
+                                        echo $currency->acronym();
87
+                                    } else {
88
+                                        echo 'руб.';
89
+                                    }
90
+                                } else {
91
+                                    echo 'руб.';
92
+                                }
93
+                                ?></td>
94 94
                             <td class="text-right"><?= ($cartItem->price->price * $cartItem->count); ?>
95 95
                               <?php
96
-                              if (App::$cur->money) {
97
-                                  $currency = Money\Currency::get($cartItem->price->currency_id);
98
-                                  if ($currency) {
99
-                                      echo $currency->acronym();
100
-                                  } else {
101
-                                      echo 'руб.';
102
-                                  }
103
-                              } else {
104
-                                  echo 'руб.';
105
-                              }
106
-                              ?></td>
96
+                                if (App::$cur->money) {
97
+                                    $currency = Money\Currency::get($cartItem->price->currency_id);
98
+                                    if ($currency) {
99
+                                        echo $currency->acronym();
100
+                                    } else {
101
+                                        echo 'руб.';
102
+                                    }
103
+                                } else {
104
+                                    echo 'руб.';
105
+                                }
106
+                                ?></td>
107 107
                             <td class="text-right" style="white-space: nowrap;">
108 108
                                 <a onclick = 'inji.Ecommerce.Cart.addItem(<?= $item->getPrice()->id; ?>, 1);
109 109
                                           return false;' data-original-title="Добавить в корзину" href="#" data-toggle="tooltip" title="" class="btn btn-primary"><i class="glyphicon glyphicon-shopping-cart"></i></a>
@@ -117,24 +117,24 @@  discard block
 block discarded – undo
117 117
                         <td colspan="2"></td>
118 118
                         <td class="text-right"><b>Сумма</b></td>
119 119
                         <td class="text-right"><?php
120
-                          foreach ($sums as $currency_id => $sum) {
121
-                              if (!$sum) {
122
-                                  continue;
123
-                              }
124
-                              echo number_format($sum, 2, '.', ' ');
125
-                              if (App::$cur->money) {
126
-                                  $currency = Money\Currency::get($currency_id);
127
-                                  if ($currency) {
128
-                                      echo '&nbsp;' . $currency->acronym();
129
-                                  } else {
130
-                                      echo '&nbsp;руб.';
131
-                                  }
132
-                              } else {
133
-                                  echo '&nbsp;руб.';
134
-                              }
135
-                              echo '<br />';
136
-                          }
137
-                          ?></td>
120
+                            foreach ($sums as $currency_id => $sum) {
121
+                                if (!$sum) {
122
+                                    continue;
123
+                                }
124
+                                echo number_format($sum, 2, '.', ' ');
125
+                                if (App::$cur->money) {
126
+                                    $currency = Money\Currency::get($currency_id);
127
+                                    if ($currency) {
128
+                                        echo '&nbsp;' . $currency->acronym();
129
+                                    } else {
130
+                                        echo '&nbsp;руб.';
131
+                                    }
132
+                                } else {
133
+                                    echo '&nbsp;руб.';
134
+                                }
135
+                                echo '<br />';
136
+                            }
137
+                            ?></td>
138 138
                         <td></td>
139 139
                     </tr>
140 140
                     <?php
@@ -160,24 +160,24 @@  discard block
 block discarded – undo
160 160
                         <td colspan="2"></td>
161 161
                         <td class="text-right"><b>Итого</b></td>
162 162
                         <td class="text-right"><?php
163
-                          foreach ($sums as $currency_id => $sum) {
164
-                              if (!$sum) {
165
-                                  continue;
166
-                              }
167
-                              echo number_format($sum, 2, '.', ' ');
168
-                              if (App::$cur->money) {
169
-                                  $currency = Money\Currency::get($currency_id);
170
-                                  if ($currency) {
171
-                                      echo '&nbsp;' . $currency->acronym();
172
-                                  } else {
173
-                                      echo '&nbsp;руб.';
174
-                                  }
175
-                              } else {
176
-                                  echo '&nbsp;руб.';
177
-                              }
178
-                              echo '<br />';
179
-                          }
180
-                          ?></td>
163
+                            foreach ($sums as $currency_id => $sum) {
164
+                                if (!$sum) {
165
+                                    continue;
166
+                                }
167
+                                echo number_format($sum, 2, '.', ' ');
168
+                                if (App::$cur->money) {
169
+                                    $currency = Money\Currency::get($currency_id);
170
+                                    if ($currency) {
171
+                                        echo '&nbsp;' . $currency->acronym();
172
+                                    } else {
173
+                                        echo '&nbsp;руб.';
174
+                                    }
175
+                                } else {
176
+                                    echo '&nbsp;руб.';
177
+                                }
178
+                                echo '<br />';
179
+                            }
180
+                            ?></td>
181 181
                         <td></td>
182 182
                     </tr>
183 183
                 </tfoot>
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
             </thead>
195 195
             <tbody>
196 196
               <?php
197
-              $statuses = Ecommerce\Cart\Event::getList(['where' => [['cart_id', $cart->id]], 'order' => ['date_create', 'desc']]);
198
-              foreach ($statuses as $status) {
199
-                  ?>
197
+                $statuses = Ecommerce\Cart\Event::getList(['where' => [['cart_id', $cart->id]], 'order' => ['date_create', 'desc']]);
198
+                foreach ($statuses as $status) {
199
+                    ?>
200 200
                     <tr>
201 201
                         <td class="text-left"><?= $status->date_create; ?></td>
202 202
                         <td class="text-left"><?= $status->type->name; ?></td>
Please login to merge, or discard this patch.
Braces   +24 added lines, -12 removed lines patch added patch discarded remove patch
@@ -71,7 +71,8 @@  discard block
 block discarded – undo
71 71
                       $itemName = $item->name();
72 72
                       if (!isset($sums[$cartItem->price->currency_id])) {
73 73
                           $sums[$cartItem->price->currency_id] = $cartItem->price->price;
74
-                      } else {
74
+                      }
75
+                      else {
75 76
                           $sums[$cartItem->price->currency_id] += $cartItem->price->price;
76 77
                       }
77 78
                       ?>
@@ -84,10 +85,12 @@  discard block
 block discarded – undo
84 85
                                   $currency = Money\Currency::get($cartItem->price->currency_id);
85 86
                                   if ($currency) {
86 87
                                       echo $currency->acronym();
87
-                                  } else {
88
+                                  }
89
+                                  else {
88 90
                                       echo 'руб.';
89 91
                                   }
90
-                              } else {
92
+                              }
93
+                              else {
91 94
                                   echo 'руб.';
92 95
                               }
93 96
                               ?></td>
@@ -97,10 +100,12 @@  discard block
 block discarded – undo
97 100
                                   $currency = Money\Currency::get($cartItem->price->currency_id);
98 101
                                   if ($currency) {
99 102
                                       echo $currency->acronym();
100
-                                  } else {
103
+                                  }
104
+                                  else {
101 105
                                       echo 'руб.';
102 106
                                   }
103
-                              } else {
107
+                              }
108
+                              else {
104 109
                                   echo 'руб.';
105 110
                               }
106 111
                               ?></td>
@@ -126,10 +131,12 @@  discard block
 block discarded – undo
126 131
                                   $currency = Money\Currency::get($currency_id);
127 132
                                   if ($currency) {
128 133
                                       echo '&nbsp;' . $currency->acronym();
129
-                                  } else {
134
+                                  }
135
+                                  else {
130 136
                                       echo '&nbsp;руб.';
131 137
                                   }
132
-                              } else {
138
+                              }
139
+                              else {
133 140
                                   echo '&nbsp;руб.';
134 141
                               }
135 142
                               echo '<br />';
@@ -142,7 +149,8 @@  discard block
 block discarded – undo
142 149
                     $deliveryPrice = $cart->delivery->price;
143 150
                     if (!isset($sums[$deliveryCurrency])) {
144 151
                         $sums[$deliveryCurrency] = $deliveryPrice;
145
-                    } else {
152
+                    }
153
+                    else {
146 154
                         $sums[$deliveryCurrency] += $deliveryPrice;
147 155
                     }
148 156
                     $delCurrency = false;
@@ -169,10 +177,12 @@  discard block
 block discarded – undo
169 177
                                   $currency = Money\Currency::get($currency_id);
170 178
                                   if ($currency) {
171 179
                                       echo '&nbsp;' . $currency->acronym();
172
-                                  } else {
180
+                                  }
181
+                                  else {
173 182
                                       echo '&nbsp;руб.';
174 183
                                   }
175
-                              } else {
184
+                              }
185
+                              else {
176 186
                                   echo '&nbsp;руб.';
177 187
                               }
178 188
                               echo '<br />';
@@ -208,7 +218,8 @@  discard block
 block discarded – undo
208 218
                                     $price = Ecommerce\Item\Offer\Price::get($status->info);
209 219
                                     if ($price) {
210 220
                                         echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a>";
211
-                                    } else {
221
+                                    }
222
+                                    else {
212 223
                                         echo 'Товар удален';
213 224
                                     }
214 225
                                     break;
@@ -217,7 +228,8 @@  discard block
 block discarded – undo
217 228
                                     $price = Ecommerce\Item\Offer\Price::get($info[0]);
218 229
                                     if ($price) {
219 230
                                         echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a> " . ($info[1] > 0 ? '+' . $info[1] : $info[1]);
220
-                                    } else {
231
+                                    }
232
+                                    else {
221 233
                                         echo 'Товар удален';
222 234
                                     }
223 235
                                     break;
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/content/Cart/index.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -86,14 +86,14 @@  discard block
 block discarded – undo
86 86
                                     </thead>
87 87
                                     <tbody>
88 88
                                       <?php
89
-                                      if (class_exists('Money\Currency')) {
90
-                                          $defaultCurrency = Money\Currency::get(\App::$cur->ecommerce->config['defaultCurrency']);
91
-                                      } else {
92
-                                          $defaultCurrency = '';
93
-                                      }
94
-                                      foreach ($cart->cartItems as $cartItem) {
95
-                                          $path = $cartItem->item->image ? $cartItem->item->image->path : '/static/system/images/no-image.png';
96
-                                          ?>
89
+                                        if (class_exists('Money\Currency')) {
90
+                                            $defaultCurrency = Money\Currency::get(\App::$cur->ecommerce->config['defaultCurrency']);
91
+                                        } else {
92
+                                            $defaultCurrency = '';
93
+                                        }
94
+                                        foreach ($cart->cartItems as $cartItem) {
95
+                                            $path = $cartItem->item->image ? $cartItem->item->image->path : '/static/system/images/no-image.png';
96
+                                            ?>
97 97
                                             <tr class="cart_item_id<?= $cartItem->id; ?> item" data-cart_item_id = '<?php echo $cartItem->id; ?>' data-priceam = '<?php echo $cartItem->price->price; ?>' data-item_offer_price_id = '<?php echo $cartItem->price->id; ?>'>
98 98
                                                 <td class="text-center image">                            
99 99
                                                     <a href="/ecommerce/view/<?php echo $cartItem->item->id; ?>">
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
                                     </tbody>
125 125
                                     <tfoot>
126 126
                                       <?php
127
-                                      $colspan = $cart->hasDiscount() ? 5 : 4;
128
-                                      ?>
127
+                                        $colspan = $cart->hasDiscount() ? 5 : 4;
128
+                                        ?>
129 129
                                         <tr class="order_page-sum">
130 130
                                             <td colspan="<?= $colspan; ?>" class="text-right">Сумма:</td>
131 131
                                             <td colspan="2" class="text-right"><?= $cart->itemsSum(); ?></td>
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
                                             <tr class="order_page-deliverySum">
145 145
                                                 <td colspan="<?= $colspan; ?>" class="text-right"><?= $cart->delivery->name; ?>:</td>
146 146
                                                 <td colspan="2" class="text-right"><?php
147
-                                                  if ($cart->delivery && $cart->delivery->price_text) {
148
-                                                      echo $cart->delivery->price_text;
149
-                                                  } else {
150
-                                                      echo $cart->deliverySum();
151
-                                                  }
152
-                                                  ?></td>
147
+                                                    if ($cart->delivery && $cart->delivery->price_text) {
148
+                                                        echo $cart->delivery->price_text;
149
+                                                    } else {
150
+                                                        echo $cart->deliverySum();
151
+                                                    }
152
+                                                    ?></td>
153 153
                                             </tr>
154 154
                                             <?php
155 155
                                         }
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
                             <div class="clearfix"></div>
166 166
                             <div class="order_page-finish">
167 167
                               <?php
168
-                              $form->input('textarea', 'comment', 'Вы можете добавить комментарий к своему заказу', ['value' => (!empty($_POST['comment'])) ? $_POST['comment'] : '']);
169
-                              ?>
168
+                                $form->input('textarea', 'comment', 'Вы можете добавить комментарий к своему заказу', ['value' => (!empty($_POST['comment'])) ? $_POST['comment'] : '']);
169
+                                ?>
170 170
                                 <div class="order_page-orderBtn">
171 171
                                     <button name ="action" value ="order" data-loading-text="Подождите.." class="btn btn-primary">Подтверждение заказа</button>
172 172
                                 </div>
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,8 +3,9 @@  discard block
 block discarded – undo
3 3
         <div class="cart-order_page">
4 4
             <h2>Быстрое оформление заказа</h2>
5 5
             <?php
6
-            if (!$cart || !$cart->cartItems)
7
-                echo "<h1>Ваша корзина пуста</h1>";
6
+            if (!$cart || !$cart->cartItems) {
7
+                            echo "<h1>Ваша корзина пуста</h1>";
8
+            }
8 9
             else {
9 10
                 $form = new Ui\Form;
10 11
                 $form->action = "/ecommerce/cart";
@@ -88,7 +89,8 @@  discard block
 block discarded – undo
88 89
                                       <?php
89 90
                                       if (class_exists('Money\Currency')) {
90 91
                                           $defaultCurrency = Money\Currency::get(\App::$cur->ecommerce->config['defaultCurrency']);
91
-                                      } else {
92
+                                      }
93
+                                      else {
92 94
                                           $defaultCurrency = '';
93 95
                                       }
94 96
                                       foreach ($cart->cartItems as $cartItem) {
@@ -146,7 +148,8 @@  discard block
 block discarded – undo
146 148
                                                 <td colspan="2" class="text-right"><?php
147 149
                                                   if ($cart->delivery && $cart->delivery->price_text) {
148 150
                                                       echo $cart->delivery->price_text;
149
-                                                  } else {
151
+                                                  }
152
+                                                  else {
150 153
                                                       echo $cart->deliverySum();
151 154
                                                   }
152 155
                                                   ?></td>
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/content/buyCard.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <div class="ecommerce">
2 2
     <div class="cart-order_page">
3 3
       <?php
4
-      $form = new Ui\Form;
5
-      $form->action = "/ecommerce/buyCard";
6
-      $form->begin();
7
-      ?>
4
+        $form = new Ui\Form;
5
+        $form->action = "/ecommerce/buyCard";
6
+        $form->begin();
7
+        ?>
8 8
         <div class="row">
9 9
             <div class="col-sm-4">
10 10
                 <div class="order_page-info">
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
                             </thead>
35 35
                             <tbody class="cartitems">
36 36
                               <?php
37
-                              $first = true;
38
-                              foreach (\Ecommerce\Card::getList() as $card) {
39
-                                  $checked = $first;
40
-                                  $first = false;
41
-                                  ?>
37
+                                $first = true;
38
+                                foreach (\Ecommerce\Card::getList() as $card) {
39
+                                    $checked = $first;
40
+                                    $first = false;
41
+                                    ?>
42 42
                                     <tr>
43 43
                                         <td>
44 44
                                             <input id ="cardId" type="radio" name ="card_id" value ="<?= $card->id; ?>" <?= $checked ? 'checked' : ''; ?> />
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
                                         <td>
51 51
                                             <ul>
52 52
                                               <?php
53
-                                              foreach ($card->levels as $level) {
54
-                                                  ?>
53
+                                                foreach ($card->levels as $level) {
54
+                                                    ?>
55 55
                                                     <li><?= $level->name; ?> - <?= $level->discount->name; ?></li>
56 56
                                                     <?php
57 57
                                                 }
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/content/view.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,20 +17,20 @@
 block discarded – undo
17 17
                         <h1><?= $item->name(); ?></h1>
18 18
                         <ul class="item-options">
19 19
                           <?php
20
-                          foreach ($item->options as $param) {
21
-                              if (!$param->item_option_view || !$param->value)
22
-                                  continue;
23
-                              if ($param->item_option_type == 'select') {
24
-                                  if (empty($param->option->items[$param->value]))
25
-                                      continue;
26
-                                  $value = $param->option->items[$param->value]->value;
27
-                              } else {
28
-                                  $value = $param->value;
29
-                              }
30
-                              $paramName = $param->item_option_name;
31
-                              echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>";
32
-                          }
33
-                          ?>
20
+                            foreach ($item->options as $param) {
21
+                                if (!$param->item_option_view || !$param->value)
22
+                                    continue;
23
+                                if ($param->item_option_type == 'select') {
24
+                                    if (empty($param->option->items[$param->value]))
25
+                                        continue;
26
+                                    $value = $param->option->items[$param->value]->value;
27
+                                } else {
28
+                                    $value = $param->value;
29
+                                }
30
+                                $paramName = $param->item_option_name;
31
+                                echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>";
32
+                            }
33
+                            ?>
34 34
                         </ul>
35 35
                         <div class="item-actions">
36 36
                             <div class="item-price">
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,13 +18,16 @@
 block discarded – undo
18 18
                         <ul class="item-options">
19 19
                           <?php
20 20
                           foreach ($item->options as $param) {
21
-                              if (!$param->item_option_view || !$param->value)
22
-                                  continue;
21
+                              if (!$param->item_option_view || !$param->value) {
22
+                                                                continue;
23
+                              }
23 24
                               if ($param->item_option_type == 'select') {
24
-                                  if (empty($param->option->items[$param->value]))
25
-                                      continue;
25
+                                  if (empty($param->option->items[$param->value])) {
26
+                                                                        continue;
27
+                                  }
26 28
                                   $value = $param->option->items[$param->value]->value;
27
-                              } else {
29
+                              }
30
+                              else {
28 31
                                   $value = $param->value;
29 32
                               }
30 33
                               $paramName = $param->item_option_name;
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/EcommerceController.php 1 patch
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
                 if (!$user_id) {
29 29
                     $error = true;
30 30
                     $user = null;
31
-                } else {
31
+                }
32
+                else {
32 33
                     $user = Users\User::get($user_id);
33 34
                 }
34 35
             }
@@ -107,16 +108,19 @@  discard block
 block discarded – undo
107 108
                 $category_id = (int) $_GET['inCatalog'];
108 109
             }
109 110
             $search = $_GET['search'];
110
-        } else {
111
+        }
112
+        else {
111 113
             $search = '';
112 114
         }
113 115
 
114 116
         //sort
115 117
         if (!empty($_GET['sort'])) {
116 118
             $sort = $_GET['sort'];
117
-        } elseif (!empty($this->ecommerce->config['defaultSort'])) {
119
+        }
120
+        elseif (!empty($this->ecommerce->config['defaultSort'])) {
118 121
             $sort = $this->ecommerce->config['defaultSort'];
119
-        } else {
122
+        }
123
+        else {
120 124
             $sort = ['name' => 'asc'];
121 125
         }
122 126
 
@@ -131,10 +135,12 @@  discard block
 block discarded – undo
131 135
             }
132 136
             if ($category) {
133 137
                 $category_id = $category->id;
134
-            } else {
138
+            }
139
+            else {
135 140
                 $category_id = 0;
136 141
             }
137
-        } else {
142
+        }
143
+        else {
138 144
             $category_id = 0;
139 145
         }
140 146
         $active = $category_id;
@@ -153,7 +159,8 @@  discard block
 block discarded – undo
153 159
         if (!$category || !$category->name) {
154 160
             $bread[] = array('text' => 'Каталог');
155 161
             $this->view->setTitle('Каталог');
156
-        } else {
162
+        }
163
+        else {
157 164
             $bread[] = array('text' => 'Каталог', 'href' => '/ecommerce');
158 165
             $categoryIds = array_values(array_filter(explode('/', $category->tree_path)));
159 166
             foreach ($categoryIds as $id) {
@@ -177,7 +184,8 @@  discard block
 block discarded – undo
177 184
         //params 
178 185
         if (empty(App::$cur->ecommerce->config['filtersInLast'])) {
179 186
             $options = \Ecommerce\Item\Option::getList(['where' => ['item_option_searchable', 1], 'order' => ['weight', 'asc']]);
180
-        } else {
187
+        }
188
+        else {
181 189
             $params = $this->ecommerce->getItemsParams([
182 190
                 'parent' => $category_id,
183 191
                 'search' => trim($search),
@@ -189,7 +197,8 @@  discard block
 block discarded – undo
189 197
             }
190 198
             if ($ids) {
191 199
                 $options = \Ecommerce\Item\Option::getList(['where' => ['id', $ids, 'IN'], 'order' => ['weight', 'asc']]);
192
-            } else {
200
+            }
201
+            else {
193 202
                 $options = [];
194 203
             }
195 204
         }
@@ -198,7 +207,8 @@  discard block
 block discarded – undo
198 207
         //child categorys
199 208
         if ($category) {
200 209
             $categorys = $category->catalogs;
201
-        } else {
210
+        }
211
+        else {
202 212
             $categorys = \Ecommerce\Category::getList(['where' => ['parent_id', 0]]);
203 213
         }
204 214
 
Please login to merge, or discard this patch.
system/modules/Geography/Geography.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,8 @@
 block discarded – undo
13 13
     function init() {
14 14
         if (!empty(App::$primary->config['site']['domain'])) {
15 15
             $domain = App::$primary->config['site']['domain'];
16
-        } else {
16
+        }
17
+        else {
17 18
             $domain = implode('.', array_slice(explode('.', idn_to_utf8(INJI_DOMAIN_NAME)), -2));
18 19
         }
19 20
         $alias = str_replace($domain, '', idn_to_utf8(INJI_DOMAIN_NAME));
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/Dashboard/appAdminControllers/content/index.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
     <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', ' . \Users\User::$cur->name() : ''; ?></h4>
3 3
     <div class = "row">
4 4
       <?php
5
-      $rowSum = 0;
6
-      foreach ($sections as $section) {
7
-          if (empty($section['widget'])) {
8
-              continue;
9
-          }
5
+        $rowSum = 0;
6
+        foreach ($sections as $section) {
7
+            if (empty($section['widget'])) {
8
+                continue;
9
+            }
10 10
 
11
-          $widgetSize = !empty($section['size']) ? $section['size'] : 1;
12
-          $rowSum+=$widgetSize;
13
-          ?>
11
+            $widgetSize = !empty($section['size']) ? $section['size'] : 1;
12
+            $rowSum+=$widgetSize;
13
+            ?>
14 14
             <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div>
15 15
             <?php
16 16
             if ($rowSum >= 3) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
           }
10 10
 
11 11
           $widgetSize = !empty($section['size']) ? $section['size'] : 1;
12
-          $rowSum+=$widgetSize;
12
+          $rowSum += $widgetSize;
13 13
           ?>
14 14
             <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div>
15 15
             <?php
Please login to merge, or discard this patch.
system/modules/Widgets/appAdminControllers/content/widgetChooser.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 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
-    } elseif (isset($options['params'])) {
43
+    }
44
+    elseif (isset($options['params'])) {
44 45
         $params = $options['params'];
45 46
         if ($params) {
46 47
             echo "<h3>Параметры</h3>";
@@ -54,12 +55,14 @@  discard block
 block discarded – undo
54 55
                     }
55 56
                     echo "</select>
56 57
                         </div>";
57
-                } elseif ($param['type'] == 'textarea') {
58
+                }
59
+                elseif ($param['type'] == 'textarea') {
58 60
                     echo "<div class = 'form-group'>
59 61
                         <label>{$param['name']}</label>
60 62
                         <textarea name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control'></textarea>
61 63
                         </div>";
62
-                } else {
64
+                }
65
+                else {
63 66
                     echo "<div class = 'form-group'>
64 67
                         <label>{$param['name']}</label>
65 68
                         <input name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control' />
Please login to merge, or discard this patch.