Completed
Push — master ( 0afdc4...0e57e6 )
by Alexey
04:27
created
system/modules/Dashboard/Dashboard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     $modelName = $item->model;
15 15
     $relItem = $modelName::get($item->$col);
16 16
     if ($relItem) {
17
-      return "<a href='/admin/" . $relItem->genViewLink() . "'>" . $relItem->name() . "</a>";
17
+      return "<a href='/admin/".$relItem->genViewLink()."'>".$relItem->name()."</a>";
18 18
     }
19 19
     return 'Ресурс удален';
20 20
   }
Please login to merge, or discard this patch.
system/modules/Ui/appAdminControllers/content/dataManager/view.php 1 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.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
       $this->name = $this->managerOptions['name'];
58 58
     }
59 59
 
60
-    $this->managerId = str_replace('\\', '_', 'dataManager_' . $this->modelName . '_' . $this->managerName . '_' . \Tools::randomString());
60
+    $this->managerId = str_replace('\\', '_', 'dataManager_'.$this->modelName.'_'.$this->managerName.'_'.\Tools::randomString());
61 61
   }
62 62
 
63 63
   /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     if (!empty($this->managerOptions['filters'])) {
104 104
       $buttons[] = [
105 105
           'text' => 'Фильтры',
106
-          'onclick' => '  var modal = $("#' . $this->managerId . '_filters");
106
+          'onclick' => '  var modal = $("#'.$this->managerId.'_filters");
107 107
                 modal.modal("show");',
108 108
       ];
109 109
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
       $formParams['formName'] = 'simpleItem';
112 112
       $buttons[] = [
113 113
           'text' => '<i class = "glyphicon glyphicon-send"></i> Быстрое создание',
114
-          'onclick' => 'inji.Ui.dataManagers.get(this).newItem("' . str_replace('\\', '\\\\', $modelName) . '",' . json_encode($formParams) . ');',
114
+          'onclick' => 'inji.Ui.dataManagers.get(this).newItem("'.str_replace('\\', '\\\\', $modelName).'",'.json_encode($formParams).');',
115 115
       ];
116 116
     }
117 117
     $formParams['formName'] = !empty($this->managerOptions['editForm']) ? $this->managerOptions['editForm'] : 'manager';
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
       $aform = new ActiveForm(new $modelName, $formParams['formName']);
124 124
       if ($aform->checkAccess()) {
125 125
         $buttons[] = [
126
-            'text' => 'Создать ' . $name,
127
-            'onclick' => 'inji.Ui.dataManagers.get(this).newItem("' . str_replace('\\', '\\\\', $modelName) . '",' . json_encode($formParams) . ');',
126
+            'text' => 'Создать '.$name,
127
+            'onclick' => 'inji.Ui.dataManagers.get(this).newItem("'.str_replace('\\', '\\\\', $modelName).'",'.json_encode($formParams).');',
128 128
         ];
129 129
       }
130 130
     }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             'className' => $action
159 159
         ];
160 160
       }
161
-      $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\' . $return[$key]['className']) ? 'Ui\DataManager\Action\\' . $return[$key]['className'] : $return[$key]['className'];
161
+      $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\'.$return[$key]['className']) ? 'Ui\DataManager\Action\\'.$return[$key]['className'] : $return[$key]['className'];
162 162
       if (!class_exists($return[$key]['className']) || ($onlyGroupActions && !$return[$key]['className']::$groupAction)) {
163 163
         unset($return[$key]);
164 164
       }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
           <?php
190 190
           foreach ($actions as $action => $actionParams) {
191 191
             if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) {
192
-              echo "<li><a role='button' href ='#' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>";
192
+              echo "<li><a role='button' href ='#' onclick='inji.Ui.dataManagers.get(this).groupAction(\"".str_replace('\\', '\\\\', $action)."\");return false;'>{$actionParams['className']::$name}</a></li>";
193 193
             }
194 194
           }
195 195
           ?>
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
       return [];
240 240
     }
241 241
     if (!$this->checkAccess()) {
242
-      $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"');
242
+      $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"');
243 243
       return [];
244 244
     }
245 245
     $modelName = $this->modelName;
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
       $queryParams['start'] = $this->page * $this->limit - $this->limit;
256 256
     }
