Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/View/appAdminControllers/TemplateController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
             $content = file_get_contents($template->path . '/' . Tools::parsePath($_GET['path']));
32 32
             $this->libs->loadLib('Ace');
33 33
             $this->view->page(['content' => 'Template/edit', 'data' => compact('template', 'content')]);
34
-        } else {
34
+        }
35
+        else {
35 36
             $this->view->page(['content' => 'Template/chooseFile', 'data' => compact('template')]);
36 37
         }
37 38
     }
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/Template/chooseFile.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= $template->config['file']; ?>'>Основной файл темы</a>
3 3
 <hr/>
4 4
 <?php
5
-foreach ($template->config['css'] as $file) {
6
-    if (file_exists($template->path . '/css/' . $file)) {
5
+foreach ($template->config['css'] as $file) {
6
+    if (file_exists($template->path . '/css/' . $file)) {
7 7
         ?>
8 8
         <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= 'css/' . $file; ?>'><?= $file; ?></a>
9 9
         <?php
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,12 +11,13 @@
 block discarded – undo
11 11
     '',
12 12
     ''
13 13
 ]);
14
-if (!empty($templates['app']['installed']))
14
+if (!empty($templates['app']['installed'])) {
15 15
     foreach ($templates['app']['installed'] as $template => $name) {
16 16
         $table->addRow([
17 17
             $name,
18 18
             (empty($templates['app']['current']) || $templates['app']['current'] != $template) ? '<a href = "/admin/view/setDefault/' . $template . '">Установить по умолчанию</a>' : 'Тема по умолчанию',
19 19
             '<a href = "/admin/view/template/editFile/' . $template . '">Файлы</a> <a href = "/admin/view/editTemplate/' . $template . '">Редактировать</a>'
20 20
         ]);
21
+}
21 22
     }
22 23
 $table->draw();
Please login to merge, or discard this patch.
system/modules/View/objects/Template.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,8 @@
 block discarded – undo
165 165
     public function setModule($module = null) {
166 166
         if (!$module && !$this->module) {
167 167
             $this->module = \Module::$cur;
168
-        } else {
168
+        }
169
+        else {
169 170
             $this->module = $module;
170 171
         }
171 172
         if (is_string($this->module)) {
Please login to merge, or discard this patch.
system/modules/View/appControllers/ViewController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,8 @@
 block discarded – undo
13 13
     public function editorcssAction() {
14 14
         if (file_exists($this->view->template->path . '/css/editor.css')) {
15 15
             Tools::redirect('/static/templates/' . $this->view->template['name'] . '/css/editor.css');
16
-        } else {
16
+        }
17
+        else {
17 18
             header("Content-type: text/css");
18 19
             exit();
19 20
         }
Please login to merge, or discard this patch.
system/modules/StaticLoader/StaticLoader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@
 block discarded – undo
183 183
 
184 184
             $fileName = $fileinfo['filename'] . '.' . $fileinfo['extension'];
185 185
             if (App::$cur->db->connect) {
186
-                $fileObj = Files\File::get([ 'path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']);
186
+                $fileObj = Files\File::get(['path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']);
187 187
                 if ($fileObj) {
188 188
                     $fileName = $fileObj->original_name;
189 189
                 }
Please login to merge, or discard this patch.
Braces   +28 added lines, -17 removed lines patch added patch discarded remove patch
@@ -37,10 +37,12 @@  discard block
 block discarded – undo
37 37
                 $scriptApp->installed = true;
38 38
                 $scriptApp->params = [];
39 39
                 $scriptApp->config = Config::app($scriptApp);
40
-            } else {
40
+            }
41
+            else {
41 42
                 $scriptApp = \App::$cur;
42 43
             }
43
-        } else {
44
+        }
45
+        else {
44 46
             $scriptApp = \App::$cur->system ? \App::$primary : \App::$cur;
45 47
         }
46 48
 
@@ -107,30 +109,38 @@  discard block
 block discarded – undo
107 109
 
108 110
                 $sizes = explode('x', $_GET['resize']);
109 111
                 $sizes[0] = intval($sizes[0]);
110
-                if (isset($sizes[1]))
111
-                    $sizes[1] = intval($sizes[1]);
112
-                else
113
-                    $sizes[1] = 0;
112
+                if (isset($sizes[1])) {
113
+                                    $sizes[1] = intval($sizes[1]);
114
+                }
115
+                else {
116
+                                    $sizes[1] = 0;
117
+                }
114 118
 
115 119
                 if (!$sizes[0] || !$sizes[1]) {
116 120
                     header('HTTP/1.1 404 Not Found');
117 121
                     exit();
118
-                } elseif ($sizes[0] > 2000 || $sizes[1] > 2000) {
122
+                }
123
+                elseif ($sizes[0] > 2000 || $sizes[1] > 2000) {
119 124
                     header('HTTP/1.1 404 Not Found');
120 125
                     exit();
121
-                } else {
126
+                }
127
+                else {
122 128
                     $dir = App::$primary->path;
123 129
 
124 130
                     if (!empty($_GET['resize_crop'])) {
125
-                        if (in_array($_GET['resize_crop'], array('q', 'c')))
126
-                            $crop = $_GET['resize_crop'];
127
-                        else
128
-                            $crop = 'c';
131
+                        if (in_array($_GET['resize_crop'], array('q', 'c'))) {
132
+                                                    $crop = $_GET['resize_crop'];
133
+                        }
134
+                        else {
135
+                                                    $crop = 'c';
136
+                        }
137
+                    }
138
+                    elseif (!empty($_GET['resize_quadro'])) {
139
+                                            $crop = 'q';
140
+                    }
141
+                    else {
142
+                                            $crop = '';
129 143
                     }
130
-                    elseif (!empty($_GET['resize_quadro']))
131
-                        $crop = 'q';
132
-                    else
133
-                        $crop = '';
134 144
                     $pos = 'center';
135 145
                     if (!empty($_GET['resize_pos']) && in_array($_GET['resize_pos'], array('top', 'center'))) {
136 146
                         $pos = $_GET['resize_pos'];
@@ -155,7 +165,8 @@  discard block
 block discarded – undo
155 165
 
156 166
             // Преобразуем запрос клиента If-Modified-Since в таймштамп
157 167
             $modifiedSince = strtotime($modifiedSince[0]);
158
-        } else {
168
+        }
169
+        else {
159 170
             // Устанавливаем время модификации в ноль
160 171
             $modifiedSince = 0;
161 172
         }
Please login to merge, or discard this patch.
system/modules/StaticLoader/Controllers/StaticLoaderController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,8 @@
 block discarded – undo
17 17
         }
18 18
         if (!file_exists($path)) {
19 19
             Tools::header(404, true);
20
-        } else {
20
+        }
21
+        else {
21 22
             $this->module->giveFile($path);
22 23
         }
23 24
     }
Please login to merge, or discard this patch.
system/modules/Db/objects/Mysql/Result.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@  discard block
 block discarded – undo
18 18
     public function getArray($keyCol = '') {
19 19
         if (!$keyCol) {
20 20
             return $this->pdoResult->fetchAll(\PDO::FETCH_ASSOC);
21
-        } else {
21
+        }
22
+        else {
22 23
             $array = [];
23 24
             while ($row = $this->pdoResult->fetch(\PDO::FETCH_ASSOC)) {
24 25
                 $array[$row[$keyCol]] = $row;
@@ -33,7 +34,8 @@  discard block
 block discarded – undo
33 34
         while ($object = $this->pdoResult->fetchObject($class)) {
34 35
             if ($keyCol) {
35 36
                 $array[$object->$keyCol] = $object;
36
-            } else {
37
+            }
38
+            else {
37 39
                 $array[] = $object;
38 40
             }
39 41
         }
@@ -44,7 +46,8 @@  discard block
 block discarded – undo
44 46
     public function fetch($className = '') {
45 47
         if ($className) {
46 48
             return $this->pdoResult->fetchObject($className);
47
-        } else {
49
+        }
50
+        else {
48 51
             return $this->pdoResult->fetch(\PDO::FETCH_ASSOC);
49 52
         }
50 53
     }
Please login to merge, or discard this patch.
system/modules/Db/Db.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,11 +15,13 @@
 block discarded – undo
15 15
             $param = isset($this->config['default']) ? $this->config['default'] : 'local';
16 16
         }
17 17
         if (!is_array($param)) {
18
-            if (!($dbOption = Db\Options::get($param, 'connect_alias', ['array' => true])))
19
-                return false;
18
+            if (!($dbOption = Db\Options::get($param, 'connect_alias', ['array' => true]))) {
19
+                            return false;
20
+            }
20 21
 
21 22
             $db = $dbOption;
22
-        } else {
23
+        }
24
+        else {
23 25
             $db = $param;
24 26
         }
25 27
         $className = 'Db\\' . $db['driver'];
Please login to merge, or discard this patch.