Completed
Push — master ( 0afdc4...0e57e6 )
by Alexey
04:27
created
system/modules/Menu/models/Menu.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -13,52 +13,52 @@  discard block
 block discarded – undo
13 13
 
14 14
 class Menu extends \Model {
15 15
 
16
-  public static $objectName = 'Меню';
17
-  public static $labels = [
18
-      'name' => 'Название',
19
-      'code' => 'Алиас',
20
-      'item' => 'Пункты меню',
21
-      'group_id' => 'Группа пользователей',
22
-  ];
23
-  public static $storage = ['type' => 'moduleConfig'];
24
-  public static $cols = [
25
-      'name' => ['type' => 'text'],
26
-      'code' => ['type' => 'text'],
27
-      'item' => ['type' => 'dataManager', 'relation' => 'items'],
28
-      'group_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'group']
29
-  ];
30
-  public static $dataManagers = [
31
-      'manager' => [
32
-          'options' => [
33
-              'access' => [
34
-                  'groups' => [
35
-                      3
36
-                  ]
37
-              ]
38
-          ],
39
-          'cols' => [
40
-              'name', 'code', 'item', 'group_id'
41
-          ]
42
-      ]
43
-  ];
44
-  public static $forms = [
45
-      'manager' => [
46
-          'options' => [
47
-              'access' => [
48
-                  'groups' => [
49
-                      3
50
-                  ]
51
-              ]
52
-          ],
53
-          'map' => [
54
-              ['name', 'code'],
55
-              ['group_id'],
56
-              ['item']
57
-          ]
58
-      ]
59
-  ];
16
+    public static $objectName = 'Меню';
17
+    public static $labels = [
18
+        'name' => 'Название',
19
+        'code' => 'Алиас',
20
+        'item' => 'Пункты меню',
21
+        'group_id' => 'Группа пользователей',
22
+    ];
23
+    public static $storage = ['type' => 'moduleConfig'];
24
+    public static $cols = [
25
+        'name' => ['type' => 'text'],
26
+        'code' => ['type' => 'text'],
27
+        'item' => ['type' => 'dataManager', 'relation' => 'items'],
28
+        'group_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'group']
29
+    ];
30
+    public static $dataManagers = [
31
+        'manager' => [
32
+            'options' => [
33
+                'access' => [
34
+                    'groups' => [
35
+                        3
36
+                    ]
37
+                ]
38
+            ],
39
+            'cols' => [
40
+                'name', 'code', 'item', 'group_id'
41
+            ]
42
+        ]
43
+    ];
44
+    public static $forms = [
45
+        'manager' => [
46
+            'options' => [
47
+                'access' => [
48
+                    'groups' => [
49
+                        3
50
+                    ]
51
+                ]
52
+            ],
53
+            'map' => [
54
+                ['name', 'code'],
55
+                ['group_id'],
56
+                ['item']
57
+            ]
58
+        ]
59
+    ];
60 60
 
61
-  public static function relations() {
61
+    public static function relations() {
62 62
     return [
63 63
         'items' => [
64 64
             'type' => 'many',
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
             'model' => 'Users\Group'
71 71
         ]
72 72
     ];
73
-  }
73
+    }
74 74
 
75
-  public static function index() {
75
+    public static function index() {
76 76
     return 'id';
77
-  }
77
+    }
78 78
 
79 79
 }
Please login to merge, or discard this patch.
system/modules/Ui/appAdminControllers/content/dataManager/view.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -5,33 +5,33 @@  discard block
 block discarded – undo
5 5
 $formParams = ['formName' => 'manager'];
6 6
 $aform = new \Ui\ActiveForm($item, $formParams['formName']);
7 7
 if ($aform->checkAccess()) {
8
-  $table->addButton([
9
-      'text' => 'Редактировать',
10
-      'onclick' => 'inji.Ui.forms.popUp("' . addcslashes($modelName, '\\') . ':' . $item->pk() . '",' . json_encode($formParams) . ');',
11
-  ]);
8
+    $table->addButton([
9
+        'text' => 'Редактировать',
10
+        'onclick' => 'inji.Ui.forms.popUp("' . addcslashes($modelName, '\\') . ':' . $item->pk() . '",' . json_encode($formParams) . ');',
11
+    ]);
12 12
 }
13 13
 $row = [];