257 257
     if (!empty($params['categoryPath']) && $modelName::$categoryModel) {
258
-      $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE'];
258
+      $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE'];
259 259
     }
260 260
     if (!empty($params['appType'])) {
261 261
       $queryParams['appType'] = $params['appType'];
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
             if (!empty($params['filters'][$col]['max'])) {
318 318
               if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) {
319 319
 
320
-                $date = $params['filters'][$col]['max'] . ' 23:59:59';
320
+                $date = $params['filters'][$col]['max'].' 23:59:59';
321 321
               } else {
322 322
                 $date = $params['filters'][$col]['max'];
323 323
               }
@@ -344,16 +344,16 @@  discard block
 block discarded – undo
344 344
             }
345 345
             switch ($params['filters'][$col]['compareType']) {
346 346
               case 'contains':
347
-                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE'];
347
+                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE'];
348 348
                 break;
349 349
               case 'equals':
350 350
                 $queryParams['where'][] = [$col, $params['filters'][$col]['value']];
351 351
                 break;
352 352
               case 'starts_with':
353
-                $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE'];
353
+                $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE'];
354 354
                 break;
355 355
               case 'ends_with':
356
-                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE'];
356
+                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE'];
357 357
                 break;
358 358
             }
359 359
             break;
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
         $item = $relation['relModel']::get([[$item->index(), $item->id], [$model->index(), $model->id]]);
393 393
       }
394 394
       $row = [];
395
-      $row[] = '<input type ="checkbox" name = "pk[]" value =' . $item->pk() . '>';
396
-      $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '%5C', get_class($originalItem));
397
-      $row[] = "<a href ='/admin/" . $item->genViewLink() . "?redirectUrl={$redirectUrl}'>{$item->pk()}</a>";
395
+      $row[] = '<input type ="checkbox" name = "pk[]" value ='.$item->pk().'>';
396
+      $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '%5C', get_class($originalItem));
397
+      $row[] = "<a href ='/admin/".$item->genViewLink()."?redirectUrl={$redirectUrl}'>{$item->pk()}</a>";
398 398
       foreach ($this->managerOptions['cols'] as $key => $colName) {
399 399
         if (!empty($params['download'])) {
400 400
           $row[] = \Model::getColValue($item, is_array($colName) ? $key : $colName, true, false);
@@ -438,16 +438,16 @@  discard block
 block discarded – undo
438 438
           $managerParams = ['relation' => $modelName::$cols[$colName]['relation']];
439 439
           $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1]));
440 440
           $count = $count ? $count : 'Нет';
441
-          return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>";
441
+          return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>";
442 442
         case 'many':
443 443
           $managerParams = ['relation' => $modelName::$cols[$colName]['relation']];
444 444
           $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1]));
445 445
           $count = $count ? $count : 'Нет';
446
-          return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>";
446
+          return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>";
447 447
         default :
448 448
           if ($item->{$modelName::$cols[$colName]['relation']}) {
449 449
             if (\App::$cur->name == 'admin') {
450
-              $href = "<a href ='/admin/" . $item->{$modelName::$cols[$colName]['relation']}->genViewLink() . "'>";
450
+              $href = "<a href ='/admin/".$item->{$modelName::$cols[$colName]['relation']}->genViewLink()."'>";
451 451
               if (!empty($modelName::$cols[$colName]['showCol'])) {
452 452
                 $href .= $item->{$modelName::$cols[$colName]['relation']}->{$modelName::$cols[$colName]['showCol']};
453 453
               } else {
@@ -477,17 +477,17 @@  discard block
 block discarded – undo
477 477
           case 'many':
478 478
             $managerParams = ['relation' => $modelName::$cols[$colName]['relation']];
479 479
             $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1]));
480
-            return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>";
480
+            return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count} ".\Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов'])."</a>";
481 481
           default:
482 482
             return $item->$colName;
483 483
         }
484 484
       } elseif (!empty($modelName::$cols[$colName]['type'])) {
485
-        if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
485
+        if (\App::$cur->name == 'admin' && $originalCol == 'name' || ($dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
486 486
           $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager';
487
-          $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
487
+          $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem));
488 488
           return "<a href ='/admin/{$originalItem->genViewLink()}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
489 489
         } elseif (\App::$cur->name == 'admin' && $colName == 'name') {
490
-          $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
490
+          $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem));
491 491
           return "<a href ='/admin/{$item->genViewLink()}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
