Completed
Push — master ( 604db9...9db94b )
by Alexey
07:34
created
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 1 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', 'desc']]) as $comment) {
65
-      ?>
61
+    foreach (\Dashboard\Comment::getList([ 'where' => [
62
+            ['item_id', $item->id],
63
+            ['model', $modelName],
64
+        ], 'order' => ['date', '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/DataManager.php 1 patch
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.
system/modules/Ui/objects/Tree.php 1 patch
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.
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/filters.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -127,40 +127,40 @@
 block discarded – undo
127 127
                     ?>
128 128
                     <div class="filter_form_field filter_select">
129 129
                       <?php
130
-                      if (!empty($_GET['datamanagerFilters'][$col]['value'])) {
131
-                          $value = 1;
132
-                      } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) {
133
-                          $value = 0;
134
-                      } else {
135
-                          $value = '';
136
-                      }
137
-                      $inputOptions = ['value' => $value, 'values' => [
138
-                              '' => 'Не важно',
139
-                              '1' => $colInfo['label'],
140
-                              '0' => 'Нет'
141
-                          ]
142
-                      ];
143
-                      if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
130
+                        if (!empty($_GET['datamanagerFilters'][$col]['value'])) {
131
+                            $value = 1;
132
+                        } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) {
133
+                            $value = 0;
134
+                        } else {
135
+                            $value = '';
136
+                        }
137
+                        $inputOptions = ['value' => $value, 'values' => [
138
+                                '' => 'Не важно',
139
+                                '1' => $colInfo['label'],
140
+                                '0' => 'Нет'
141
+                            ]
142
+                        ];
143
+                        if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
144 144
 
145
-                          $inputOptions['disabled'] = true;
146
-                          $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
147
-                          if (!empty($colOptions['userCol'])) {
148
-                              if (strpos($colOptions['userCol'], ':')) {
149
-                                  $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
150
-                                  $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
145
+                            $inputOptions['disabled'] = true;
146
+                            $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
147
+                            if (!empty($colOptions['userCol'])) {
148
+                                if (strpos($colOptions['userCol'], ':')) {
149
+                                    $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
150
+                                    $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
151 151
 
152
-                                  $inputOptions['value'] = \Users\User::$cur->$rel->$param;
153
-                              } else {
154
-                                  $this->model->$col = \Users\User::$cur->{$preset['userCol']};
155
-                              }
156
-                          } elseif (!empty($colOptions['value'])) {
152
+                                    $inputOptions['value'] = \Users\User::$cur->$rel->$param;
153
+                                } else {
154
+                                    $this->model->$col = \Users\User::$cur->{$preset['userCol']};
155
+                                }
156
+                            } elseif (!empty($colOptions['value'])) {
157 157
 
158
-                              $inputOptions['value'] = $colOptions['value'];
159
-                          }
160
-                      }
161
-                      $inputOptions['class'] = 'input-sm';
162
-                      $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
163
-                      ?>
158
+                                $inputOptions['value'] = $colOptions['value'];
159
+                            }
160
+                        }
161
+                        $inputOptions['class'] = 'input-sm';
162
+                        $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
163
+                        ?>
164 164
                     </div>
165 165
 
166 166
                     <?php
Please login to merge, or discard this patch.
system/modules/Ui/widgets/DataManager/rowButtons.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
                     <a href ="#" onclick='inji.Ui.forms.popUp("<?= addcslashes($modelName, '\\') . ":{$item->pk()}\"," . json_encode($formParams) ?>);
35 35
                                   return false;'><i class='glyphicon glyphicon-edit'></i></a>
36 36
                        <?php
37
-                   }
37
+                    }
38 38
 
39
-                   break;
40
-               case 'delete':
39
+                    break;
40
+                case 'delete':
41 41
                    ?>
42 42
                 <a href ="#" onclick='inji.Ui.dataManagers.get(this).delRow(<?= $item->pk(); ?>);
43 43
                       return false;'><i class='glyphicon glyphicon-remove'></i></a>
Please login to merge, or discard this patch.
system/modules/Ui/widgets/Pages/pages.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@
 block discarded – undo
1 1
 <ul class="<?= $class; ?>"><?php
2
-  if ($pagesInstance->params['page'] > 1) {
3
-      $getArr['page'] = $pagesInstance->params['page'] - 1;
4
-      echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&larr;</a></li>";
5
-  }
2
+    if ($pagesInstance->params['page'] > 1) {
3
+        $getArr['page'] = $pagesInstance->params['page'] - 1;
4
+        echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&larr;</a></li>";
5
+    }
6 6
 
7
-  for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
8
-      if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
9
-          echo '<li ';
10
-          if ($pagesInstance->params['page'] == $i)
11
-              echo 'class = "active"';
12
-          echo ">";
13
-          $getArr['page'] = $i;
14
-          echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
15
-      }
16
-      elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
17
-          $getArr['page'] = round($pagesInstance->params['page'] / 2);
18
-          echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
19
-      } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
20
-          $getArr['page'] = round(($pagesInstance->params['pages'] - $pagesInstance->params['page']) / 2) + $pagesInstance->params['page'];
21
-          echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
22
-      }
23
-  }
24
-  if ($pagesInstance->params['page'] < $pagesInstance->params['pages']) {
25
-      $getArr['page'] = $pagesInstance->params['page'] + 1;
26
-      echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&rarr;</a></li>";
27
-  }
28
-  ?></ul>
29 7
\ No newline at end of file
8
+    for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
9
+        if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
10
+            echo '<li ';
11
+            if ($pagesInstance->params['page'] == $i)
12
+                echo 'class = "active"';
13
+            echo ">";
14
+            $getArr['page'] = $i;
15
+            echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
16
+        }
17
+        elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
18
+            $getArr['page'] = round($pagesInstance->params['page'] / 2);
19
+            echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
20
+        } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
21
+            $getArr['page'] = round(($pagesInstance->params['pages'] - $pagesInstance->params['page']) / 2) + $pagesInstance->params['page'];
22
+            echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
23
+        }
24
+    }
25
+    if ($pagesInstance->params['page'] < $pagesInstance->params['pages']) {
26
+        $getArr['page'] = $pagesInstance->params['page'] + 1;
27
+        echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&rarr;</a></li>";
28
+    }
29
+    ?></ul>
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/Ui/widgets/Table/body.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@
 block discarded – undo
5 5
           <div class ='pull-right'>
6 6
             <div class="btn-group">
7 7
               <?php
8
-              $html = '';
9
-              foreach ($table->buttons as $button) {
10
-                  $html .= '<a class = "btn btn-primary btn-sm"';
11
-                  if (!empty($button['href'])) {
12
-                      $html .= " href = '{$button['href']}'";
13
-                  }
14
-                  if (!empty($button['onclick'])) {
15
-                      $html .= " onclick = '{$button['onclick']}'";
16
-                  }
17
-                  $html .= ">{$button['text']}</a> ";
18
-              }
19
-              echo $html;
20
-              ?>
8
+                $html = '';
9
+                foreach ($table->buttons as $button) {
10
+                    $html .= '<a class = "btn btn-primary btn-sm"';
11
+                    if (!empty($button['href'])) {
12
+                        $html .= " href = '{$button['href']}'";
13
+                    }
14
+                    if (!empty($button['onclick'])) {
15
+                        $html .= " onclick = '{$button['onclick']}'";
16
+                    }
17
+                    $html .= ">{$button['text']}</a> ";
18
+                }
19
+                echo $html;
20
+                ?>
21 21
             </div>
22 22
           </div>
23 23
       <?php } ?>
Please login to merge, or discard this patch.