Completed
Push — master ( c0f2e9...bf06e8 )
by Alexey
05:57
created
system/modules/StaticLoader/StaticLoader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $type = substr($path, 0, strpos($path, '/'));
53 53
         switch ($type) {
54 54
             case 'libs':
55
-                return App::$cur->Libs->getPath(array_slice(explode('/', $path),2));
55
+                return App::$cur->Libs->getPath(array_slice(explode('/', $path), 2));
56 56
                 break;
57 57
             case 'templates':
58 58
                 $path = substr($path, strpos($path, '/') + 1);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
             $fileName = $fileinfo['filename'] . '.' . $fileinfo['extension'];
190 190
             if (App::$cur->db->connect) {
191
-                $fileObj = Files\File::get([ 'path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']);
191
+                $fileObj = Files\File::get(['path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']);
192 192
                 if ($fileObj) {
193 193
                     $fileName = $fileObj->original_name;
194 194
                 }
Please login to merge, or discard this patch.
Braces   +14 added lines, -12 removed lines patch added patch discarded remove patch
@@ -112,10 +112,11 @@  discard block
 block discarded – undo
112 112
 
113 113
                 $sizes = explode('x', $_GET['resize']);
114 114
                 $sizes[0] = intval($sizes[0]);
115
-                if (isset($sizes[1]))
116
-                    $sizes[1] = intval($sizes[1]);
117
-                else
118
-                    $sizes[1] = 0;
115
+                if (isset($sizes[1])) {
116
+                                    $sizes[1] = intval($sizes[1]);
117
+                } else {
118
+                                    $sizes[1] = 0;
119
+                }
119 120
 
120 121
                 if (!$sizes[0] || !$sizes[1]) {
121 122
                     header('HTTP/1.1 404 Not Found');
@@ -127,15 +128,16 @@  discard block
 block discarded – undo
127 128
                     $dir = App::$primary->path;
128 129
 
129 130
                     if (!empty($_GET['resize_crop'])) {
130
-                        if (in_array($_GET['resize_crop'], array('q', 'c')))
131
-                            $crop = $_GET['resize_crop'];
132
-                        else
133
-                            $crop = 'c';
131
+                        if (in_array($_GET['resize_crop'], array('q', 'c'))) {
132
+                                                    $crop = $_GET['resize_crop'];
133
+                        } else {
134
+                                                    $crop = 'c';
135
+                        }
136
+                    } elseif (!empty($_GET['resize_quadro'])) {
137
+                                            $crop = 'q';
138
+                    } else {
139
+                                            $crop = '';
134 140
                     }
135
-                    elseif (!empty($_GET['resize_quadro']))
136
-                        $crop = 'q';
137
-                    else
138
-                        $crop = '';
139 141
                     $pos = 'center';
140 142
                     if (!empty($_GET['resize_pos']) && in_array($_GET['resize_pos'], array('top', 'center'))) {
141 143
                         $pos = $_GET['resize_pos'];
Please login to merge, or discard this patch.
system/modules/TextBlocks/TextBlocks.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Text blocks module
4
- *
5
- * @author Alexey Krupskiy <[email protected]>
6
- * @link http://inji.ru/
7
- * @copyright 2015 Alexey Krupskiy
8
- * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
9
- */
3
+     * Text blocks module
4
+     *
5
+     * @author Alexey Krupskiy <[email protected]>
6
+     * @link http://inji.ru/
7
+     * @copyright 2015 Alexey Krupskiy
8
+     * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
9
+     */
10 10
 class TextBlocks extends Module
11 11
 {
12 12
     function init()
Please login to merge, or discard this patch.
system/modules/Ui/appAdminControllers/content/dataManager/view.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     ]]);
59 59
     ?>)</h3>
60 60
   <?php
61
-  foreach (\Dashboard\Comment::getList([ 'where' => [
61
+  foreach (\Dashboard\Comment::getList(['where' => [
62 62
           ['item_id', $item->id],
63 63
           ['model', $modelName],
64 64
       ], 'order' => ['date', 'desc']]) as $comment) {
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
     ]]);
59 59
     ?>)</h3>
60 60
   <?php
61
-  foreach (\Dashboard\Comment::getList([ 'where' => [
62
-          ['item_id', $item->id],
63
-          ['model', $modelName],
64
-      ], 'order' => ['date_create', 'desc']]) as $comment) {
65
-      ?>
61
+    foreach (\Dashboard\Comment::getList([ 'where' => [
62
+            ['item_id', $item->id],
63
+            ['model', $modelName],
64
+        ], 'order' => ['date_create', 'desc']]) as $comment) {
65
+        ?>
66 66
       <div class="row">
67 67
         <div class="col-sm-3" style="max-width: 300px;">
68 68
           <a href='/admin/Users/view/User/<?= $comment->user->pk(); ?>'><?= $comment->user->name(); ?></a><br />
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
         </div>
74 74
       </div>
75 75
       <?php
76
-  }
77
-  ?>
76
+    }
77
+    ?>
78 78
 </div>
79 79
 <div>
80 80
   <?php
81
-  $form = new \Ui\Form();
82
-  $form->begin();
83
-  $form->input('textarea', 'comment', 'Комментарий');
84
-  $form->end();
85
-  ?>
81
+    $form = new \Ui\Form();
82
+    $form->begin();
83
+    $form->input('textarea', 'comment', 'Комментарий');
84
+    $form->end();
85
+    ?>
86 86
 </div>
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
                             $this->model->_params[$modelName::index()] = 0;
74 74
                         }
75 75
                         $relOptions['model']::fixPrefix($relOptions['col']);
76
-                        $inputs[$col] = new ActiveForm(new $relOptions['model']([ $relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]);
76
+                        $inputs[$col] = new ActiveForm(new $relOptions['model']([$relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]);
77 77
                     }
78 78
                     $inputs[$col]->parent = $this;
79 79
                 } elseif (!empty($modelName::$cols[$col])) {
Please login to merge, or discard this patch.
system/modules/Ui/objects/DataManager.php 4 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -608,22 +608,22 @@
 block discarded – undo
608 608
         ?>
609 609
         <ul class="nav nav-list-categorys" data-col='tree_path'>
610 610
           <?php
611
-          $categoryModel = $this->managerOptions['categorys']['model'];
612
-          $order = [];
613
-          if (!empty($this->managerOptions['sortMode'])) {
614
-              $order[] = ['weight', 'asc'];
615
-          }
616
-          $categorys = $categoryModel::getList(['order' => $order]);
617
-          echo "<li>
611
+            $categoryModel = $this->managerOptions['categorys']['model'];
612
+            $order = [];
613
+            if (!empty($this->managerOptions['sortMode'])) {
614
+                $order[] = ['weight', 'asc'];
615
+            }
616
+            $categorys = $categoryModel::getList(['order' => $order]);
617
+            echo "<li>
618 618
                         <label class='nav-header'>
619 619
                             <a href='#' onclick='inji.Ui.dataManagers.get(this).switchCategory(this);return false;' data-path ='/'>/</a> 
620 620
                         </label>
621 621
                     </li>";
622
-          foreach ($categorys as $category) {
623
-              if ($category->parent_id == 0)
624
-                  $this->showCategory($categorys, $category);
625
-          }
626
-          ?>
622
+            foreach ($categorys as $category) {
623
+                if ($category->parent_id == 0)
624
+                    $this->showCategory($categorys, $category);
625
+            }
626
+            ?>
627 627
         </ul>
628 628
         <?php
629 629
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -397,7 +397,7 @@
 block discarded – undo
397 397
                         return $item->$colName;
398 398
                 }
399 399
             } elseif (!empty($modelName::$cols[$colName]['type'])) {
400
-                if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
400
+                if (\App::$cur->name == 'admin' && $originalCol == 'name' || ($dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
401 401
                     $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager';
402 402
                     $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
403 403
                     return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($originalItem)) . "/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -620,8 +620,9 @@
 block discarded – undo
620 620
                         </label>
621 621
                     </li>";
622 622
           foreach ($categorys as $category) {
623
-              if ($category->parent_id == 0)
624
-                  $this->showCategory($categorys, $category);
623
+              if ($category->parent_id == 0) {
624
+                                $this->showCategory($categorys, $category);
625
+              }
625 626
           }
626 627
           ?>
627 628
         </ul>
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * Construct new data manager
29 29
      * 
30 30
      * @param string $modelName
31
-     * @param string|array $dataManager
31
+     * @param string $dataManager
32 32
      * @throws Exception
33 33
      */
34 34
     public function __construct($modelName, $dataManager = 'manager')
@@ -330,6 +330,9 @@  discard block
 block discarded – undo
330 330
         return $rows;
331 331
     }
332 332
 
333
+    /**
334
+     * @param DataManager $dataManager
335
+     */
333 336
     public static function drawCol($item, $colName, $params = [], $dataManager = null, $originalCol = '', $originalItem = null)
334 337
     {
335 338
         $modelName = get_class($item);
Please login to merge, or discard this patch.
system/modules/Ui/objects/Pages.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,10 +34,11 @@
 block discarded – undo
34 34
             $this->params['page'] = 1;
35 35
             if (!empty($this->data['page'])) {
36 36
                 $this->params['page'] = (int) $this->data['page'];
37
-                if ($this->params['page'] <= 0)
38
-                    $this->params['page'] = 1;
39
-                elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit']))
40
-                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
37
+                if ($this->params['page'] <= 0) {
38
+                                    $this->params['page'] = 1;
39
+                } elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) {
40
+                                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
41
+                }
41 42
             }
42 43
 
43 44
             $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit'];
Please login to merge, or discard this patch.
system/modules/Ui/objects/Tree.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@
 block discarded – undo
23 23
         ?>
24 24
         <ul class="nav nav-list-categorys" data-col='tree_path'>
25 25
           <?php
26
-          $class = get_class($objectRoot);
27
-          $items = $class::getList(['where' => ['parent_id', $objectRoot->pk()]]);
28
-          $count += count($items);
29
-          foreach ($items as $objectChild) {
30
-              $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
31
-          }
32
-          ?>
26
+            $class = get_class($objectRoot);
27
+            $items = $class::getList(['where' => ['parent_id', $objectRoot->pk()]]);
28
+            $count += count($items);
29
+            foreach ($items as $objectChild) {
30
+                $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
31
+            }
32
+            ?>
33 33
         </ul>
34 34
         <?php
35 35
         return $count;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
           $items = $class::getList(['where' => ['parent_id', $objectRoot->pk()]]);
28 28
           $count += count($items);
29 29
           foreach ($items as $objectChild) {
30
-              $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
30
+              $count += static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
31 31
           }
32 32
           ?>
33 33
         </ul>
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                       <ul class='nav nav-list nav-left-ml'>
56 56
                         <?php
57 57
                     }