14 14
 $cols = !empty($modelName::$views['manager']['cols']) ? $modelName::$views['manager']['cols'] : array_keys($modelName::$cols);
15 15
 foreach ($cols as $colName) {
16
-  $modelName = get_class($item);
17
-  $colInfo = $modelName::getColInfo($colName);
18
-  $type = !empty($colInfo['colParams']['type']) ? $colInfo['colParams']['type'] : 'string';
19
-  if ($type != 'dataManager') {
16
+    $modelName = get_class($item);
17
+    $colInfo = $modelName::getColInfo($colName);
18
+    $type = !empty($colInfo['colParams']['type']) ? $colInfo['colParams']['type'] : 'string';
19
+    if ($type != 'dataManager') {
20 20
     $table->addRow([
21 21
         !empty($modelName::$labels[$colName]) ? $modelName::$labels[$colName] : $colName,
22 22
         \Model::resloveTypeValue($item, $colName, true)
23 23
     ]);
24
-  }
24
+    }
25 25
 }
26 26
 $table->draw();
27 27
 $form = new \Ui\Form();
28 28
 $relations = $modelName::relations();
29 29
 foreach ($cols as $colName) {
30
-  $colInfo = $modelName::getColInfo($colName);
31
-  if ($colInfo['colParams']['type'] == 'dataManager') {
30
+    $colInfo = $modelName::getColInfo($colName);
31
+    if ($colInfo['colParams']['type'] == 'dataManager') {
32 32
     $dataManager = new \Ui\DataManager($relations[$colInfo['colParams']['relation']]['model']);
33 33
     $dataManager->draw(['relation' => $colInfo['colParams']['relation']], $item);
34
-  }
34
+    }
35 35
 }
36 36
 ?>
37 37
 <div>
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
     ]]);
43 43
     ?>)</h3>
44 44
   <?php
45
-  foreach (\Dashboard\Comment::getList([ 'where' => [
46
-          ['item_id', $item->id],
47
-          ['model', $modelName],
48
-      ], 'order' => ['date_create', 'desc']]) as $comment) {
45
+    foreach (\Dashboard\Comment::getList([ 'where' => [
46
+            ['item_id', $item->id],
47
+            ['model', $modelName],
48
+        ], 'order' => ['date_create', 'desc']]) as $comment) {
49 49
     ?>
50 50
     <div class="row">
51 51
       <div class="col-sm-3" style="max-width: 300px;">
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
       </div>
58 58
     </div>
59 59
     <?php
60
-  }
61
-  ?>
60
+    }
61
+    ?>
62 62
 </div>
63 63
 <div>
64 64
   <?php
65
-  $form = new \Ui\Form();
66
-  $form->begin();
67
-  $form->input('textarea', 'comment', 'Комментарий');
68
-  $form->end();
69
-  ?>
65
+    $form = new \Ui\Form();
66
+    $form->begin();
67
+    $form->input('textarea', 'comment', 'Комментарий');
68
+    $form->end();
69
+    ?>
70 70
 </div>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 if ($aform->checkAccess()) {
8 8
   $table->addButton([
9 9
       'text' => 'Редактировать',
10
-      'onclick' => 'inji.Ui.forms.popUp("' . addcslashes($modelName, '\\') . ':' . $item->pk() . '",' . json_encode($formParams) . ');',
10
+      'onclick' => 'inji.Ui.forms.popUp("'.addcslashes($modelName, '\\').':'.$item->pk().'",'.json_encode($formParams).');',
11 11
   ]);
12 12
 }
13 13
 $row = [];
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     ]]);
43 43
     ?>)</h3>
44 44
   <?php
