@@ -79,10 +79,12 @@ discard block |
||
79 | 79 | if (!empty($log['status'])) { |
80 | 80 | echo "<tr class = '{$log['status']}'><td>{$log['name']}</td><td>{$log['status']}</td></tr>"; |
81 | 81 | } else { |
82 | - if (empty($log['end'])) |
|
83 | - $log['end'] = microtime(true); |
|
84 | - if (empty($log['start'])) |
|
85 | - $log['start'] = microtime(true); |
|
82 | + if (empty($log['end'])) { |
|
83 | + $log['end'] = microtime(true); |
|
84 | + } |
|
85 | + if (empty($log['start'])) { |
|
86 | + $log['start'] = microtime(true); |
|
87 | + } |
|
86 | 88 | echo "<tr><td>{$log['name']}</td><td" . (round(($log['end'] - $log['start']), 5) > 0.1 ? ' class ="danger"' : '') . ">" . round(($log['end'] - $log['start']), 5) . "</td></tr>"; |
87 | 89 | } |
88 | 90 | } |
@@ -93,12 +95,13 @@ discard block |
||
93 | 95 | function convertSize($size) |
94 | 96 | { |
95 | 97 | |
96 | - if ($size < 1024) |
|
97 | - return $size . "B"; |
|
98 | - elseif ($size < 1048576) |
|
99 | - return round($size / 1024, 2) . "KB"; |
|
100 | - else |
|
101 | - return round($size / 1048576, 2) . "MB"; |
|
98 | + if ($size < 1024) { |
|
99 | + return $size . "B"; |
|
100 | + } elseif ($size < 1048576) { |
|
101 | + return round($size / 1024, 2) . "KB"; |
|
102 | + } else { |
|
103 | + return round($size / 1048576, 2) . "MB"; |
|
104 | + } |
|
102 | 105 | } |
103 | 106 | |
104 | 107 | function __destruct() |
@@ -52,8 +52,9 @@ |
||
52 | 52 | */ |
53 | 53 | static function get($clean = false) |
54 | 54 | { |
55 | - if (empty($_SESSION['_INJI_MSG'])) |
|
56 | - return []; |
|
55 | + if (empty($_SESSION['_INJI_MSG'])) { |
|
56 | + return []; |
|
57 | + } |
|
57 | 58 | $msgs = $_SESSION['_INJI_MSG']; |
58 | 59 | if ($clean) { |
59 | 60 | $_SESSION['_INJI_MSG'] = []; |
@@ -58,8 +58,9 @@ discard block |
||
58 | 58 | */ |
59 | 59 | static function createDir($path) |
60 | 60 | { |
61 | - if (file_exists($path)) |
|
62 | - return true; |
|
61 | + if (file_exists($path)) { |
|
62 | + return true; |
|
63 | + } |
|
63 | 64 | |
64 | 65 | $path = explode('/', $path); |
65 | 66 | $cur = ''; |
@@ -101,10 +102,11 @@ discard block |
||
101 | 102 | $imagecreatefromX = "imagecreatefrom{$img_type}"; |
102 | 103 | $src_res = $imagecreatefromX($img_path); |
103 | 104 | |
104 | - if ($img_width / $max_width > $img_height / $max_height) |
|
105 | - $separator = $img_width / $max_width; |
|
106 | - else |
|
107 | - $separator = $img_height / $max_height; |
|
105 | + if ($img_width / $max_width > $img_height / $max_height) { |
|
106 | + $separator = $img_width / $max_width; |
|
107 | + } else { |
|
108 | + $separator = $img_height / $max_height; |
|
109 | + } |
|
108 | 110 | |
109 | 111 | if ($crop === true || $crop == 'q') { |
110 | 112 | if ($img_width > $img_height) { |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | if (!$app) { |
16 | 16 | $app = $this->app->type; |
17 | 17 | } |
18 | - if (!empty($this->config['access']['accessTree'][$app]['deniedUrl'])) |
|
19 | - return $this->config['access']['accessTree'][$app]['deniedUrl']; |
|
18 | + if (!empty($this->config['access']['accessTree'][$app]['deniedUrl'])) { |
|
19 | + return $this->config['access']['accessTree'][$app]['deniedUrl']; |
|
20 | + } |
|
20 | 21 | |
21 | 22 | return '/'; |
22 | 23 | } |
@@ -50,8 +51,9 @@ discard block |
||
50 | 51 | return true; |
51 | 52 | } |
52 | 53 | |
53 | - if ((!$user->group_id && !empty($access)) || ($user->group_id && !empty($access) && !in_array($user->group_id, $access))) |
|
54 | - return false; |
|
54 | + if ((!$user->group_id && !empty($access)) || ($user->group_id && !empty($access) && !in_array($user->group_id, $access))) { |
|
55 | + return false; |
|
56 | + } |
|
55 | 57 | |
56 | 58 | return true; |
57 | 59 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <div class = 'callbacks'> |
2 | 2 | <h1>Отзывы</h1> |
3 | 3 | <?php |
4 | - $callbacks = Callbacks\Callback::getList(['where' => ['view', '1'], 'order' => ['weight', 'asc']]); |
|
5 | - foreach ($callbacks as $callback) { |
|
6 | - echo "<h3>{$callback->name}<div class = 'time'>{$callback->date_create}</div></h3>"; |
|
7 | - echo "<p>" . nl2br($callback->text) . "</p>"; |
|
8 | - } |
|
9 | - ?> |
|
4 | + $callbacks = Callbacks\Callback::getList(['where' => ['view', '1'], 'order' => ['weight', 'asc']]); |
|
5 | + foreach ($callbacks as $callback) { |
|
6 | + echo "<h3>{$callback->name}<div class = 'time'>{$callback->date_create}</div></h3>"; |
|
7 | + echo "<p>" . nl2br($callback->text) . "</p>"; |
|
8 | + } |
|
9 | + ?> |
|
10 | 10 | </div> |
11 | 11 | <h3>Можете и вы в свободной форме оставить свой отзыв</h3> |
12 | 12 | <?php |
@@ -17,9 +17,9 @@ |
||
17 | 17 | <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' /> |
18 | 18 | </div> |
19 | 19 | <?php |
20 | - $form = new Ui\Form(); |
|
21 | - $form->input('image', 'site_logo', 'Лого сайта', ['value' => !empty(\App::$primary->config['site']['site_logo']) ? \App::$primary->config['site']['site_logo'] : '']); |
|
22 | - ?> |
|
20 | + $form = new Ui\Form(); |
|
21 | + $form->input('image', 'site_logo', 'Лого сайта', ['value' => !empty(\App::$primary->config['site']['site_logo']) ? \App::$primary->config['site']['site_logo'] : '']); |
|
22 | + ?> |
|
23 | 23 | <h2>Дополнительные мета теги</h2> |
24 | 24 | <div class ="form-group"> |
25 | 25 | <button type = 'button' class = 'btn btn-primary ' onclick = 'addMeta()'>Добавить <i class = 'glyphicon glyphicon-plus'></i></button> |
@@ -2,23 +2,38 @@ |
||
2 | 2 | <form action = '' method = 'POST' enctype="multipart/form-data"> |
3 | 3 | <div class ="form-group"> |
4 | 4 | <label>Название сайта</label> |
5 | - <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) echo \App::$primary->config['site']['name']; ?>' /> |
|
5 | + <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) { |
|
6 | + echo \App::$primary->config['site']['name']; |
|
7 | +} |
|
8 | +?>' /> |
|
6 | 9 | </div> |
7 | 10 | <div class ="form-group"> |
8 | 11 | <label>Название компании</label> |
9 | - <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) echo \App::$primary->config['site']['company_name']; ?>' /> |
|
12 | + <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) { |
|
13 | + echo \App::$primary->config['site']['company_name']; |
|
14 | +} |
|
15 | +?>' /> |
|
10 | 16 | </div> |
11 | 17 | <div class ="form-group"> |
12 | 18 | <label>Контактный email</label> |
13 | - <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) echo \App::$primary->config['site']['email']; ?>' /> |
|
19 | + <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) { |
|
20 | + echo \App::$primary->config['site']['email']; |
|
21 | +} |
|
22 | +?>' /> |
|
14 | 23 | </div> |
15 | 24 | <div class ="form-group"> |
16 | 25 | <label>Ключевые слова</label> |
17 | - <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) echo \App::$primary->config['site']['keywords']; ?>' /> |
|
26 | + <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) { |
|
27 | + echo \App::$primary->config['site']['keywords']; |
|
28 | +} |
|
29 | +?>' /> |
|
18 | 30 | </div> |
19 | 31 | <div class ="form-group"> |
20 | 32 | <label>Краткое описание сайта</label> |
21 | - <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' /> |
|
33 | + <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) { |
|
34 | + echo \App::$primary->config['site']['description']; |
|
35 | +} |
|
36 | +?>' /> |
|
22 | 37 | </div> |
23 | 38 | <?php |
24 | 39 | $form = new Ui\Form(); |
@@ -16,8 +16,9 @@ |
||
16 | 16 | $param = isset($this->config['default']) ? $this->config['default'] : 'local'; |
17 | 17 | } |
18 | 18 | if (!is_array($param)) { |
19 | - if (!($dbOption = Db\Options::get($param, 'connect_alias', ['array' => true]))) |
|
20 | - return false; |
|
19 | + if (!($dbOption = Db\Options::get($param, 'connect_alias', ['array' => true]))) { |
|
20 | + return false; |
|
21 | + } |
|
21 | 22 | |
22 | 23 | $db = $dbOption; |
23 | 24 | } else { |
@@ -30,14 +30,18 @@ |
||
30 | 30 | public function init($connect_options) |
31 | 31 | { |
32 | 32 | extract($connect_options); |
33 | - if (isset($db_name)) |
|
34 | - $this->db_name = $db_name; |
|
35 | - if (isset($encoding)) |
|
36 | - $this->encoding = $encoding; |
|
37 | - if (isset($table_prefix)) |
|
38 | - $this->table_prefix = $table_prefix; |
|
39 | - if (isset($noConnectAbort)) |
|
40 | - $this->noConnectAbort = $noConnectAbort; |
|
33 | + if (isset($db_name)) { |
|
34 | + $this->db_name = $db_name; |
|
35 | + } |
|
36 | + if (isset($encoding)) { |
|
37 | + $this->encoding = $encoding; |
|
38 | + } |
|
39 | + if (isset($table_prefix)) { |
|
40 | + $this->table_prefix = $table_prefix; |
|
41 | + } |
|
42 | + if (isset($noConnectAbort)) { |
|
43 | + $this->noConnectAbort = $noConnectAbort; |
|
44 | + } |
|
41 | 45 | |
42 | 46 | $dsn = "mysql:host=$host;port=$port;dbname=$db_name;charset=$encoding"; |
43 | 47 | $dt = new \DateTime(); |
@@ -3,14 +3,14 @@ discard block |
||
3 | 3 | <ul class="nav nav-tabs" role="tablist"> |
4 | 4 | <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Настройки</a></li> |
5 | 5 | <?php |
6 | - $dataManagers = []; |
|
7 | - foreach ($managers as $manager) { |
|
8 | - $dataManager = new Ui\DataManager($manager); |
|
9 | - $dataManagers[$manager] = $dataManager; |
|
10 | - $code = 'tab_' . str_replace('\\', '_', $manager); |
|
11 | - echo "<li role='presentation'><a href='#{$code}' aria-controls='{$code}' role='tab' data-toggle='tab'>{$dataManager->name}</a></li>"; |
|
12 | - } |
|
13 | - ?> |
|
6 | + $dataManagers = []; |
|
7 | + foreach ($managers as $manager) { |
|
8 | + $dataManager = new Ui\DataManager($manager); |
|
9 | + $dataManagers[$manager] = $dataManager; |
|
10 | + $code = 'tab_' . str_replace('\\', '_', $manager); |
|
11 | + echo "<li role='presentation'><a href='#{$code}' aria-controls='{$code}' role='tab' data-toggle='tab'>{$dataManager->name}</a></li>"; |
|
12 | + } |
|
13 | + ?> |
|
14 | 14 | </ul> |
15 | 15 | <div class="tab-content"> |
16 | 16 | <div role="tabpanel" class="tab-pane fade in active" id="home"> |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | </script> |
53 | 53 | </div> |
54 | 54 | <?php |
55 | - foreach ($dataManagers as $manager => $dataManager) { |
|
56 | - $code = 'tab_' . str_replace('\\', '_', $manager); |
|
57 | - ?> |
|
55 | + foreach ($dataManagers as $manager => $dataManager) { |
|
56 | + $code = 'tab_' . str_replace('\\', '_', $manager); |
|
57 | + ?> |
|
58 | 58 | <div role="tabpanel" class="tab-pane fade" id="<?= $code; ?>"> |
59 | 59 | <?php |
60 | 60 | $dataManager->draw(); |
61 | 61 | ?> |
62 | 62 | </div> |
63 | 63 | <?php |
64 | - } |
|
65 | - ?> |
|
64 | + } |
|
65 | + ?> |
|
66 | 66 | </div> |
67 | 67 | |
68 | 68 |