58
-                    $count+=static::showLi($objectChild, $deep + 1, $maxDeep,$hrefFunc);
58
+                    $count += static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc);
59 59
                 }
60 60
             }
61 61
             if ($isset) {
Please login to merge, or discard this patch.
system/modules/Ui/widgets/ActiveForm/ActiveForm.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -3,38 +3,38 @@
 block discarded – undo
3 3
 ?>
4 4
 <div id ='<?= $id; ?>' class="uiActiveForm" data-modelname="<?= $activeForm->modelName; ?>" data-formname="<?= $activeForm->formName; ?>" data-inputs='<?= json_encode($activeForm->inputs); ?>'>
5 5
   <?php
6
-  if ($activeForm->parent === null) {
7
-      $form->action = $activeForm->action;
8
-      $form->begin($activeForm->header, ['onsubmit' => $ajax ? 'inji.Ui.forms.submitAjax(this);return false;' : '']);
9
-  } elseif ($activeForm->header) {
10
-      echo "<h3>{$activeForm->header}</h3>";
11
-  }
12
-  if (empty($activeForm->form['noMapCell'])) {
13
-      foreach ($activeForm->form['map'] as $row) {
14
-          $colSize = 12 / count($row);
15
-          echo "<div class ='row'>";
16
-          foreach ($row as $col) {
17
-              echo "<div class = 'col-sm-{$colSize}'>";
18
-              if ($col) {
19
-                  $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params);
20
-              }
21
-              echo '</div>';
22
-          }
23
-          echo '</div>';
24
-      }
25
-  } else {
26
-      foreach ($activeForm->form['map'] as $row) {
27
-          foreach ($row as $col) {
28
-              if ($col) {
29
-                  $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params);
30
-              }
31
-          }
32
-      }
33
-  }
34
-  if ($activeForm->parent === null) {
35
-      $form->end($activeForm->model ? ($activeForm->model->pk() ? 'Сохранить' : 'Создать') : 'Отправить');
36
-  }
37
-  ?>
6
+    if ($activeForm->parent === null) {
7
+        $form->action = $activeForm->action;
8
+        $form->begin($activeForm->header, ['onsubmit' => $ajax ? 'inji.Ui.forms.submitAjax(this);return false;' : '']);
9
+    } elseif ($activeForm->header) {
10
+        echo "<h3>{$activeForm->header}</h3>";
11
+    }
12
+    if (empty($activeForm->form['noMapCell'])) {
13
+        foreach ($activeForm->form['map'] as $row) {
14
+            $colSize = 12 / count($row);
15
+            echo "<div class ='row'>";
16
+            foreach ($row as $col) {
17
+                echo "<div class = 'col-sm-{$colSize}'>";
18
+                if ($col) {
19
+                    $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params);
20
+                }
21
+                echo '</div>';
22
+            }
23
+            echo '</div>';
24
+        }
25
+    } else {
26
+        foreach ($activeForm->form['map'] as $row) {
27
+            foreach ($row as $col) {
28
+                if ($col) {
29
+                    $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params);
30
+                }
31
+            }
32
+        }
33
+    }
34
+    if ($activeForm->parent === null) {
35
+        $form->end($activeForm->model ? ($activeForm->model->pk() ? 'Сохранить' : 'Создать') : 'Отправить');
36
+    }
37
+    ?>
38 38
 </div>
39 39
 <script>
40 40
     inji.onLoad(function () {
Please login to merge, or discard this patch.
system/modules/Ui/widgets/DataManager/DataManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     'style' => ''
23 23
 ];
24 24
 if (!empty($dataManager->managerOptions['categorys'])) {
25
-    $mainCol['style'].='margin-left:260px;';
25
+    $mainCol['style'] .= 'margin-left:260px;';
26 26
     echo '<div class ="pull-left dataManager-categorys" style = "width:250px;">';
27 27
     $this->widget('Ui\DataManager/categorys', compact('dataManager'));
28 28
     echo '</div>';
Please login to merge, or discard this patch.