45
-  foreach (\Dashboard\Comment::getList([ 'where' => [
45
+  foreach (\Dashboard\Comment::getList(['where' => [
46 46
           ['item_id', $item->id],
47 47
           ['model', $modelName],
48 48
       ], 'order' => ['date_create', 'desc']]) as $comment) {
Please login to merge, or discard this patch.
system/modules/Ui/objects/DataManager/Action/Open.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             'formName' => !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager',
27 27
             'redirectUrl' => !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : str_replace('\\', '/', $dataManager->modelName)
28 28
         ];
29
-        return "<a href='/admin/{$item->genViewLink()}?" . http_build_query($query) . "'><i class='glyphicon glyphicon-eye-open'></i></a>";
29
+        return "<a href='/admin/{$item->genViewLink()}?".http_build_query($query)."'><i class='glyphicon glyphicon-eye-open'></i></a>";
30 30
     }
31 31
 
32 32
 }
Please login to merge, or discard this patch.
system/modules/Ui/Controllers/DataManagerController.php 2 patches
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -10,31 +10,31 @@  discard block
 block discarded – undo
10 10
  */
11 11
 class DataManagerController extends Controller {
12 12
 
13
-  public function parseRequest() {
13
+    public function parseRequest() {
14 14
     $return = [];
15 15
     $return['params'] = UserRequest::get('params', 'array', []);
16 16
 
17 17
     $item = UserRequest::get('modelName', 'string', '');
18 18
     if (!$item) {
19
-      $item = UserRequest::get('item', 'string', '');
19
+        $item = UserRequest::get('item', 'string', '');
20 20
     }
21 21
 
22 22
     if (strpos($item, ':')) {
23
-      $raw = explode(':', $item);
24
-      $return['modelName'] = $raw[0];
25
-      $return['model'] = $return['modelName']::get($raw[1], $return['modelName']::index(), $return['params']);
23
+        $raw = explode(':', $item);
24
+        $return['modelName'] = $raw[0];
25
+        $return['model'] = $return['modelName']::get($raw[1], $return['modelName']::index(), $return['params']);
26 26
     } else {
27
-      $return['modelName'] = $item;
28
-      $return['model'] = null;
27
+        $return['modelName'] = $item;
28
+        $return['model'] = null;
29 29
     }
30 30
 
31 31
     if (!empty($return['params']['relation'])) {
32
-      $relation = $return['modelName']::getRelation($return['params']['relation']);
33
-      if (!empty($relation['type']) && $relation['type'] == 'relModel') {
32
+        $relation = $return['modelName']::getRelation($return['params']['relation']);
33
+        if (!empty($relation['type']) && $relation['type'] == 'relModel') {
34 34
         $return['modelName'] = $relation['relModel'];
35
-      } else {
35
+        } else {
36 36
         $return['modelName'] = $relation['model'];
37
-      }
37
+        }
38 38
     }
39 39
     $return['params']['filters'] = UserRequest::get('filters', 'array', []);
40 40
     $return['params']['sortered'] = UserRequest::get('sortered', 'array', []);
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 
55 55
     $return['managerName'] = UserRequest::get('managerName', 'string', 'manager');
56 56
     if (!$return['managerName']) {
57
-      $return['managerName'] = 'manager';
57
+        $return['managerName'] = 'manager';
58 58
     }
59 59
 
60 60
     return $return;
61
-  }
61
+    }
62 62
 
63
-  public function indexAction() {
63
+    public function indexAction() {
64 64
     $result = new Server\Result();
65 65
 
66 66
     ob_start();
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
     ob_end_clean();
76 76
 
77 77
     $result->send();
78
-  }
78
+    }
79 79
 
80
-  public function loadRowsAction() {
80
+    public function loadRowsAction() {
81 81
     $result = new Server\Result();
82 82
     $result->content = [];
83 83
 
@@ -88,55 +88,55 @@  discard block
 block discarded – undo
88 88
     $dataManager = new Ui\DataManager($request['modelName'], $request['managerName']);
89 89
     if ($request['download']) {
90 90
 
91
-      ini_set('memory_limit', '2000M');
92
-      set_time_limit(0);
91
+        ini_set('memory_limit', '2000M');
92
+        set_time_limit(0);
93 93
 
94
-      $request['params']['all'] = true;
95
-      $request['params']['download'] = true;
96
-      ob_end_clean();
97
-      header('Content-Encoding: UTF-8');
98
-      header("Content-Type: text/csv");
99
-      header("Content-Disposition: attachment; filename=" . $request['modelName']::$objectName . '.csv');
100
-      echo "\xEF\xBB\xBF"; // UTF-8 BOM
94
+        $request['params']['all'] = true;
95
+        $request['params']['download'] = true;
96
+        ob_end_clean();
97
+        header('Content-Encoding: UTF-8');
98
+        header("Content-Type: text/csv");
99
+        header("Content-Disposition: attachment; filename=" . $request['modelName']::$objectName . '.csv');
100
+        echo "\xEF\xBB\xBF"; // UTF-8 BOM
101 101
 
102 102
 
103
-      $cols = $dataManager->getCols();
104
-      $cols = array_slice($cols, 1);
105
-      $endRow = true;
106
-      foreach ($cols as $colName => $options) {
103
+        $cols = $dataManager->getCols();
104
+        $cols = array_slice($cols, 1);
105
+        $endRow = true;
106
+        foreach ($cols as $colName => $options) {
107 107
         if (!$endRow) {
108
-          echo ";";
108
+            echo ";";
109 109
         }
110 110
         $endRow = false;
111 111
         echo '"' . $options['label'] . '"';
112
-      }
113
-      echo "\n";
114
-      $endRow = true;
112
+        }
113
+        echo "\n";
114
+        $endRow = true;
115 115
     }
116 116
     if (!$request['params']['all']) {
117
-      $pages = $dataManager->getPages($request['params'], $request['model']);
118
-      $request['params']['page'] = !empty($pages->params['page']) ? $pages->params['page'] : $dataManager->page;
119
-      $request['params']['limit'] = !empty($pages->params['limit']) ? $pages->params['limit'] : $dataManager->limit;
117
+        $pages = $dataManager->getPages($request['params'], $request['model']);
118
+        $request['params']['page'] = !empty($pages->params['page']) ? $pages->params['page'] : $dataManager->page;
119
+        $request['params']['limit'] = !empty($pages->params['limit']) ? $pages->params['limit'] : $dataManager->limit;
120 120
     }
121 121
     $rows = $dataManager->getRows($request['params'], $request['model']);
122 122
     foreach ($rows as $row) {
123
-      if ($request['download']) {
123
+        if ($request['download']) {
124 124
         $row = array_slice($row, 1, -1);
125 125
         foreach ($row as $col) {
126
-          if (!$endRow) {
126
+            if (!$endRow) {
127 127
             echo ";";
128
-          }
129
-          $endRow = false;
130
-          echo '"' . str_replace(["\n", '"'], ['“'], $col) . '"';
128
+            }
129
+            $endRow = false;
130
+            echo '"' . str_replace(["\n", '"'], ['“'], $col) . '"';
131 131
         }
132 132
         echo "\n";
133 133
         $endRow = true;
134
-      } else {
134
+        } else {
135 135
         Ui\Table::drawRow($row);
136
-      }
136
+        }
137 137
     }
138 138
     if ($request['download']) {
139
-      exit();
139
+        exit();
140 140
     }
141 141
 
142 142
     $result->content['rows'] = ob_get_contents();
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
     $result->content['pages'] = '';
146 146
 
147 147
     if (isset($pages) && $pages) {
148
-      if ($pages) {
148
+        if ($pages) {
149 149
         $pages->draw();
150 150
         echo '<div style="background:#fff;">записей: <b>' . $pages->options['count'] . '</b>. страница <b>' . $pages->params['page'] . '</b> из <b>' . $pages->params['pages'] . '</b></div>';
151
-      }
152
-      $result->content['pages'] = ob_get_contents();
153
-      ob_end_clean();
151
+        }
152
+        $result->content['pages'] = ob_get_contents();
153
+        ob_end_clean();
154 154
     }
155 155
     $result->send();
156
-  }
156
+    }
157 157
 
158
-  public function loadCategorysAction() {
158
+    public function loadCategorysAction() {
159 159
     $result = new Server\Result();
160 160
 
161 161
     ob_start();
@@ -169,88 +169,88 @@  discard block
 block discarded – undo
169 169
     ob_end_clean();
170 170
 
171 171
     $result->send();
172
-  }
172
+    }
173 173
 
174
-  public function delRowAction() {
174
+    public function delRowAction() {
175 175
 
176 176
     $request = $this->parseRequest();
177 177
 
178 178
     $dataManager = new Ui\DataManager($request['modelName'], $request['managerName']);
179 179
 
180 180
     if ($dataManager->checkAccess()) {
181
-      $model = $request['modelName']::get($request['key'], $request['modelName']::index(), $request['params']);
182
-      if ($model) {
181
+        $model = $request['modelName']::get($request['key'], $request['modelName']::index(), $request['params']);
182
+        if ($model) {
183 183
         $model->delete($request['params']);
184
-      }
184
+        }
185 185
     }
186 186
     $result = new Server\Result();
187 187
     $result->successMsg = empty($request['silence']) ? 'Запись удалена' : '';
188 188
     $result->send();
189
-  }
189
+    }
190 190
 
191
-  public function updateRowAction() {
191
+    public function updateRowAction() {
192 192
 
193 193
     $request = $this->parseRequest();
194 194
 
195 195
     $dataManager = new Ui\DataManager($request['modelName'], $request['managerName']);
196 196
 
197 197
     if ($dataManager->checkAccess()) {
198
-      $model = $request['modelName']::get($request['key'], $request['modelName']::index(), $request['params']);
199
-      if ($model) {
198
+        $model = $request['modelName']::get($request['key'], $request['modelName']::index(), $request['params']);
199
+        if ($model) {
200 200
         $model->{$request['col']} = $request['col_value'];
201 201
         $model->save($request['params']);
202
-      }
202
+        }
203 203
     }
204 204
     $result = new Server\Result();
205 205
     $result->successMsg = empty($request['silence']) ? 'Запись Обновлена' : '';
206 206
     $result->send();
207
-  }
207
+    }
208 208
 
209
-  public function groupActionAction() {
209
+    public function groupActionAction() {
210 210
     $request = $this->parseRequest();
211 211
     $dataManager = new Ui\DataManager($request['modelName'], $request['managerName']);
212 212
     $result = new Server\Result();
213 213
     $result->success = false;
214 214
     $result->content = 'Не удалось выполнить операцию';
215 215
     if ($dataManager->checkAccess()) {
216
-      $ids = trim($request['ids'], ' ,');
217
-      if ($request['action'] && $ids) {
216
+        $ids = trim($request['ids'], ' ,');
217
+        if ($request['action'] && $ids) {
218 218
         $actions = $dataManager->getActions();
219 219
         if (!empty($actions[$request['action']])) {
220
-          $actionParams = $actions[$request['action']];
221
-          if (!empty($actionParams['access']['groups']) && !in_array(\Users\User::$cur->group_id, $actionParams['access']['groups'])) {
220
+            $actionParams = $actions[$request['action']];
221
+            if (!empty($actionParams['access']['groups']) && !in_array(\Users\User::$cur->group_id, $actionParams['access']['groups'])) {
222 222
             $result->content = 'У вас нет прав доступа к операции ' . (!isset($actionParams['name']) ? $actionParams['className']::$name : $actionParams['name']);
223
-          } else {
223
+            } else {
224 224
             try {
225
-              $result->successMsg = $actionParams['className']::groupAction($dataManager, $ids, $actionParams, !empty($_GET['adInfo']) ? $_GET['adInfo'] : []);
226
-              $result->success = true;
225
+                $result->successMsg = $actionParams['className']::groupAction($dataManager, $ids, $actionParams, !empty($_GET['adInfo']) ? $_GET['adInfo'] : []);
226
+                $result->success = true;
227 227
             } catch (\Exception $e) {
228
-              $result->content = $e->getMessage();
228
+                $result->content = $e->getMessage();
229 229
             }
230
-          }
230
+            }
231
+        }
231 232
         }
232
-      }
233 233
     } else {
234
-      $result->content = 'У вас нет прав доступа к менеджеру ' . $request['managerName'] . ' модели ' . $request['modelName'];
234
+        $result->content = 'У вас нет прав доступа к менеджеру ' . $request['managerName'] . ' модели ' . $request['modelName'];
235 235
     }
236 236
     $result->send();
237
-  }
237
+    }
238 238
 
239
-  public function delCategoryAction() {
239
+    public function delCategoryAction() {
240 240
 
241 241
     $request = $this->parseRequest();
242 242
 
243 243
     $dataManager = new Ui\DataManager($request['modelName'], $request['managerName']);
244 244
 
245 245
     if ($dataManager->checkAccess() && !empty($dataManager->managerOptions['categorys'])) {
246
-      $categoryModel = $dataManager->managerOptions['categorys']['model'];
247
-      $model = $categoryModel::get($request['key'], $categoryModel::index(), $request['params']);
248
-      if ($model) {
246
+        $categoryModel = $dataManager->managerOptions['categorys']['model'];
247
+        $model = $categoryModel::get($request['key'], $categoryModel::index(), $request['params']);
248
+        if ($model) {
249 249
         $model->delete($request['params']);
250
-      }
250
+        }
251 251
     }
252 252
     $result = new Server\Result();
253 253
     $result->send();
254
-  }
254
+    }
255 255
 
256 256
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
       ob_end_clean();
97 97
       header('Content-Encoding: UTF-8');
98 98
       header("Content-Type: text/csv");
99
-      header("Content-Disposition: attachment; filename=" . $request['modelName']::$objectName . '.csv');
99
+      header("Content-Disposition: attachment; filename=".$request['modelName']::$objectName.'.csv');
100 100
       echo "\xEF\xBB\xBF"; // UTF-8 BOM
101 101
 
102 102
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
           echo ";";
109 109
         }
110 110
         $endRow = false;
111
-        echo '"' . $options['label'] . '"';
111
+        echo '"'.$options['label'].'"';
112 112
       }
113 113
       echo "\n";
114 114
       $endRow = true;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             echo ";";
128 128
           }
