Completed
Push — master ( f0fcd7...6ac12a )
by Alexey
05:33
created
system/Inji/Module.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      * Get all posible directorys for module files
82 82
      * 
83 83
      * @param string $moduleName
84
-     * @return array
84
+     * @return string
85 85
      */
86 86
     public static function getModulePaths($moduleName)
87 87
     {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      * Get installed modules for app
132 132
      * 
133 133
      * @param \App $app
134
-     * @param boolean|\App $primary
134
+     * @param App $primary
135 135
      * @return array
136 136
      */
137 137
     public static function getInstalled($app, $primary = false)
Please login to merge, or discard this patch.
system/modules/Ui/widgets/DataManager/rowButtons.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 $buttons = [];
12 12
 foreach ($actions as $action => $actionParams) {
13 13
     if (class_exists($actionParams['className']) && $actionParams['className']::$rowAction) {
14
-        $buttons[]= $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams);
14
+        $buttons[] = $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams);
15 15
     }
16 16
 }
17 17
 echo implode(' ', $buttons);
Please login to merge, or discard this patch.
system/modules/Users/Users.php 3 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -92,6 +92,9 @@  discard block
 block discarded – undo
92 92
         }
93 93
     }
94 94
 
95
+    /**
96
+     * @param string $user_mail
97
+     */
95 98
     public function passre($user_mail)
96 99
     {
97 100
         $user = $this->get($user_mail, 'mail');
@@ -322,6 +325,9 @@  discard block
 block discarded – undo
322 325
         return $user->id;
323 326
     }
324 327
 
328
+    /**
329
+     * @param string $pass
330
+     */
325 331
     public function hashpass($pass)
326 332
     {
327 333
         return password_hash($pass, PASSWORD_DEFAULT);
@@ -359,6 +365,9 @@  discard block
 block discarded – undo
359 365
         return $return;
360 366
     }
361 367
 
368
+    /**
369
+     * @param integer $cat_id
370
+     */
362 371
     public function addUserActivity($user_id, $cat_id , $text = '')
363 372
     {
364 373
         $ua = new Users\Activity([
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -307,7 +307,7 @@
 block discarded – undo
307 307
             $to = $user_mail;
308 308
             $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
309 309
             $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass;
310
-            $text .='<br />';
310
+            $text .= '<br />';
311 311
             $text .= '<br />';
312 312
             $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://' . INJI_DOMAIN_NAME . '/users/activation/' . $user->id . '/' . $user->activation . '">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/users/activation/' . $user->id . '/' . $user->activation . '</a>';
313 313
             Tools::sendMail($from, $to, $subject, $text);
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -196,17 +196,20 @@
 block discarded – undo
196 196
      */
197 197
     public function get($idn, $ltype = 'id')
198 198
     {
199
-        if (!$idn)
200
-            return false;
199
+        if (!$idn) {
200
+                    return false;
201
+        }
201 202
 
202
-        if (is_numeric($idn) && $ltype != 'login')
203
-            $user = Users\User::get($idn, 'id');
204
-        elseif ($ltype == 'login')
205
-            $user = Users\User::get($idn, 'login');
206
-        else
207
-            $user = Users\User::get($idn, 'mail');
208
-        if (!$user)
209
-            return [];
203
+        if (is_numeric($idn) && $ltype != 'login') {
204
+                    $user = Users\User::get($idn, 'id');
205
+        } elseif ($ltype == 'login') {
206
+                    $user = Users\User::get($idn, 'login');
207
+        } else {
208
+                    $user = Users\User::get($idn, 'mail');
209
+        }
210
+        if (!$user) {
211
+                    return [];
212
+        }
210 213
 
211 214
         return $user;
212 215
     }
Please login to merge, or discard this patch.
system/modules/Money/Money.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if (empty($blocks[$block->wallet->currency_id])) {
103 103
                 $blocks[$block->wallet->currency_id] = $block->amount;
104 104
             } else {
105
-                $blocks[$block->wallet->currency_id]+= $block->amount;
105
+                $blocks[$block->wallet->currency_id] += $block->amount;
106 106
             }
107 107
         }
108 108
         return $blocks;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $rootUser = $rootUser ? $rootUser : \Users\User::$cur;
167 167
         $reward = \Money\Reward::get($reward_id);
168 168
         $reward->checkBlocked();
169
-        $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id ]]);
169
+        $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]);
170 170
         if ($reward_count >= $reward->quantity && $reward->quantity)
