Completed
Push — master ( 604db9...9db94b )
by Alexey
07:34
created
system/modules/Ui/objects/DataManager.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -620,8 +620,9 @@
 block discarded – undo
620 620
                         </label>
621 621
                     </li>";
622 622
           foreach ($categorys as $category) {
623
-              if ($category->parent_id == 0)
624
-                  $this->showCategory($categorys, $category);
623
+              if ($category->parent_id == 0) {
624
+                                $this->showCategory($categorys, $category);
625
+              }
625 626
           }
626 627
           ?>
627 628
         </ul>
Please login to merge, or discard this patch.
system/modules/Ui/objects/Pages.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,10 +34,11 @@
 block discarded – undo
34 34
             $this->params['page'] = 1;
35 35
             if (!empty($this->data['page'])) {
36 36
                 $this->params['page'] = (int) $this->data['page'];
37
-                if ($this->params['page'] <= 0)
38
-                    $this->params['page'] = 1;
39
-                elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit']))
40
-                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
37
+                if ($this->params['page'] <= 0) {
38
+                                    $this->params['page'] = 1;
39
+                } elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) {
40
+                                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
41
+                }
41 42
             }
42 43
 
43 44
             $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit'];
Please login to merge, or discard this patch.
system/modules/Ui/widgets/Pages/pages.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
   for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
8 8
       if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
9 9
           echo '<li ';
10
-          if ($pagesInstance->params['page'] == $i)
11
-              echo 'class = "active"';
10
+          if ($pagesInstance->params['page'] == $i) {
11
+                        echo 'class = "active"';
12
+          }
12 13
           echo ">";
13 14
           $getArr['page'] = $i;
14 15
           echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
15
-      }
16
-      elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
16
+      } elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
17 17
           $getArr['page'] = round($pagesInstance->params['page'] / 2);
18 18
           echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
19 19
       } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
Please login to merge, or discard this patch.
system/modules/UserForms/UserForms.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
         if (!empty($_POST['UserForms'])) {
17 17
             foreach ($_POST['UserForms'] as $form_id => $inputs) {
18 18
                 $form = \UserForms\Form::get((int) $form_id);
19
-                if (!$form)
20
-                    continue;
19
+                if (!$form) {
20
+                                    continue;
21
+                }
21 22
                 $formRecive = new \UserForms\Recive();
22 23
                 $formRecive->user_id = (int) \Users\User::$cur->id;
23 24
                 $formRecive->form_id = (int) $form_id;
Please login to merge, or discard this patch.
system/modules/Users/Users.php 1 patch
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -189,17 +189,20 @@
 block discarded – undo
189 189
 
190 190
     function get($idn = false, $ltype = 'id')
191 191
     {
192
-        if (!$idn)
193
-            return false;
192
+        if (!$idn) {
193
+                    return false;
194
+        }
194 195
 
195
-        if (is_numeric($idn) && $ltype != 'login')
196
-            $user = Users\User::get($idn, 'id');
197
-        elseif ($ltype == 'login')
198
-            $user = Users\User::get($idn, 'login');
199
-        else
200
-            $user = Users\User::get($idn, 'mail');
201
-        if (!$user)
202
-            return array();
196
+        if (is_numeric($idn) && $ltype != 'login') {
197
+                    $user = Users\User::get($idn, 'id');
198
+        } elseif ($ltype == 'login') {
199
+                    $user = Users\User::get($idn, 'login');
200
+        } else {
201
+                    $user = Users\User::get($idn, 'mail');
202
+        }
203
+        if (!$user) {
204
+                    return array();
205
+        }
203 206
 
204 207
         return $user;
205 208
     }
Please login to merge, or discard this patch.
system/modules/Users/appAdminControllers/content/edit.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,11 @@
 block discarded – undo
42 42
                             <select class="form-control" name = 'user_role_id'>
43 43
                                 <?php
44 44
                                 foreach ($roles as $role) {
45
-                                    if ($role['role_id'] == $user->user_role_id)
46
-                                        $selected = 'selected = "selected"';
47
-                                    else
48
-                                        $selected = '';
45
+                                    if ($role['role_id'] == $user->user_role_id) {
46
+                                                                            $selected = 'selected = "selected"';
47
+                                    } else {
48
+                                                                            $selected = '';
49
+                                    }
49 50
                                     echo "<option {$selected} value = '{$role['role_id']}'>{$role['role_name']}</option>";
50 51
                                 }
51 52
                                 ?>
Please login to merge, or discard this patch.
system/modules/View/View.php 1 patch
Braces   +43 added lines, -32 removed lines patch added patch discarded remove patch
@@ -140,8 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
     private function parseRaw($source)
142 142
     {
143
-        if (!$source)
144
-            return array();
143
+        if (!$source) {
144
+                    return array();
145
+        }
145 146
 
146 147
         preg_match_all("|{([^}]+)}|", $source, $result);
147 148
         return $result[1];
@@ -327,10 +328,11 @@  discard block
 block discarded – undo
327 328
                         $this->ResolveCssHref($css, $type, $hrefs);
328 329
                         continue;
329 330
                     }
330
-                    if (strpos($css, '//') !== false)
331
-                        $href = $css;
332
-                    else
333
-                        $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css;
331
+                    if (strpos($css, '//') !== false) {
332
+                                            $href = $css;
333
+                    } else {
334
+                                            $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css;
335
+                    }
334 336
                     $hrefs[$href] = $href;
335 337
                 }
336 338
                 break;
@@ -340,10 +342,11 @@  discard block
 block discarded – undo
340 342
                         $this->ResolveCssHref($css, $type, $hrefs);
341 343
                         continue;
342 344
                     }
