Completed
Push — master ( c0f2e9...bf06e8 )
by Alexey
05:57
created
system/modules/Ui/widgets/Form/select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     }
13 13
     if (
14 14
             (!is_array($primaryValue) && ($key === $primaryValue || (isset($form->userDataTree[$name]) && $form->userDataTree[$name] === $key))) ||
15
-            (is_array($primaryValue) && (in_array($key,$primaryValue) || (isset($form->userDataTree[$name]) && in_array($key,$form->userDataTree[$name]))))
15
+            (is_array($primaryValue) && (in_array($key, $primaryValue) || (isset($form->userDataTree[$name]) && in_array($key, $form->userDataTree[$name]))))
16 16
             ) {
17 17
         $selected = ' selected="selected"';
18 18
     }
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             $showedInput = count($aditionalInputs) - 1;
23 23
             $aditionValue = !empty($options['aditionalValue']) ? $options['aditionalValue'] : '';
24 24
         }
25
-        $optionsHtml .= "<option data-aditionalInput='" . ( count($aditionalInputs) - 1) . "' value ='{$key}'{$selected}>{$value['text']}</option>";
25
+        $optionsHtml .= "<option data-aditionalInput='" . (count($aditionalInputs) - 1) . "' value ='{$key}'{$selected}>{$value['text']}</option>";
26 26
     } else {
27 27
         $optionsHtml .= "<option value ='{$key}'{$selected}>{$value}</option>";
28 28
     }
Please login to merge, or discard this patch.
system/modules/Ui/widgets/Pages/pages.php 3 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
   }
6 6
 
7 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']) {
8
+      if (($i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
9 9
           echo '<li ';
10 10
           if ($pagesInstance->params['page'] == $i)
11 11
               echo 'class = "active"';
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
   for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
8 8
       if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
9 9
           echo '<li ';
10
-          if ($pagesInstance->params['page'] == $i)
11
-              echo 'class = "active"';
10
+          if ($pagesInstance->params['page'] == $i) {
11
+                        echo 'class = "active"';
12
+          }
12 13
           echo ">";
13 14
           $getArr['page'] = $i;
14 15
           echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
15
-      }
16
-      elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
16
+      } elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
17 17
           $getArr['page'] = round($pagesInstance->params['page'] / 2);
18 18
           echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
19 19
       } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
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.
system/modules/UserForms/UserForms.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $text = '';
44 44
                 foreach ($form->inputs as $input) {
45 45
                     if (isset($inputs['input' . $input->id])) {
46
-                        $text .="<b>{$input->label}:</b> " . htmlspecialchars($inputs['input' . $input->id]) . "<br />";
46
+                        $text .= "<b>{$input->label}:</b> " . htmlspecialchars($inputs['input' . $input->id]) . "<br />";
47 47
                     }
48 48
                 }