492 492
         } elseif ($modelName::$cols[$colName]['type'] == 'html') {
493 493
           $uid = \Tools::randomString();
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
               el{$uid}.after('<a href=\"#\" onclick=\"el{$uid}Toggle();return false;\">Развернуть</a>');
518 518
             }
519 519
             })</script>";
520
-          return "<div id = '{$uid}' style='max-height:44px;overflow:hidden;'>{$item->$colName}</div>" . $script;
520
+          return "<div id = '{$uid}' style='max-height:44px;overflow:hidden;'>{$item->$colName}</div>".$script;
521 521
         } else {
522 522
           return \Model::resloveTypeValue($item, $colName);
523 523
         }
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
       return [];
551 551
     }
552 552
     if (!$this->checkAccess()) {
553
-      $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"');
553
+      $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"');
554 554
       return [];
555 555
     }
556 556
     if (!empty($params['limit'])) {
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
     ];
565 565
     $modelName = $this->modelName;
566 566
     if (!empty($params['categoryPath']) && $modelName::$categoryModel) {
567
-      $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE'];
567
+      $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE'];
568 568
     }
569 569
     if (!empty($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'])) {
570 570
       foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) {
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
             if (!empty($params['filters'][$col]['max'])) {
622 622
               if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) {
623 623
 
624
-                $date = $params['filters'][$col]['max'] . ' 23:59:59';
624
+                $date = $params['filters'][$col]['max'].' 23:59:59';
625 625
               } else {
626 626
                 $date = $params['filters'][$col]['max'];
627 627
               }
@@ -648,16 +648,16 @@  discard block
 block discarded – undo
648 648
             }
649 649
             switch ($params['filters'][$col]['compareType']) {
650 650
               case 'contains':
651
-                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE'];
651
+                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE'];
652 652
                 break;
653 653
               case 'equals':
654 654
                 $queryParams['where'][] = [$col, $params['filters'][$col]['value']];
655 655
                 break;
656 656
               case 'starts_with':
657
-                $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE'];
657
+                $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE'];
658 658
                 break;
659 659
               case 'ends_with':
660
-                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE'];
660
+                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE'];
661 661
                 break;
662 662
             }
663 663
             break;
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
       $tableCols[] = !empty($colOptions['label']) ? $colOptions['label'] : $colName;
691 691
     }
692 692
     $tableCols[] = '';
693
-    $this->table->class .=' datamanagertable';
693
+    $this->table->class .= ' datamanagertable';
694 694
     $this->table->setCols($tableCols);
695 695
   }
696 696
 
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
       return false;
712 712
     }
713 713
     if (!$this->checkAccess()) {
714
-      $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"');
714
+      $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"');
715 715
       return [];
716 716
     }
717 717
     $tree = new Tree();