343
-                    if (strpos($css, '://') !== false)
344
-                        $href = $css;
345
-                    else
346
-                        $href = $this->app->templatesPath . "/{$this->template->name}/css/{$css}";
345
+                    if (strpos($css, '://') !== false) {
346
+                                            $href = $css;
347
+                    } else {
348
+                                            $href = $this->app->templatesPath . "/{$this->template->name}/css/{$css}";
349
+                    }
347 350
                     $hrefs[$href] = $href;
348 351
                 }
349 352
                 break;
@@ -353,10 +356,11 @@  discard block
 block discarded – undo
353 356
                         $this->ResolveCssHref($css, $type, $hrefs);
354 357
                         continue;
355 358
                     }
356
-                    if (strpos($css, '//') !== false)
357
-                        $href = $css;
358
-                    else
359
-                        $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css;
359
+                    if (strpos($css, '//') !== false) {
360
+                                            $href = $css;
361
+                    } else {
362
+                                            $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css;
363
+                    }
360 364
                     $hrefs[$href] = $href;
361 365
                 }
362 366
                 break;
@@ -410,8 +414,9 @@  discard block
 block discarded – undo
410 414
         $noParsedScripts = [];
411 415
         foreach ($scripts as $script) {
412 416
             if (is_string($script)) {
413
-                if (!empty($urls[$script]))
414
-                    continue;
417
+                if (!empty($urls[$script])) {
418
+                                    continue;
419
+                }
415 420
 
416 421
                 $path = $this->app->staticLoader->parsePath($script);
417 422
                 if (file_exists($path)) {
@@ -422,8 +427,9 @@  discard block
 block discarded – undo
422 427
                     $noParsedScripts[$script] = $script;
423 428
                 }
424 429
             } elseif (!empty($script['file'])) {
425
-                if (!empty($urls[$script['file']]))
426
-                    continue;
430
+                if (!empty($urls[$script['file']])) {
431
+                                    continue;
432
+                }
427 433
 
428 434
                 $path = $this->app->staticLoader->parsePath($script['file']);
429 435
                 if (file_exists($path)) {
@@ -482,12 +488,14 @@  discard block
 block discarded – undo
482 488
                         $this->genScriptArray($js, $type, $resultArray);
483 489
                         continue;
484 490
                     }
485
-                    if (strpos($js, '//') !== false)
486
-                        $href = $js;
487
-                    else
488
-                        $href = $this->getHref('js', $js);
489
-                    if (!$href)
490
-                        continue;
491
+                    if (strpos($js, '//') !== false) {
492
+                                            $href = $js;
493
+                    } else {
494
+                                            $href = $this->getHref('js', $js);
495
+                    }
496
+                    if (!$href) {
497
+                                            continue;
498
+                    }
491 499
 
492 500
                     $resultArray[] = $href;
493 501
                 }
@@ -498,10 +506,11 @@  discard block
 block discarded – undo
498 506
                         $this->genScriptArray($js, $type, $resultArray);
499 507
                         continue;
500 508
                     }
501
-                    if (strpos($js, '//') !== false)
502
-                        $href = $js;
503
-                    else
504
-                        $href = $this->app->templatesPath . "/{$this->template->name}/js/{$js}";
509
+                    if (strpos($js, '//') !== false) {
510
+                                            $href = $js;
511
+                    } else {
512
+                                            $href = $this->app->templatesPath . "/{$this->template->name}/js/{$js}";
513
+                    }
505 514
                     $resultArray[] = $href;
506 515
                 }
507 516
                 break;
@@ -517,8 +526,9 @@  discard block
 block discarded – undo
517 526
                         $asset = [];
518 527
                     }
519 528
                     $asset['file'] = $this->getHref('js', $js);
520
-                    if (!$asset['file'])
521
-                        continue;
529
+                    if (!$asset['file']) {
530
+                                            continue;
531
+                    }
522 532
                     $resultArray[] = $asset;
523 533
                 }
524 534
                 break;
@@ -568,8 +578,9 @@  discard block
 block discarded – undo
568 578
                         $paramArray = true;
569 579
                     }
570 580
                 }
571
-                if (!$paramArray)
572
-                    $lineParams = ':' . implode(':', $_params);
581
+                if (!$paramArray) {
582
+                                    $lineParams = ':' . implode(':', $_params);
583
+                }
573 584
             }
574 585
         }
575 586
         echo "<!--start:{WIDGET:{$_widgetName}{$lineParams}}-->\n";
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,13 +11,14 @@
 block discarded – undo
11 11
     '',
12 12
     ''
13 13
 ]);
14
-if (!empty($templates['app']['installed']))
14
+if (!empty($templates['app']['installed'])) {
15 15
     foreach ($templates['app']['installed'] as $template => $name) {
16 16
         $table->addRow([
17 17
             $name,
18 18
             (empty($templates['app']['current']) || $templates['app']['current'] != $template) ? '<a href = "/admin/view/setDefault/' . $template . '">Установить по умолчанию</a>' : 'Тема по умолчанию',
19 19
             '<a href = "/admin/view/editTemplate/' . $template . '">Редактировать</a>'
20 20
         ]);
21
+}
21 22
     }
22 23
 $table->draw();
23 24
 ?>
24 25
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/Widgets/appAdminControllers/WidgetsController.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@
 block discarded – undo
36 36
                     $params = json_decode($widget->widget_params, true);
37 37
                     if ($params) {
38 38
                         foreach ($params as $param) {
39
-                            if (!isset($widgetCode[$i]))
40
-                                break;
39
+                            if (!isset($widgetCode[$i])) {
40
+                                                            break;
41
+                            }
41 42
                             if ($param['type'] == 'select') {
42 43
                                 $item = $param['model']::get($widgetCode[$i++]);
43 44
                                 if ($item) {
Please login to merge, or discard this patch.