129 129
           $endRow = false;
130
-          echo '"' . str_replace(["\n", '"'], ['“'], $col) . '"';
130
+          echo '"'.str_replace(["\n", '"'], ['“'], $col).'"';
131 131
         }
132 132
         echo "\n";
133 133
         $endRow = true;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     if (isset($pages) && $pages) {
148 148
       if ($pages) {
149 149
         $pages->draw();
150
-        echo '<div style="background:#fff;">записей: <b>' . $pages->options['count'] . '</b>. страница <b>' . $pages->params['page'] . '</b> из <b>' . $pages->params['pages'] . '</b></div>';
150
+        echo '<div style="background:#fff;">записей: <b>'.$pages->options['count'].'</b>. страница <b>'.$pages->params['page'].'</b> из <b>'.$pages->params['pages'].'</b></div>';
151 151
       }
152 152
       $result->content['pages'] = ob_get_contents();
153 153
       ob_end_clean();
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         if (!empty($actions[$request['action']])) {
220 220
           $actionParams = $actions[$request['action']];
221 221
           if (!empty($actionParams['access']['groups']) && !in_array(\Users\User::$cur->group_id, $actionParams['access']['groups'])) {
222
-            $result->content = 'У вас нет прав доступа к операции ' . (!isset($actionParams['name']) ? $actionParams['className']::$name : $actionParams['name']);
222
+            $result->content = 'У вас нет прав доступа к операции '.(!isset($actionParams['name']) ? $actionParams['className']::$name : $actionParams['name']);
223 223
           } else {
224 224
             try {
225 225
               $result->successMsg = $actionParams['className']::groupAction($dataManager, $ids, $actionParams, !empty($_GET['adInfo']) ? $_GET['adInfo'] : []);
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         }
232 232
       }
233 233
     } else {
234
-      $result->content = 'У вас нет прав доступа к менеджеру ' . $request['managerName'] . ' модели ' . $request['modelName'];
234
+      $result->content = 'У вас нет прав доступа к менеджеру '.$request['managerName'].' модели '.$request['modelName'];
235 235
     }
236 236
     $result->send();
237 237
   }