171 171
             return false;
172 172
         $types = $this->getSnippets('rewardType');
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]);
188 188
                 $amount = 0;
189 189
                 foreach ($recives as $recive) {
190
-                    $amount+=$recive->amount;
190
+                    $amount += $recive->amount;
191 191
                 }
192 192
                 if ($amount >= $reward->peruser) {
193 193
                     continue;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,8 +167,9 @@
 block discarded – undo
167 167
         $reward = \Money\Reward::get($reward_id);
168 168
         $reward->checkBlocked();
169 169
         $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id ]]);
170
-        if ($reward_count >= $reward->quantity && $reward->quantity)
171
-            return false;
170
+        if ($reward_count >= $reward->quantity && $reward->quantity) {
171
+                    return false;
172
+        }
172 173
         $types = $this->getSnippets('rewardType');
173 174
         foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) {
174 175
             $user = $rootUser;
Please login to merge, or discard this patch.
system/modules/UserForms/widgets/userForm.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,29 +14,29 @@
 block discarded – undo
14 14
 ?>
15 15
 <form method = "POST" action = "">
16 16
   <?php
17
-  if ($form->description) {
18
-      echo "<p class = 'text-center'>{$form->description}</p>";
19
-  }
20
-  foreach ($form->inputs(['order' => ['weight']]) as $input) {
21
-      switch ($input->type) {
22
-          case 'text':
17
+    if ($form->description) {
18
+        echo "<p class = 'text-center'>{$form->description}</p>";
19
+    }
20
+    foreach ($form->inputs(['order' => ['weight']]) as $input) {
21
+        switch ($input->type) {
22
+            case 'text':
23 23
               ?>
24 24
               <div class ='form-group'>
25 25
                 <label><?= $input->label; ?></label>
26 26
                 <input class ='form-control' type ='text' name ='UserForms[<?= (int) $form_id; ?>][input<?= $input->id; ?>]' <?= $input->required ? 'required' : ''; ?> />
27 27
               </div>
28 28
               <?php
29
-              break;
30
-          case 'textarea':
29
+                break;
30
+            case 'textarea':
31 31
               ?>
32 32
               <div class ='form-group'>
33 33
                 <label><?= $input->label; ?></label>
34 34
                 <textarea class ='form-control' name ='UserForms[<?= (int) $form_id; ?>][input<?= $input->id; ?>]' <?= $input->required ? 'required' : ''; ?> /></textarea>
35 35
               </div>
36 36
               <?php
37
-              break;
38
-      }
39
-  }
40
-  ?>
37
+                break;
38
+        }
39
+    }
40
+    ?>
41 41
   <button class = 'btn btn-success btn-block'>Отправить</button>
42 42
 </form>
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/UserAdds/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             'map' => [
45 45
                 ['name', 'type'],
46 46
                 ['required', 'save'],
47
-                [ 'userfield']
47
+                ['userfield']
48 48
             ]
49 49
         ]
50 50
     ];
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Delivery/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             'map' => [
45 45
                 ['name', 'type'],
46 46
                 ['required', 'save'],
47
-                [ 'userfield']
47
+                ['userfield']
48 48
             ]
49 49
         ]
50 50
     ];
Please login to merge, or discard this patch.
system/modules/Ecommerce/widgets/cart/delivery.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -2,24 +2,24 @@
 block discarded – undo
2 2
   <div class="col-md-4">
3 3
     <ul class="nav nav-pills nav-stacked">
