@@ -35,7 +35,7 @@ |
||
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -require_once( INJI_SYSTEM_DIR . '/init.php' ); |
|
| 38 | +require_once(INJI_SYSTEM_DIR . '/init.php'); |
|
| 39 | 39 | /** |
| 40 | 40 | * System error messages |
| 41 | 41 | */ |
@@ -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'] = []; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | function parseColsForModel($cols = []) |
| 27 | 27 | { |
| 28 | - $modelCols = [ 'labels' => [], 'cols' => [], 'relations' => []]; |
|
| 28 | + $modelCols = ['labels' => [], 'cols' => [], 'relations' => []]; |
|
| 29 | 29 | foreach ($cols as $col) { |
| 30 | 30 | $modelCols['labels'][$col['code']] = $col['label']; |
| 31 | 31 | $colType = !empty($col['type']['primary']) ? $col['type']['primary'] : $col['type']; |
@@ -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 | } |
@@ -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 |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | <?php |
| 3 | 3 | $blocked = App::$cur->money->getUserBlocks(); |
| 4 | 4 | $wallets = App::$cur->money->getUserWallets(); |
| 5 | -foreach ($wallets as $wallet) {
|
|
| 5 | +foreach ($wallets as $wallet) { |
|
| 6 | 6 | ?> |
| 7 | 7 | <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br /> |
| 8 | 8 | <?php |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!empty($params[0])) {
|
|
| 2 | +if (!empty($params[0])) { |
|
| 3 | 3 | $form_id = $params[0]; |
| 4 | 4 | } |
| 5 | -if (empty($form_id)) {
|
|
| 5 | +if (empty($form_id)) { |
|
| 6 | 6 | echo('form not found');
|
| 7 | 7 | return; |
| 8 | 8 | } |
| 9 | 9 | $userForm = \UserForms\Form::get((int) $form_id); |
| 10 | -if (!$userForm) {
|
|
| 10 | +if (!$userForm) { |
|
| 11 | 11 | echo('form not found');
|
| 12 | 12 | return; |
| 13 | 13 | } |
@@ -15,10 +15,10 @@ discard block |
||
| 15 | 15 | $form->begin(); |
| 16 | 16 | ?> |
| 17 | 17 | <?php |
| 18 | -if ($userForm->description) {
|
|
| 18 | +if ($userForm->description) { |
|
| 19 | 19 | echo "<p class = 'text-center'>{$userForm->description}</p>";
|
| 20 | 20 | } |
| 21 | -foreach ($userForm->inputs(['order' => ['weight']]) as $input) {
|
|
| 21 | +foreach ($userForm->inputs(['order' => ['weight']]) as $input) { |
|
| 22 | 22 | $form->input($input->type, 'UserForms[' . (int) $form_id . '][input' . $input->id . ']', $input->label, ['required' => $input->required]); |
| 23 | 23 | } |
| 24 | 24 | ?> |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | echo('form not found');
|
| 7 | 7 | return; |
| 8 | 8 | } |
| 9 | -$userForm = \UserForms\Form::get((int)$form_id); |
|
| 9 | +$userForm = \UserForms\Form::get((int) $form_id); |
|
| 10 | 10 | if (!$userForm) {
|
| 11 | 11 | echo('form not found');
|
| 12 | 12 | return; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | echo "<p class = 'text-center'>{$userForm->description}</p>";
|
| 20 | 20 | } |
| 21 | 21 | foreach ($userForm->inputs(['order' => ['weight']]) as $input) {
|
| 22 | - $form->input($input->type, 'UserForms[' . (int)$form_id . '][input' . $input->id . ']', $input->label, ['required' => $input->required]); |
|
| 22 | + $form->input($input->type, 'UserForms[' . (int) $form_id . '][input' . $input->id . ']', $input->label, ['required' => $input->required]); |
|
| 23 | 23 | } |
| 24 | 24 | ?> |
| 25 | 25 | <button class='btn btn-success btn-block'>Отправить</button> |