Please login to merge, or discard this patch.
system/modules/Ui/widgets/Form/dateTime.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@
 block discarded – undo
9 9
     'value' => !empty($options['value']) ? addcslashes($options['value'], "'") : (!empty($form->userDataTree[$name]) ? addcslashes($form->userDataTree[$name], "'") : '')
10 10
 ];
11 11
 if (!empty($options['disabled'])) {
12
-  $attributes['disabled'] = 'disabled';
12
+    $attributes['disabled'] = 'disabled';
13 13
 }
14 14
 if (!empty($options['placeholder'])) {
15
-  $attributes['placeholder'] = $options['placeholder'];
15
+    $attributes['placeholder'] = $options['placeholder'];
16 16
 }
17 17
 if (!empty($options['checked'])) {
18
-  $attributes['checked'] = 'checked';
18
+    $attributes['checked'] = 'checked';
19 19
 }
20 20
 if (!empty($options['attributes'])) {
21
-  $attributes = array_merge($attributes, $options['attributes']);
21
+    $attributes = array_merge($attributes, $options['attributes']);
22 22
 }
23 23
 echo Html::el('input', $attributes, '', null);
24 24
 echo!empty($options['helpText']) ? "<div class='help-block'>{$options['helpText']}</div>" : '';
Please login to merge, or discard this patch.
system/program/admin/templates/default/widgets/sidebar.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
     </li>
