@@ -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'] = []; |
@@ -6,8 +6,9 @@ |
||
6 | 6 | $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
7 | 7 | foreach ($systemModules as $module) { |
8 | 8 | $info = Module::getInfo($module); |
9 | - if (!$info || isset($modules[$module])) |
|
10 | - continue; |
|
9 | + if (!$info || isset($modules[$module])) { |
|
10 | + continue; |
|
11 | + } |
|
11 | 12 | ?> |
12 | 13 | <div class ="form-group"> |
13 | 14 | <div class="checkbox"> |
@@ -16,8 +16,9 @@ |
||
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; |
@@ -42,10 +42,11 @@ |
||
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 | ?> |
@@ -13,20 +13,22 @@ |
||
13 | 13 | static function genArray($data, $level = 0) |
14 | 14 | { |
15 | 15 | $return = ''; |
16 | - if ($level == 0) |
|
17 | - $return = "["; |
|
16 | + if ($level == 0) { |
|
17 | + $return = "["; |
|
18 | + } |
|
18 | 19 | foreach ($data as $key => $item) { |
19 | 20 | $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "'{$key}' => "; |
20 | - if (!is_array($item)) |
|
21 | - $return .= "'{$item}',"; |
|
22 | - else { |
|
21 | + if (!is_array($item)) { |
|
22 | + $return .= "'{$item}',"; |
|
23 | + } else { |
|
23 | 24 | $return .= "["; |
24 | 25 | $return .= rtrim(self::genArray($item, $level + 1), ','); |
25 | 26 | $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "],"; |
26 | 27 | } |
27 | 28 | } |
28 | - if ($level == 0) |
|
29 | - $return = rtrim($return, ',') . "\n];"; |
|
29 | + if ($level == 0) { |
|
30 | + $return = rtrim($return, ',') . "\n];"; |
|
31 | + } |
|
30 | 32 | |
31 | 33 | return $return; |
32 | 34 | } |
@@ -189,17 +189,20 @@ |
||
189 | 189 | |
190 | 190 | public function get($idn = false, $ltype = 'id') |
191 | 191 | { |
192 | - if (!$idn) |
|
193 | - return false; |
|
192 | + if (!$idn) { |
|
193 | + return false; |
|
194 | + } |
|
194 | 195 | |
195 | - if (is_numeric($idn) && $ltype != 'login') |
|
196 | - $user = Users\User::get($idn, 'id'); |
|
197 | - elseif ($ltype == 'login') |
|
198 | - $user = Users\User::get($idn, 'login'); |
|
199 | - else |
|
200 | - $user = Users\User::get($idn, 'mail'); |
|
201 | - if (!$user) |
|
202 | - return []; |
|
196 | + if (is_numeric($idn) && $ltype != 'login') { |
|
197 | + $user = Users\User::get($idn, 'id'); |
|
198 | + } elseif ($ltype == 'login') { |
|
199 | + $user = Users\User::get($idn, 'login'); |
|
200 | + } else { |
|
201 | + $user = Users\User::get($idn, 'mail'); |
|
202 | + } |
|
203 | + if (!$user) { |
|
204 | + return []; |
|
205 | + } |
|
203 | 206 | |
204 | 207 | return $user; |
205 | 208 | } |
@@ -2,27 +2,45 @@ |
||
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>Основной домен</label> |
13 | - <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) echo \App::$primary->config['site']['domain']; ?>' /> |
|
19 | + <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) { |
|
20 | + echo \App::$primary->config['site']['domain']; |
|
21 | +} |
|
22 | +?>' /> |
|
14 | 23 | </div> |
15 | 24 | <div class ="form-group"> |
16 | 25 | <label>Контактный email</label> |
17 | - <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) echo \App::$primary->config['site']['email']; ?>' /> |
|
26 | + <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) { |
|
27 | + echo \App::$primary->config['site']['email']; |
|
28 | +} |
|
29 | +?>' /> |
|
18 | 30 | </div> |
19 | 31 | <div class ="form-group"> |
20 | 32 | <label>Ключевые слова</label> |
21 | - <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) echo \App::$primary->config['site']['keywords']; ?>' /> |
|
33 | + <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) { |
|
34 | + echo \App::$primary->config['site']['keywords']; |
|
35 | +} |
|
36 | +?>' /> |
|
22 | 37 | </div> |
23 | 38 | <div class ="form-group"> |
24 | 39 | <label>Краткое описание сайта</label> |
25 | - <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' /> |
|
40 | + <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) { |
|
41 | + echo \App::$primary->config['site']['description']; |
|
42 | +} |
|
43 | +?>' /> |
|
26 | 44 | </div> |
27 | 45 | <?php |
28 | 46 | $form = new Ui\Form(); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (App::$cur->users->config['invites']) { |
|
3 | +if (App::$cur->users->config['invites']) { |
|
4 | 4 | return [ |
5 | 5 | 'name' => 'Мои партнеры', |
6 | 6 | 'fullWidget' => 'Users\cabinet/usersTree' |
@@ -2,8 +2,8 @@ |
||
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 |