Completed
Pull Request — master (#4)
by
unknown
05:09
created
system/modules/Sliders/widgets/slider.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@
 block discarded – undo
27 27
         ?>
28 28
         <div class="item <?= !$i ? 'active' : ''; ?>">
29 29
           <?php
30
-          if ($item->link) {
31
-              echo "<a href = '{$item->link}' style = 'display:inline-block;'>";
32
-          }
33
-          ?>
30
+            if ($item->link) {
31
+                echo "<a href = '{$item->link}' style = 'display:inline-block;'>";
32
+            }
33
+            ?>
34 34
           <img src="<?= Statics::file($item->image->path); ?>" alt="<?= $item->name; ?>">
35 35
           <div class="carousel-caption">
36 36
             <?= $item->description; ?>
37 37
           </div>
38 38
           <?php
39
-          if ($item->link) {
40
-              echo "</a>";
41
-          }
42
-          ?>
39
+            if ($item->link) {
40
+                echo "</a>";
41
+            }
42
+            ?>
43 43
         </div>
44 44
         <?php
45 45
         $i++;
Please login to merge, or discard this patch.
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 3 patches
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.
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.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -164,12 +164,12 @@
 block discarded – undo
164 164
             <li><a href ='' onclick='inji.Ui.dataManagers.get(this).rowSelection("inverse");return false;'>Инвертировать</a></li>
165 165
             <li role="separator" class="divider"></li>
166 166
               <?php
167
-              foreach ($actions as $action => $actionParams) {
168
-                  if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) {
169
-                      echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>";
170
-                  }
171
-              }
172
-              ?>
167
+                foreach ($actions as $action => $actionParams) {
168
+                    if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) {
169
+                        echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>";
170
+                    }
171
+                }
172
+                ?>
173 173
           </ul>
174 174
         </div>
175 175
         <?php
Please login to merge, or discard this patch.
system/modules/Ui/objects/Pages.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,10 +34,11 @@
 block discarded – undo
34 34
             $this->params['page'] = 1;
35 35
             if (!empty($this->data['page'])) {
36 36
                 $this->params['page'] = (int) $this->data['page'];
37
-                if ($this->params['page'] <= 0)
38
-                    $this->params['page'] = 1;
39
-                elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit']))
40
-                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
37
+                if ($this->params['page'] <= 0) {
38
+                                    $this->params['page'] = 1;
39
+                } elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) {
40
+                                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
41
+                }
41 42
             }
42 43
 
43 44
             $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit'];
Please login to merge, or discard this patch.
system/modules/Ui/widgets/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.