8 8
     <?php
9 9
     if (class_exists('Users\User')) {
10
-      App::$cur->ui;
11
-      ?>
10
+        App::$cur->ui;
11
+        ?>
12 12
       <hr />
13 13
       <div class="row userWidget">
14 14
         <div class="col-xs-4">
@@ -29,23 +29,23 @@  discard block
 block discarded – undo
29 29
         <a href = "/admin">Панель управления</a>
30 30
       </li>
31 31
       <?php
32
-      $where[] = ['group_id', Users\User::$cur->group_id];
33
-      if (Users\User::$cur->group_id == 3) {
32
+        $where[] = ['group_id', Users\User::$cur->group_id];
33
+        if (Users\User::$cur->group_id == 3) {
34 34
         $where[] = ['group_id', 0, '=', 'OR'];
35
-      }
36
-      $menu = Menu\Menu::get([['code', 'sidebarMenu'], $where]);
37
-      foreach ($menu->items(['where' => ['parent_id', 0], 'order' => ['weight', 'asc']]) as $item) {
35
+        }
36
+        $menu = Menu\Menu::get([['code', 'sidebarMenu'], $where]);
37
+        foreach ($menu->items(['where' => ['parent_id', 0], 'order' => ['weight', 'asc']]) as $item) {
38 38
         echo "<li><a href = '{$item->href}'>{$item->name}</a>";
39 39
         $childItems = Menu\Item::getList(['where' => ['parent_id', $item->id]]);
40 40
         if ($childItems) {
41
-          echo "<ul>";
42
-          foreach ($childItems as $item) {
41
+            echo "<ul>";
42
+            foreach ($childItems as $item) {
43 43
             echo "<li><a href = '{$item->href}'>{$item->name}</a>";
44
-          }
45
-          echo "</ul>";
44
+            }
45
+            echo "</ul>";
46 46
         }
47 47
         echo "</li>";
48
-      }
48
+        }
49 49
     }
