Completed
Branch master (ebb499)
by Alexey
04:15
created
system/modules/Ui/appAdminControllers/content/dataManager/view.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 ?>
36 36
 <div>
37 37
     <h3>Комментарии (<?=
38
-      \Dashboard\Comment::getCount(['where' => [
39
-              ['item_id', $item->id],
40
-              ['model', $modelName],
41
-      ]]);
42
-      ?>)</h3>
38
+        \Dashboard\Comment::getCount(['where' => [
39
+                ['item_id', $item->id],
40
+                ['model', $modelName],
41
+        ]]);
42
+        ?>)</h3>
43 43
     <?php
44 44
     foreach (\Dashboard\Comment::getList([ 'where' => [
45 45
             ['item_id', $item->id],
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 </div>
62 62
 <div>
63 63
   <?php
64
-  $form = new \Ui\Form();
65
-  $form->begin('Оставить комментарий');
66
-  $form->input('textarea', 'comment', 'Комментарий');
67
-  $form->end();
68
-  ?>
64
+    $form = new \Ui\Form();
65
+    $form->begin('Оставить комментарий');
66
+    $form->input('textarea', 'comment', 'Комментарий');
67
+    $form->end();
68
+    ?>
69 69
 </div>
70 70
 <div>
71 71
     <h1>Хронология</h1>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
       ]]);
42 42
       ?>)</h3>
43 43
     <?php
44
-    foreach (\Dashboard\Comment::getList([ 'where' => [
44
+    foreach (\Dashboard\Comment::getList(['where' => [
45 45
             ['item_id', $item->id],
46 46
             ['model', $modelName],
47 47
         ], 'order' => ['date_create', 'desc']]) as $comment) {
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm/Input/DynamicList.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@  discard block
 block discarded – undo
46 46
                             foreach ($relModels as $model) {
47 47
                                 if (empty($rels[$model->{$relation['model']::index()}])) {
48 48
                                     $model->delete();
49
-                                } else {
49
+                                }
50
+                                else {
50 51
                                     unset($rels[$model->{$relation['model']::index()}]);
51 52
                                 }
52 53
                             }
@@ -78,7 +79,8 @@  discard block
 block discarded – undo
78 79
                             foreach ($relModels as $model) {
79 80
                                 if (empty($rels[$model->pk()])) {
80 81
                                     $model->delete();
81
-                                } else {
82
+                                }
83
+                                else {
82 84
                                     $model->setParams($rels[$model->pk()]);
83 85
                                     $model->save();
84 86
                                 }
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm/Input/ChangePassword.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@
 block discarded – undo
17 17
         if (!empty($request[$this->colName]['pass']) && !empty($request[$this->colName]['pass'])) {
18 18
             if (empty($request[$this->colName]['pass'])) {
19 19
                 \Msg::add('Вы не ввели пароль в первое поле', 'danger');
20
-                return FALSE;
20
+                return false;
21 21
             }
22 22
             if (empty($request[$this->colName]['repeat'])) {
23 23
                 \Msg::add('Вы не ввели пароль во второе поле', 'danger');
24
-                return FALSE;
24
+                return false;
25 25
             }
26 26
             if ($request[$this->colName]['pass'] != $request[$this->colName]['repeat']) {
27 27
                 \Msg::add('Введенные пароли не совпадают', 'danger');
28
-                return FALSE;
28
+                return false;
29 29
             }
30 30
             $this->activeForm->model->{$this->colName} = \App::$cur->users->hashpass($request[$this->colName]['pass']);
31 31
         }
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm/Input/DynamicType.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@
 block discarded – undo
43 43
                         }
44 44
 
45 45
                         $inputOptions['values'] = $item->{$relationName}(['forSelect' => true]);
46
-                    } else {
46
+                    }
47
+                    else {
47 48
                         $inputOptions['values'] = $this->activeForm->model->{$type['relation']}(['forSelect' => true]);
48 49
                     }
49 50
                 }
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm/Input.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,8 @@  discard block
 block discarded – undo
45 45
         $colName = empty($this->colParams['col']) ? $this->colName : $this->colParams['col'];
46 46
         if (isset($request[$this->colName])) {
47 47
             $this->activeForm->model->{$colName} = $request[$this->colName];
48
-        } else {
48
+        }
49
+        else {
49 50
             $this->activeForm->model->{$colName} = 0;
50 51
             $this->activeForm->model->{$colName} = '';
51 52
         }
@@ -70,7 +71,8 @@  discard block
 block discarded – undo
70 71
             $value = '';
71 72
             if (!empty($preset['value'])) {
72 73
                 $value = $preset['value'];
73
-            } elseif (!empty($preset['userCol'])) {
74
+            }
75
+            elseif (!empty($preset['userCol'])) {
74 76
                 if (strpos($preset['userCol'], ':')) {
75 77
                     $rel = substr($preset['userCol'], 0, strpos($preset['userCol'], ':'));
76 78
                     $param = substr($preset['userCol'], strpos($preset['userCol'], ':') + 1);
Please login to merge, or discard this patch.
system/modules/Ui/objects/Tree.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             }
31 31
             $count += count($items);
32 32
             foreach ($items as $objectChild) {
33
-                $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc, $order);
33
+                $count += static::showLi($objectChild, 1, $maxDeep, $hrefFunc, $order);
34 34
             }
35 35
             ?>
36 36
         </ul>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                     echo \Html::el('li', $attributes, $item, true);
62 62
                     echo '<ul>';
63 63
                 }
64
-                $count+=static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc, $order);
64
+                $count += static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc, $order);
65 65
             }