49 49
                 if ($text) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
         if (!empty($_POST['UserForms'])) {
17 17
             foreach ($_POST['UserForms'] as $form_id => $inputs) {
18 18
                 $form = \UserForms\Form::get((int) $form_id);
19
-                if (!$form)
20
-                    continue;
19
+                if (!$form) {
20
+                                    continue;
21
+                }
21 22
                 $formRecive = new \UserForms\Recive();
22 23
                 $formRecive->user_id = (int) \Users\User::$cur->id;
23 24
                 $formRecive->form_id = (int) $form_id;
Please login to merge, or discard this patch.
system/modules/UserForms/models/Form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
     static $cols = [
25 25
         'name' => ['type' => 'text'],
26 26
         'description' => ['type' => 'html'],
27
-        'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'],
28
-        'inputs' => [ 'type' => 'dataManager', 'relation' => 'inputs'],
27
+        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
28
+        'inputs' => ['type' => 'dataManager', 'relation' => 'inputs'],
29 29
         'date_create' => ['type' => 'dateTime'],
30 30
     ];
31 31
     static $dataManagers = [
Please login to merge, or discard this patch.
system/modules/UserForms/models/Input.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         'manager' => [
39 39
             'map' => [
40 40
                 ['label'],
41
-                ['type','required'],
41
+                ['type', 'required'],
42 42
             ]
43 43
         ]
44 44
     ];
Please login to merge, or discard this patch.
system/modules/UserForms/widgets/userForm.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,29 +14,29 @@
 block discarded – undo
14 14
 ?>
15 15
 <form method = "POST" action = "">
16 16
   <?php
17
-  if ($form->description) {
18
-      echo "<p class = 'text-center'>{$form->description}</p>";
19
-  }
20
-  foreach ($form->inputs as $input) {
21
-      switch ($input->type) {
22
-          case 'text':
17
+    if ($form->description) {
18
+        echo "<p class = 'text-center'>{$form->description}</p>";
19
+    }
20
+    foreach ($form->inputs as $input) {
21
+        switch ($input->type) {
22
+            case 'text':
23 23
               ?>
24 24
               <div class ='form-group'>
25 25
                 <label><?= $input->label; ?></label>
26 26
                 <input class ='form-control' type ='text' name ='UserForms[<?= (int) $form_id; ?>][input<?= $input->id; ?>]' <?= $input->required ? 'required' : ''; ?> />
27 27
               </div>
28 28
               <?php
29
-              break;
30
-          case 'textarea':
29
+                break;
30
+            case 'textarea':
31 31
               ?>
32 32
               <div class ='form-group'>
33 33
                 <label><?= $input->label; ?></label>
34 34
                 <textarea class ='form-control' name ='UserForms[<?= (int) $form_id; ?>][input<?= $input->id; ?>]' <?= $input->required ? 'required' : ''; ?> /></textarea>
35 35
               </div>
36 36
               <?php
37
-              break;
38
-      }
39
-  }
40
-  ?>
37
+                break;
38
+        }
39
+    }
40
+    ?>
41 41
   <button class = 'btn btn-success btn-block'>Отправить</button>
42 42
 </form>
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/Users/appAdminControllers/content/edit.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,11 @@
 block discarded – undo
42 42
                             <select class="form-control" name = 'user_role_id'>
43 43
                                 <?php
44 44
                                 foreach ($roles as $role) {
45
-                                    if ($role['role_id'] == $user->user_role_id)
46
-                                        $selected = 'selected = "selected"';
47
-                                    else
48
-                                        $selected = '';
45
+                                    if ($role['role_id'] == $user->user_role_id) {
46
+                                                                            $selected = 'selected = "selected"';
47
+                                    } else {
48
+                                                                            $selected = '';
49
+                                    }
49 50
                                     echo "<option {$selected} value = '{$role['role_id']}'>{$role['role_name']}</option>";
50 51
                                 }
51 52
                                 ?>
Please login to merge, or discard this patch.
system/modules/Users/appControllers/UsersController.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -168,20 +168,20 @@
 block discarded – undo
168 168
                 <h5 class="<?= $complete ? 'text-success' : 'text-danger'; ?>"><?= $condition->name(); ?></h5>
169 169
                 <ul>
170 170
                   <?php
171
-                  foreach ($condition->items as $item) {
172
-                      $itemComplete = $item->checkComplete($userId);
173
-                      switch ($item->type) {
174
-                          case 'event':
171
+                    foreach ($condition->items as $item) {
172
+                        $itemComplete = $item->checkComplete($userId);
173
+                        switch ($item->type) {
174
+                            case 'event':
175 175
                               $name = \Events\Event::get($item->value, 'event')->name();
176
-                              break;
177
-                      }
178
-                      ?>
176
+                                break;
177
+                        }
178
+                        ?>
179 179
                       <li> 
180 180
                         <b class="<?= $itemComplete ? 'text-success' : 'text-danger'; ?>"><?= $name; ?> <?= $item->recivedCount($userId); ?></b>/<?= $item->count; ?> <br />
181 181
                       </li>
182 182
                       <?php
183
-                  }
184
-                  ?>
183
+                    }
184
+                    ?>
185 185
                 </ul>
186 186
                 <?php
187 187
             }
Please login to merge, or discard this patch.