718 718
     $tree->ul($this->managerOptions['categorys']['model'], 0, function($category) {
719
-      $path = $category->tree_path . ($category->pk() ? $category->pk() . "/" : '');
719
+      $path = $category->tree_path.($category->pk() ? $category->pk()."/" : '');
720 720
       $cleanClassName = str_replace('\\', '\\\\', get_class($category));
721 721
       return "<a href='#' onclick='inji.Ui.dataManagers.get(this).switchCategory(this);return false;' data-index='{$category->index()}' data-path ='{$path}' data-id='{$category->pk()}' data-model='{$this->managerOptions['categorys']['model']}'> {$category->name}</a> 
722 722
                 
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 1 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/Inji/Model.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             $relModel = $relations[$colInfo['colParams']['relation']]['model'];
208 208
             $relModel = strpos($relModel, '\\') === 0 ? substr($relModel, 1) : $relModel;
209 209
             if ($manageHref) {
210
-              $value = $relValue ? "<a href='/admin/" . str_replace('\\', '/view/', $relModel) . "/" . $relValue->pk() . "'>" . $relValue->name() . "</a>" : 'Не задано';
210
+              $value = $relValue ? "<a href='/admin/".str_replace('\\', '/view/', $relModel)."/".$relValue->pk()."'>".$relValue->name()."</a>" : 'Не задано';
211 211
             } else {
212 212
               $value = $relValue ? $relValue->name() : 'Не задано';
213 213
             }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
       case 'image':
218 218
         $file = Files\File::get($item->$colName);
219 219
         if ($file) {
220
-          $value = '<img src="' . $file->path . '?resize=60x120" />';
220
+          $value = '<img src="'.$file->path.'?resize=60x120" />';
221 221
         } else {
222 222
           $value = '<img src="/static/system/images/no-image.png?resize=60x120" />';
223 223
         }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 case 'map':
262 262
                   if ($item->$colName && json_decode($item->$colName, true)) {
263 263
                     $addres = json_decode($item->$colName, true);
264
-                    $name = $addres['address'] ? $addres['address'] : 'lat:' . $addres['lat'] . ': lng:' . $addres['lng'];
264
+                    $name = $addres['address'] ? $addres['address'] : 'lat:'.$addres['lat'].': lng:'.$addres['lng'];
265 265
                     \App::$cur->libs->loadLib('yandexMap');
266 266
                     ob_start();
267 267
                     $uid = Tools::randomString();
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                     <?php
294 294
                     $content = ob_get_contents();
295 295
                     ob_end_clean();
296
-                    $onclick = 'inji.Ui.modals.show("' . addcslashes($addres['address'], '"') . '", $("#map' . $uid . '_container script").html().replace(/^\/\*/g, "").replace(/\*\/$/g, "")+"</script>","mapmodal' . $uid . '","modal-lg");';
296
+                    $onclick = 'inji.Ui.modals.show("'.addcslashes($addres['address'], '"').'", $("#map'.$uid.'_container script").html().replace(/^\/\*/g, "").replace(/\*\/$/g, "")+"</script>","mapmodal'.$uid.'","modal-lg");';
297 297
                     $onclick .= 'return false;';
298 298
                     $value = "<a href ='#' onclick='{$onclick}' >{$name}</a>";
299 299
                     $value .= $content;
@@ -333,12 +333,12 @@  discard block
 block discarded – undo
333 333
       return;
334 334
     }
335 335
     if (!is_array($array)) {
336
-      if (!isset($cols[static::colPrefix() . $array]) && isset(static::$cols[$array])) {
336
+      if (!isset($cols[static::colPrefix().$array]) && isset(static::$cols[$array])) {
337 337
         static::createCol($array);
338 338
         $cols = static::cols(true);
339 339
       }
340
-      if (!isset($cols[$array]) && isset($cols[static::colPrefix() . $array])) {
341
-        $array = static::colPrefix() . $array;
340
+      if (!isset($cols[$array]) && isset($cols[static::colPrefix().$array])) {
341
+        $array = static::colPrefix().$array;
342 342
       } else {
343 343
         static::checkForJoin($array, $rootModel);
344 344
       }
@@ -347,14 +347,14 @@  discard block
 block discarded – undo
347 347
     switch ($searchtype) {
348 348
       case 'key':
349 349
         foreach ($array as $key => $item) {
350
-          if (!isset($cols[static::colPrefix() . $key]) && isset(static::$cols[$key])) {
350
+          if (!isset($cols[static::colPrefix().$key]) && isset(static::$cols[$key])) {
351 351
             static::createCol($key);
352 352
             $cols = static::cols(true);
353 353
           }
354
-          if (!isset($cols[$key]) && isset($cols[static::colPrefix() . $key])) {
355
-            $array[static::colPrefix() . $key] = $item;
354
+          if (!isset($cols[$key]) && isset($cols[static::colPrefix().$key])) {
355
+            $array[static::colPrefix().$key] = $item;
356 356
             unset($array[$key]);
357
-            $key = static::colPrefix() . $key;
357
+            $key = static::colPrefix().$key;
358 358
           }
359 359
           if (is_array($array[$key])) {
360 360
             static::fixPrefix($array[$key], 'key', $rootModel);
@@ -365,12 +365,12 @@  discard block
 block discarded – undo
365 365
         break;
366 366
       case 'first':
367 367
         if (isset($array[0]) && is_string($array[0])) {
368
-          if (!isset($cols[static::colPrefix() . $array[0]]) && isset(static::$cols[$array[0]])) {
368
+          if (!isset($cols[static::colPrefix().$array[0]]) && isset(static::$cols[$array[0]])) {
369 369
             static::createCol($array[0]);
370 370
             $cols = static::cols(true);
371 371
           }
372
-          if (!isset($cols[$array[0]]) && isset($cols[static::colPrefix() . $array[0]])) {
373
-            $array[0] = static::colPrefix() . $array[0];
372
+          if (!isset($cols[$array[0]]) && isset($cols[static::colPrefix().$array[0]])) {
373
+            $array[0] = static::colPrefix().$array[0];
374 374
           } else {
375 375
             static::checkForJoin($array[0], $rootModel);
376 376
           }
@@ -402,13 +402,13 @@  discard block
 block discarded – undo
402 402
           case 'to':
403 403
             $relCol = $relations[$rel]['col'];
404 404
             static::fixPrefix($relCol);
405
-            $rootModel::$relJoins[$relations[$rel]['model'] . '_' . $rel] = [$relations[$rel]['model']::table(), $relations[$rel]['model']::index() . ' = ' . $relCol];
405
+            $rootModel::$relJoins[$relations[$rel]['model'].'_'.$rel] = [$relations[$rel]['model']::table(), $relations[$rel]['model']::index().' = '.$relCol];
406 406
             break;
407 407
           case 'one':
408 408
           case 'many':
409 409
             $relCol = $relations[$rel]['col'];
410 410
             $relations[$rel]['model']::fixPrefix($relCol);
411
-            $rootModel::$relJoins[$relations[$rel]['model'] . '_' . $rel] = [$relations[$rel]['model']::table(), static::index() . ' = ' . $relCol];
411
+            $rootModel::$relJoins[$relations[$rel]['model'].'_'.$rel] = [$relations[$rel]['model']::table(), static::index().' = '.$relCol];
412 412
             break;
413 413
         }
414 414
         $relations[$rel]['model']::fixPrefix($col, 'key', $rootModel);
@@ -447,13 +447,13 @@  discard block
 block discarded – undo
447 447
             $relCol = $relations[$rel]['col'];
448 448
             static::fixPrefix($relCol);
449 449
             //$info['modelName'] = $relations[$rel]['model'];
450
-            $info['joins'][$relations[$rel]['model'] . '_' . $rel] = [$relations[$rel]['model']::table(), $relations[$rel]['model']::index() . ' = ' . $relCol];
450
+            $info['joins'][$relations[$rel]['model'].'_'.$rel] = [$relations[$rel]['model']::table(), $relations[$rel]['model']::index().' = '.$relCol];
451 451
             break;
452 452
           case 'one':
453 453
             $relCol = $relations[$rel]['col'];
454 454
             $relations[$rel]['model']::fixPrefix($relCol);
455 455
             //$info['modelName'] = $relations[$rel]['model'];
456
-            $info['joins'][$relations[$rel]['model'] . '_' . $rel] = [$relations[$rel]['model']::table(), static::index() . ' = ' . $relCol];
456
+            $info['joins'][$relations[$rel]['model'].'_'.$rel] = [$relations[$rel]['model']::table(), static::index().' = '.$relCol];
457 457
             break;
458 458
         }
459 459
         $info = $relations[$rel]['model']::parseColRecursion($info);
@@ -471,8 +471,8 @@  discard block
 block discarded – undo
471 471
       } else {
472 472
         $info['colParams'] = [];
473 473
       }
474
-      if (!isset($cols[$info['col']]) && isset($cols[static::colPrefix() . $info['col']])) {
475
-        $info['col'] = static::colPrefix() . $info['col'];
474
+      if (!isset($cols[$info['col']]) && isset($cols[static::colPrefix().$info['col']])) {
475
+        $info['col'] = static::colPrefix().$info['col'];
476 476
       }
477 477
       $info['modelName'] = get_called_class();
478 478
     }
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
     if ($params === false) {
579 579
       return false;
580 580
     }
581
-    return App::$cur->db->addCol(static::table(), static::colPrefix() . $colName, $params);
581
+    return App::$cur->db->addCol(static::table(), static::colPrefix().$colName, $params);
582 582
   }
583 583
 
584 584
   public static function createTable() {
@@ -607,28 +607,28 @@  discard block
 block discarded – undo
607 607
       return true;
608 608
     }
609 609
     $cols = [
610
-        $colPrefix . 'id' => 'pk'
610
+        $colPrefix.'id' => 'pk'
611 611
     ];
612 612
     $className = get_called_class();
613 613
     if (!empty($className::$cols)) {
614 614
       foreach ($className::$cols as $colName => $colParams) {
615 615
         if ($colName == 'date_create') {
616
-          $cols[$colPrefix . 'date_create'] = 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP';
616
+          $cols[$colPrefix.'date_create'] = 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP';
617 617
           continue;
618 618
         }
619 619
         $params = $className::genColParams($colName);
620 620
         if ($params) {
621
-          $cols[$colPrefix . $colName] = $params;
621
+          $cols[$colPrefix.$colName] = $params;
622 622
         }
623 623
       }
624 624
     }
625
-    if (empty($cols[$colPrefix . 'date_create'])) {
626
-      $cols[$colPrefix . 'date_create'] = 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP';
625
+    if (empty($cols[$colPrefix.'date_create'])) {
626
+      $cols[$colPrefix.'date_create'] = 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP';
627 627
     }
628 628
     $tableIndexes = [];
629 629
     if ($indexes) {
630 630
       foreach ($indexes as $indexName => $index) {
631
-        $tableIndexes[] = $index['type'] . ' ' . App::$cur->db->table_prefix . $indexName . ' (' . implode(',', $index['cols']) . ')';
631
+        $tableIndexes[] = $index['type'].' '.App::$cur->db->table_prefix.$indexName.' ('.implode(',', $index['cols']).')';
632 632
       }
633 633
     }
634 634
 
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
    */
653 653
   public static function index() {
654 654
 
655
-    return static::colPrefix() . 'id';
655
+    return static::colPrefix().'id';
656 656
   }
657 657
 
658 658
   /**
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
   public static function colPrefix() {
664 664
     $classPath = explode('\\', get_called_class());
665 665
     $classPath = array_slice($classPath, 1);
666
-    return strtolower(implode('_', $classPath)) . '_';
666
+    return strtolower(implode('_', $classPath)).'_';
667 667
   }
668 668
 
669 669
   /**
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
    * @return string
698 698
    */
699 699
   public function name() {
700
-    return $this->{$this->nameCol()} ? $this->{$this->nameCol()} : '№' . $this->pk();
700
+    return $this->{$this->nameCol()} ? $this->{$this->nameCol()} : '№'.$this->pk();
701 701
   }
702 702
 
703 703
   /**
@@ -731,12 +731,12 @@  discard block
 block discarded – undo
731 731
           case 'to':
732 732
             $relCol = $relations[$rel]['col'];
733 733
             static::fixPrefix($relCol);
734
-            App::$cur->db->join($relations[$rel]['model']::table(), $relations[$rel]['model']::index() . ' = ' . $relCol);
734
+            App::$cur->db->join($relations[$rel]['model']::table(), $relations[$rel]['model']::index().' = '.$relCol);
735 735
             break;
736 736
           case 'one':
737 737
             $col = $relations[$rel]['col'];
738 738
             $relations[$rel]['model']::fixPrefix($col);
739
-            App::$cur->db->join($relations[$rel]['model']::table(), static::index() . ' = ' . $col);
739
+            App::$cur->db->join($relations[$rel]['model']::table(), static::index().' = '.$col);
740 740
             break;
741 741
         }
742 742
       }
@@ -751,8 +751,8 @@  discard block
 block discarded – undo
751 751
       }
752 752
       if ($param !== null) {
753 753
         $cols = static::cols();
754
-        if (!isset($cols[$col]) && isset($cols[static::colPrefix() . $col])) {
755
-          $col = static::colPrefix() . $col;
754
+        if (!isset($cols[$col]) && isset($cols[static::colPrefix().$col])) {
755
+          $col = static::colPrefix().$col;
756 756
         }
757 757
         App::$cur->db->where($col, $param);
758 758
       } else {
@@ -816,12 +816,12 @@  discard block
 block discarded – undo
816 816
           case 'to':
817 817
             $relCol = $relations[$rel]['col'];
818 818
             static::fixPrefix($relCol);
819
-            $query->join($relations[$rel]['model']::table(), $relations[$rel]['model']::index() . ' = ' . $relCol);
819
+            $query->join($relations[$rel]['model']::table(), $relations[$rel]['model']::index().' = '.$relCol);
820 820
             break;
821 821
           case 'one':
822 822
             $col = $relations[$rel]['col'];
823 823
             $relations[$rel]['model']::fixPrefix($col);
824
-            $query->join($relations[$rel]['model']::table(), static::index() . ' = ' . $col);
824
+            $query->join($relations[$rel]['model']::table(), static::index().' = '.$col);
825 825
             break;
826 826
         }
827 827
       }
@@ -1143,12 +1143,12 @@  discard block
 block discarded – undo
1143 1143
           case 'to':
1144 1144
             $relCol = $relations[$rel]['col'];
1145 1145
             static::fixPrefix($relCol);
1146
-            $query->join($relations[$rel]['model']::table(), $relations[$rel]['model']::index() . ' = ' . $relCol);
1146
+            $query->join($relations[$rel]['model']::table(), $relations[$rel]['model']::index().' = '.$relCol);
1147 1147
             break;
1148 1148
           case 'one':
1149 1149
             $col = $relations[$rel]['col'];
1150 1150
             $relations[$rel]['model']::fixPrefix($col);
1151
-            $query->join($relations[$rel]['model']::table(), static::index() . ' = ' . $col);
1151
+            $query->join($relations[$rel]['model']::table(), static::index().' = '.$col);
1152 1152
             break;
1153 1153
         }
1154 1154
       }
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
     } else {
1166 1166
       $cols .= '*';
1167 1167
     }
1168
-    $cols .=') as `count`' . (!empty($options['cols']) ? ',' . $options['cols'] : '');
1168
+    $cols .= ') as `count`'.(!empty($options['cols']) ? ','.$options['cols'] : '');
1169 1169
     $query->cols = $cols;
1170 1170
     if (!empty($options['group'])) {
1171 1171
       $query->group($options['group']);
@@ -1298,25 +1298,25 @@  discard block
 block discarded – undo
1298 1298
     $itemModel = $class::$treeCategory;
1299 1299
     $oldPath = $this->tree_path;
1300 1300
     $this->tree_path = $this->getCatalogTree($this);
1301
-    $itemsTable = \App::$cur->db->table_prefix . $itemModel::table();
1302
-    $itemTreeCol = $itemModel::colPrefix() . 'tree_path';
1301
+    $itemsTable = \App::$cur->db->table_prefix.$itemModel::table();
1302
+    $itemTreeCol = $itemModel::colPrefix().'tree_path';
1303 1303
 
1304
-    $categoryTreeCol = $this->colPrefix() . 'tree_path';
1305
-    $categoryTable = \App::$cur->db->table_prefix . $this->table();
1304
+    $categoryTreeCol = $this->colPrefix().'tree_path';
1305
+    $categoryTable = \App::$cur->db->table_prefix.$this->table();
1306 1306
     if ($oldPath) {
1307 1307
       \App::$cur->db->query('UPDATE
1308
-                ' . $categoryTable . ' 
1308
+                ' . $categoryTable.' 
1309 1309
                     SET 
1310
-                        ' . $categoryTreeCol . ' = REPLACE(' . $categoryTreeCol . ', "' . $oldPath . $this->id . '/' . '", "' . $this->tree_path . $this->id . '/' . '") 
1311
-                    WHERE ' . $categoryTreeCol . ' LIKE "' . $oldPath . $this->id . '/' . '%"');
1310
+                        ' . $categoryTreeCol.' = REPLACE('.$categoryTreeCol.', "'.$oldPath.$this->id.'/'.'", "'.$this->tree_path.$this->id.'/'.'") 
1311
+                    WHERE ' . $categoryTreeCol.' LIKE "'.$oldPath.$this->id.'/'.'%"');
1312 1312
 
1313 1313
       \App::$cur->db->query('UPDATE
1314
-                ' . $itemsTable . '
1314
+                ' . $itemsTable.'
1315 1315
                     SET 
1316
-                        ' . $itemTreeCol . ' = REPLACE(' . $itemTreeCol . ', "' . $oldPath . $this->id . '/' . '", "' . $this->tree_path . $this->id . '/' . '") 
1317
-                    WHERE ' . $itemTreeCol . ' LIKE "' . $oldPath . $this->id . '/' . '%"');
1316
+                        ' . $itemTreeCol.' = REPLACE('.$itemTreeCol.', "'.$oldPath.$this->id.'/'.'", "'.$this->tree_path.$this->id.'/'.'") 
1317
+                    WHERE ' . $itemTreeCol.' LIKE "'.$oldPath.$this->id.'/'.'%"');
1318 1318
     }
1319
-    $itemModel::update([$itemTreeCol => $this->tree_path . $this->id . '/'], [$itemModel::colPrefix() . $this->index(), $this->id]);
1319
+    $itemModel::update([$itemTreeCol => $this->tree_path.$this->id.'/'], [$itemModel::colPrefix().$this->index(), $this->id]);
1320 1320
   }
1321 1321
 
1322 1322
   /**
@@ -1330,9 +1330,9 @@  discard block
 block discarded – undo
1330 1330
     $catalogParent = $catalogClass::get($catalog->parent_id);
1331 1331
     if ($catalog && $catalogParent) {
1332 1332
       if ($catalogParent->tree_path) {
1333
-        return $catalogParent->tree_path . $catalogParent->id . '/';
1333
+        return $catalogParent->tree_path.$catalogParent->id.'/';
1334 1334
       } else {
1335
-        return $this->getCatalogTree($catalogParent) . $catalogParent->id . '/';
1335
+        return $this->getCatalogTree($catalogParent).$catalogParent->id.'/';
1336 1336
       }
1337 1337
     }
1338 1338
     return '/';
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
     $categoryModel = $class::$categoryModel;
1347 1347
     $category = $categoryModel::get($this->{$categoryModel::index()});
1348 1348
     if ($category) {
1349
-      $this->tree_path = $category->tree_path . $category->pk() . '/';
1349
+      $this->tree_path = $category->tree_path.$category->pk().'/';
1350 1350
     } else {
1351 1351
       $this->tree_path = '/';
1352 1352
     }
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
       $this->changeCategoryTree();
1372 1372
     }
1373 1373
     if (!empty($this->_changedParams) && $this->pk()) {
1374
-      Inji::$inst->event('modelItemParamsChanged-' . get_called_class(), $this);
1374
+      Inji::$inst->event('modelItemParamsChanged-'.get_called_class(), $this);
1375 1375
     }
1376 1376
     $this->beforeSave();
1377 1377
 
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
     }
1417 1417
     $this->_params = $result->fetch();
1418 1418
     if ($new) {
1419
-      Inji::$inst->event('modelCreatedItem-' . get_called_class(), $this);
1419
+      Inji::$inst->event('modelCreatedItem-'.get_called_class(), $this);
1420 1420
     }
1421 1421
     $this->afterSave();
1422 1422
     return $this->{$this->index()};
@@ -1554,7 +1554,7 @@  discard block
 block discarded – undo
1554 1554
     static::fixPrefix($params);
1555 1555
     $className = get_called_class();
1556 1556
     foreach ($params as $paramName => $value) {
1557
-      $shortName = preg_replace('!' . $this->colPrefix() . '!', '', $paramName);
1557
+      $shortName = preg_replace('!'.$this->colPrefix().'!', '', $paramName);
1558 1558
       if (!empty($className::$cols[$shortName])) {
1559 1559
         switch ($className::$cols[$shortName]['type']) {
1560 1560
           case 'decimal':
@@ -1831,7 +1831,7 @@  discard block
 block discarded – undo
1831 1831
   public function __set($name, $value) {
1832 1832
     static::fixPrefix($name);
1833 1833
     $className = get_called_class();
1834
-    $shortName = preg_replace('!' . $this->colPrefix() . '!', '', $name);
1834
+    $shortName = preg_replace('!'.$this->colPrefix().'!', '', $name);
1835 1835
     if (!empty($className::$cols[$shortName])) {
1836 1836
       switch ($className::$cols[$shortName]['type']) {
1837 1837
         case 'decimal':
Please login to merge, or discard this patch.
system/program/admin/objects/adminController.php 1 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.