66 66
         }
67 67
         if ($isset) {
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@  discard block
 block discarded – undo
24 24
             <?php
25 25
             if (is_string($objectRoot)) {
26 26
                 $items = $objectRoot::getList(['where' => ['parent_id', 0]]);
27
-            } else {
27
+            }
28
+            else {
28 29
                 $class = get_class($objectRoot);
29 30
                 $items = $class::getList(['where' => ['parent_id', $objectRoot->pk()], 'order' => $order]);
30 31
             }
@@ -66,7 +67,8 @@  discard block
 block discarded – undo
66 67
         }
67 68
         if ($isset) {
68 69
             echo '</ul></li>';
69
-        } else {
70
+        }
71
+        else {
70 72
             echo \Html::el('li', $attributes, $item);
71 73
         }
72 74
         return $count;
Please login to merge, or discard this patch.
system/modules/Ui/objects/Pages.php 1 patch
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,15 +30,18 @@
 block discarded – undo
30 30
             $this->params['page'] = 0;
31 31
             $this->params['pages'] = 0;
32 32
             $this->params['start'] = 0;
33
-        } else {
33
+        }
34
+        else {
34 35
             $this->params['pages'] = ceil($this->options['count'] / $this->params['limit']);
35 36
             $this->params['page'] = 1;
36 37
             if (!empty($this->data['page'])) {
37 38
                 $this->params['page'] = (int) $this->data['page'];
38
-                if ($this->params['page'] <= 0)
39
-                    $this->params['page'] = 1;
40
-                elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit']))
41
-                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
39
+                if ($this->params['page'] <= 0) {
40
+                                    $this->params['page'] = 1;
41
+                }
42
+                elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) {
43
+                                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
44
+                }
42 45
             }
43 46
 
44 47
             $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit'];
Please login to merge, or discard this patch.
modules/Ui/Extensions/Access/snippets/accessGetter/Ui_DataManager.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 return [
12 12
     'classes' => ['Ui\DataManager'],
13 13
     'get' => function($element) {
14
-$access = NULL;
14
+$access = null;
15 15
 $path = [
16 16
     'models',
17 17
     $element->modelName,
Please login to merge, or discard this patch.
system/modules/Ui/Controllers/DataManagerController.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@  discard block
 block discarded – undo
23 23
             $raw = explode(':', $item);
24 24
             $return['modelName'] = $raw[0];
25 25
             $return['model'] = $return['modelName']::get($raw[1], $return['modelName']::index(), $return['params']);
26
-        } else {
26
+        }
27
+        else {
27 28
             $return['modelName'] = $item;
28 29
             $return['model'] = null;
29 30
         }
@@ -32,7 +33,8 @@  discard block
 block discarded – undo
32 33
             $relation = $return['modelName']::getRelation($return['params']['relation']);
33 34
             if (!empty($relation['type']) && $relation['type'] == 'relModel') {
34 35
                 $return['modelName'] = $relation['relModel'];
35
-            } else {
36
+            }
37
+            else {
36 38
                 $return['modelName'] = $relation['model'];
37 39
             }
38 40
         }
@@ -131,7 +133,8 @@  discard block
 block discarded – undo
131 133
                 }
132 134
                 echo "\n";
133 135
                 $endRow = true;
134
-            } else {
136
+            }
137
+            else {
135 138
                 Ui\Table::drawRow($row);
136 139
             }
137 140
         }
@@ -220,7 +223,8 @@  discard block
 block discarded – undo
220 223
                     $actionParams = $actions[$request['action']];
221 224
                     if (!empty($actionParams['access']['groups']) && !in_array(\Users\User::$cur->group_id, $actionParams['access']['groups'])) {
222 225
                         $result->content = 'У вас нет прав доступа к операции ' . (!isset($actionParams['name']) ? $actionParams['className']::$name : $actionParams['name']);
223
-                    } else {
226
+                    }
227
+                    else {
224 228
                         try {
225 229
                             $result->successMsg = $actionParams['className']::groupAction($dataManager, $ids, $actionParams, !empty($_GET['adInfo']) ? $_GET['adInfo'] : []);
226 230
                             $result->success = true;
@@ -230,7 +234,8 @@  discard block
 block discarded – undo
230 234
                     }
231 235
                 }
232 236
             }
233
-        } else {
237
+        }
238
+        else {
234 239
             $result->content = 'У вас нет прав доступа к менеджеру ' . $request['managerName'] . ' модели ' . $request['modelName'];
235 240
         }
236 241
         $result->send();
Please login to merge, or discard this patch.