50 50
     ?>
51 51
     <li>
Please login to merge, or discard this patch.
system/program/admin/objects/adminController.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -10,55 +10,55 @@
 block discarded – undo
10 10
  */
11 11
 class adminController extends Controller {
12 12
 
13
-  public function indexAction() {
13
+    public function indexAction() {
14 14
     $args = func_get_args();
15 15
     call_user_func_array([$this, 'dataManagerAction'], $args);
16
-  }
16
+    }
17 17
 
18
-  public function dataManagerAction($model = '', $dataManager = 'manager') {
18
+    public function dataManagerAction($model = '', $dataManager = 'manager') {
19 19
     if (!$model) {
20
-      $modulePath = Module::getModulePath($this->module->moduleName);
21
-      $path = $modulePath . '/models';
22
-      if (file_exists($path)) {
20
+        $modulePath = Module::getModulePath($this->module->moduleName);
21
+        $path = $modulePath . '/models';
22
+        if (file_exists($path)) {
23 23
         $files = array_slice(scandir($path), 2);
24 24
         foreach ($files as $file) {
25
-          if (is_dir($path . '/' . $file)) {
25
+            if (is_dir($path . '/' . $file)) {
26 26
             continue;
27
-          }
28
-          $model = pathinfo($file, PATHINFO_FILENAME);
29
-          break;
27
+            }
28
+            $model = pathinfo($file, PATHINFO_FILENAME);
29
+            break;
30
+        }
30 31
         }
31
-      }
32 32
     }
33 33
     $fullModelName = $this->module->moduleName . '\\' . ucfirst($model);
34 34
     $dataManager = new Ui\DataManager($fullModelName, $dataManager);
35 35
     $title = !empty($dataManager->managerOptions['name']) ? $dataManager->managerOptions['name'] : $fullModelName::objectName();
36 36
     $this->view->setTitle($title);
37 37
     $this->view->page(['module' => 'Ui', 'content' => 'dataManager/manager', 'data' => compact('dataManager')]);
38
-  }
38
+    }
39 39
 
40
-  public function viewAction($model, $pk) {
40
+    public function viewAction($model, $pk) {
41 41
     $fullModelName = $this->module->moduleName . '\\' . ucfirst($model);
42 42
     if (Users\User::$cur->group_id != 3 && (empty($fullModelName::$views['manager']['access']) || !in_array(Users\User::$cur->group_id, $fullModelName::$views['manager']['access']['groups']))) {
43
-      Tools::redirect('/admin', 'У вас нет прав доступа для просмотра этого объекта', 'danger');
43
+        Tools::redirect('/admin', 'У вас нет прав доступа для просмотра этого объекта', 'danger');
44 44
     }
45 45
     $item = $fullModelName::get($pk);
46 46
     $this->view->setTitle(($fullModelName::$objectName ? $fullModelName::$objectName : $fullModelName) . ($item ? ( ' - ' . $item->name()) : ''));
47 47
     if (!empty($_POST['comment'])) {
48
-      $comment = new Dashboard\Comment();
49
-      $comment->text = $_POST['comment'];
50
-      $comment->user_id = \Users\User::$cur->id;
51
-      $comment->model = $fullModelName;
52
-      $comment->item_id = $item->pk();
53
-      $comment->save();
54
-      Tools::redirect($_SERVER['REQUEST_URI']);
48
+        $comment = new Dashboard\Comment();
49
+        $comment->text = $_POST['comment'];
50
+        $comment->user_id = \Users\User::$cur->id;
51
+        $comment->model = $fullModelName;
52
+        $comment->item_id = $item->pk();
53
+        $comment->save();
54
+        Tools::redirect($_SERVER['REQUEST_URI']);
55 55
     }
56 56
     $moduleName = $this->module->moduleName;
57 57
     $pageParam = ['module' => 'Ui', 'content' => 'dataManager/view', 'data' => compact('item', 'moduleName')];
58 58
     if (isset($_GET['print'])) {
59
-      $pageParam['page'] = 'print';
59
+        $pageParam['page'] = 'print';
60 60
     }
61 61
     $this->view->page($pageParam);
62
-  }
62
+    }
63 63
 
64 64
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
   public function dataManagerAction($model = '', $dataManager = 'manager') {
19 19
     if (!$model) {
20 20
       $modulePath = Module::getModulePath($this->module->moduleName);
21
-      $path = $modulePath . '/models';
21
+      $path = $modulePath.'/models';
22 22
       if (file_exists($path)) {
23 23
         $files = array_slice(scandir($path), 2);
24 24
         foreach ($files as $file) {
25
-          if (is_dir($path . '/' . $file)) {
25
+          if (is_dir($path.'/'.$file)) {
26 26
             continue;
27 27
           }
28 28
           $model = pathinfo($file, PATHINFO_FILENAME);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         }
31 31
       }
32 32
     }
33
-    $fullModelName = $this->module->moduleName . '\\' . ucfirst($model);
33
+    $fullModelName = $this->module->moduleName.'\\'.ucfirst($model);
34 34
     $dataManager = new Ui\DataManager($fullModelName, $dataManager);
35 35
     $title = !empty($dataManager->managerOptions['name']) ? $dataManager->managerOptions['name'] : $fullModelName::objectName();
36 36
     $this->view->setTitle($title);
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
   }
39 39
 
40 40
   public function viewAction($model, $pk) {
41
-    $fullModelName = $this->module->moduleName . '\\' . ucfirst($model);
41
+    $fullModelName = $this->module->moduleName.'\\'.ucfirst($model);
42 42
     if (Users\User::$cur->group_id != 3 && (empty($fullModelName::$views['manager']['access']) || !in_array(Users\User::$cur->group_id, $fullModelName::$views['manager']['access']['groups']))) {
43 43
       Tools::redirect('/admin', 'У вас нет прав доступа для просмотра этого объекта', 'danger');
44 44
     }
45 45
     $item = $fullModelName::get($pk);
46
-    $this->view->setTitle(($fullModelName::$objectName ? $fullModelName::$objectName : $fullModelName) . ($item ? ( ' - ' . $item->name()) : ''));
46
+    $this->view->setTitle(($fullModelName::$objectName ? $fullModelName::$objectName : $fullModelName).($item ? (' - '.$item->name()) : ''));
47 47
     if (!empty($_POST['comment'])) {
48 48
       $comment = new Dashboard\Comment();
49 49
       $comment->text = $_POST['comment'];
Please login to merge, or discard this patch.