4 4
       <?php
5
-      $hiddenId = Tools::randomString();
6
-      foreach ($deliverys as $delivery) {
7
-          if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || $delivery->id == $cartDelivery->id) {
8
-              $checked = 'checked';
9
-          } else {
10
-              $checked = '';
11
-          }
12
-          echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">';
13
-          echo $delivery->name;
14
-          echo '</a></li>';
15
-      }
16
-      $form->input('hidden', "delivery", '', [
17
-          'value' => $cartDelivery->id,
18
-          'attributes' => [
19
-              'id' => $hiddenId
20
-          ],
21
-      ]);
22
-      ?>
5
+        $hiddenId = Tools::randomString();
6
+        foreach ($deliverys as $delivery) {
7
+            if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || $delivery->id == $cartDelivery->id) {
8
+                $checked = 'checked';
9
+            } else {
10
+                $checked = '';
11
+            }
12
+            echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">';
13
+            echo $delivery->name;
14
+            echo '</a></li>';
15
+        }
16
+        $form->input('hidden', "delivery", '', [
17
+            'value' => $cartDelivery->id,
18
+            'attributes' => [
19
+                'id' => $hiddenId
20
+            ],
21
+        ]);
22
+        ?>
23 23
     </ul>
24 24
   </div>
25 25
   <div class="col-md-8">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@
 block discarded – undo
27 27
     <?php
28 28
     $delivery = $cartDelivery;
29 29
     if ($delivery->price_text || $delivery->price) {
30
-        echo "<div>Стоимость доставки: <b>" . ($delivery->price_text ? $delivery->price_text : ( $delivery->price . ' ' . ($delivery->currency ? $delivery->currency->acronym() : 'руб.') )) . '</b></div>';
30
+        echo "<div>Стоимость доставки: <b>" . ($delivery->price_text ? $delivery->price_text : ($delivery->price . ' ' . ($delivery->currency ? $delivery->currency->acronym() : 'руб.'))) . '</b></div>';
31 31
     }
32 32
     if ((float) $delivery->max_cart_price) {
33 33
         echo '<div>При заказе товаров на сумму от ' . $delivery->max_cart_price . ' руб - бесплатно</div>';
34 34
     }
35 35
     echo $delivery->info;
36
-    if($delivery->fields) {
36
+    if ($delivery->fields) {
37 37
         echo '<hr \>';
38 38
         foreach ($delivery->fields as $field) {
39 39
             $form->input($field->type, "deliveryFields[{$field->id}]", $field->name, ['required' => $field->required]);
Please login to merge, or discard this patch.
system/modules/Ecommerce/widgets/cart/fields.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <fieldset>
2 2
   <?php
3
-  if (\Users\User::$cur->id) {
4
-      $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]);
5
-      $values = [];
6
-      foreach ($userAdds as $userAdd) {
7
-          $values[$userAdd->id] = $userAdd->values(['array' => true]);
8
-      }
9
-      if ($userAdds) {
10
-          $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]);
11
-          echo '<hr />';
12
-      }
13
-      ?>
3
+    if (\Users\User::$cur->id) {
4
+        $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]);
5
+        $values = [];
6
+        foreach ($userAdds as $userAdd) {
7
+            $values[$userAdd->id] = $userAdd->values(['array' => true]);
8
+        }
9
+        if ($userAdds) {
10
+            $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]);
11
+            echo '<hr />';
12
+        }
13
+        ?>
14 14
       <script>
15 15
           var userAddsValues = <?= json_encode($values); ?>;
16 16
           inji.onLoad(function () {
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
           })
25 25
       </script>
26 26
       <?php
27
-  }
28
-  foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) {
29
-      $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]);
30
-  }
31
-  ?>
27
+    }
28
+    foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) {
29
+        $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]);
30
+    }
31
+    ?>
32 32
 </fieldset>
33 33
\ No newline at end of file
Please login to merge, or discard this patch.