@@ -12,9 +12,9 @@ |
||
12 | 12 | <div class ="category-materials"> |
13 | 13 | <div class ="row"> |
14 | 14 | <?php |
15 | - $i = 0; |
|
16 | - foreach ($materials as $material) { |
|
17 | - ?> |
|
15 | + $i = 0; |
|
16 | + foreach ($materials as $material) { |
|
17 | + ?> |
|
18 | 18 | <div class = "col-sm-6 category-material"> |
19 | 19 | <a class="category-material-name" href ="<?= $material->getHref(); ?>"><h3><?= $material->name; ?></h3></a> |
20 | 20 | <div class="category-material-preview"><?= $material->preview; ?></div> |
@@ -2,9 +2,9 @@ |
||
2 | 2 | <div class="row"> |
3 | 3 | <div class="col-md-3"> |
4 | 4 | <?php |
5 | - $category = $material->category; |
|
6 | - $this->widget('Materials\categoryTree', ['category' => $category]); |
|
7 | - ?> |
|
5 | + $category = $material->category; |
|
6 | + $this->widget('Materials\categoryTree', ['category' => $category]); |
|
7 | + ?> |
|
8 | 8 | </div> |
9 | 9 | <div class="col-md-9"> |
10 | 10 | <div class="content"> |
@@ -14,12 +14,12 @@ |
||
14 | 14 | <span class="caption">Вид:</span> |
15 | 15 | <span class="group"> |
16 | 16 | <?php |
17 | - for ($i = 2; $i < 5; $i++) { |
|
18 | - $curLimit = $limit * $i; |
|
19 | - $curQuery = http_build_query(array_merge($query, ['limit' => $curLimit])); |
|
20 | - echo " <a href='{$path}?{$curQuery}'>{$curLimit}</a> "; |
|
21 | - } |
|
22 | - ?> |
|
17 | + for ($i = 2; $i < 5; $i++) { |
|
18 | + $curLimit = $limit * $i; |
|
19 | + $curQuery = http_build_query(array_merge($query, ['limit' => $curLimit])); |
|
20 | + echo " <a href='{$path}?{$curQuery}'>{$curLimit}</a> "; |
|
21 | + } |
|
22 | + ?> |
|
23 | 23 | </span> |
24 | 24 | <span class="group"> |
25 | 25 | <a href ='#' onclick="inji.onLoad(function () { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | if ($file) { |
222 | 222 | $photoId = Tools::randomString(); |
223 | 223 | $value = '<a href = "' . $file->path . '" id="' . $photoId . '"><img src="' . $file->path . '?resize=60x120" /></a>'; |
224 | - $value .='<script>inji.onLoad(function(){$("#' . $photoId . '").fancybox();});</script>'; |
|
224 | + $value .= '<script>inji.onLoad(function(){$("#' . $photoId . '").fancybox();});</script>'; |
|
225 | 225 | } else { |
226 | 226 | $value = '<img src="/static/system/images/no-image.png?resize=60x120" />'; |
227 | 227 | } |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | $items[$item[$arrayKey]] = new $class($item); |
1111 | 1111 | } |
1112 | 1112 | if (!empty($options['order'])) { |
1113 | - usort($items, function($a, $b) use($options) { |
|
1113 | + usort($items, function ($a, $b) use($options) { |
|
1114 | 1114 | if ($a->{$options['order'][0]} > $b->{$options['order'][0]} && $options['order'][1] = 'asc') { |
1115 | 1115 | return 1; |
1116 | 1116 | } elseif ($a->{$options['order'][0]} < $b->{$options['order'][0]} && $options['order'][1] = 'asc') { |
@@ -1290,7 +1290,7 @@ discard block |
||
1290 | 1290 | } else { |
1291 | 1291 | $cols .= '*'; |
1292 | 1292 | } |
1293 | - $cols .=') as `count`' . (!empty($options['cols']) ? ',' . $options['cols'] : ''); |
|
1293 | + $cols .= ') as `count`' . (!empty($options['cols']) ? ',' . $options['cols'] : ''); |
|
1294 | 1294 | $query->cols = $cols; |
1295 | 1295 | if (!empty($options['group'])) { |
1296 | 1296 | $query->group($options['group']); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | $this->info = $this->getInfo(); |
72 | 72 | $this->config = Config::module($this->moduleName, !empty($this->info['systemConfig'])); |
73 | 73 | $that = $this; |
74 | - Inji::$inst->listen('Config-change-module-' . $this->app->name . '-' . $this->moduleName, $this->app->name . '-' . $this->moduleName . 'config', function($event) use ($that) { |
|
74 | + Inji::$inst->listen('Config-change-module-' . $this->app->name . '-' . $this->moduleName, $this->app->name . '-' . $this->moduleName . 'config', function ($event) use ($that) { |
|
75 | 75 | $that->config = $event['eventObject']; |
76 | 76 | return $event['eventObject']; |
77 | 77 | }); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | define('INJI_DOMAIN_NAME', $_SERVER['SERVER_NAME']); |
14 | 14 | |
15 | -spl_autoload_register(function($class_name) { |
|
15 | +spl_autoload_register(function ($class_name) { |
|
16 | 16 | if (file_exists(INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php')) { |
17 | 17 | include_once INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php'; |
18 | 18 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | //load core |
22 | 22 | Inji::$inst = new Inji(); |
23 | 23 | Inji::$config = Config::system(); |
24 | -Inji::$inst->listen('Config-change-system', 'systemConfig', function($event) { |
|
24 | +Inji::$inst->listen('Config-change-system', 'systemConfig', function ($event) { |
|
25 | 25 | Inji::$config = $event['eventObject']; |
26 | 26 | return $event['eventObject']; |
27 | 27 | }); |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | App::$cur->params = array_slice($params, 1); |
71 | 71 | App::$cur->config = Config::app(App::$cur); |
72 | 72 | |
73 | - Inji::$inst->listen('Config-change-app-' . App::$primary->name, 'primaryAppConfig', function($event) { |
|
73 | + Inji::$inst->listen('Config-change-app-' . App::$primary->name, 'primaryAppConfig', function ($event) { |
|
74 | 74 | App::$primary->config = $event['eventObject']; |
75 | 75 | return $event['eventObject']; |
76 | 76 | }); |
77 | 77 | } |
78 | -Inji::$inst->listen('Config-change-app-' . App::$cur->name, 'curAppConfig', function($event) { |
|
78 | +Inji::$inst->listen('Config-change-app-' . App::$cur->name, 'curAppConfig', function ($event) { |
|
79 | 79 | App::$cur->config = $event['eventObject']; |
80 | 80 | return $event['eventObject']; |
81 | 81 | }); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | - 'accessCheck' => function() { |
|
3 | + 'accessCheck' => function () { |
|
4 | 4 | if (!class_exists('Users\User')) { |
5 | 5 | return false; |
6 | 6 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | return true; |
36 | 36 | }, |
37 | - 'widget' => function() { |
|
37 | + 'widget' => function () { |
|
38 | 38 | ?> |
39 | 39 | <div class="panel panel-default"> |
40 | 40 | <div class="panel-heading">Общие настройки сайта</div> |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | public static function validators() { |
113 | 113 | return [ |
114 | - 'userSearch' => function($activeForm, $request) { |
|
114 | + 'userSearch' => function ($activeForm, $request) { |
|
115 | 115 | if (empty($request['userSearch'])) { |
116 | 116 | throw new \Exception('Не указан получатель'); |
117 | 117 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | return true; |
129 | 129 | }, |
130 | - 'amount' => function($activeForm, $request) { |
|
130 | + 'amount' => function ($activeForm, $request) { |
|
131 | 131 | if (empty($request['amount'])) { |
132 | 132 | throw new \Exception('Не указана сумма'); |
133 | 133 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | return true; |
156 | 156 | }, |
157 | - 'commentClean' => function($activeForm, &$request) { |
|
157 | + 'commentClean' => function ($activeForm, &$request) { |
|
158 | 158 | $request['comment'] = trim(htmlspecialchars(urldecode($request['comment']))); |
159 | 159 | } |
160 | 160 | ]; |
@@ -46,18 +46,18 @@ |
||
46 | 46 | switch ($reward->round_type) { |
47 | 47 | case 'round': |
48 | 48 | $finalSum = round($finalSum, $reward->round_precision); |
49 | - $amount = $finalSum / 100 * (float)$level->params['amount']->value; |
|
49 | + $amount = $finalSum / 100 * (float) $level->params['amount']->value; |
|
50 | 50 | break; |
51 | 51 | case 'floor': |
52 | 52 | $finalSum = floor($finalSum); |
53 | - $amount = $finalSum / 100 * (float)$level->params['amount']->value; |
|
53 | + $amount = $finalSum / 100 * (float) $level->params['amount']->value; |
|
54 | 54 | break; |
55 | 55 | default: |
56 | - $amount = $finalSum / 100 * (float)$level->params['amount']->value; |
|
56 | + $amount = $finalSum / 100 * (float) $level->params['amount']->value; |
|
57 | 57 | } |
58 | 58 | break; |
59 | 59 | case 'amount': |
60 | - $amount = (float)$level->params['amount']->value; |
|
60 | + $amount = (float) $level->params['amount']->value; |
|
61 | 61 | } |
62 | 62 | if (!$amount) { |
63 | 63 | return 0; |
@@ -16,34 +16,34 @@ discard block |
||
16 | 16 | 'type' => 'decimal' |
17 | 17 | ] |
18 | 18 | ], |
19 | - 'viewer' => function ($level) { |
|
19 | + 'viewer' => function ($level) { |
|
20 | 20 | $levelTypes = [ |
21 | 21 | 'procent' => 'Процент', |
22 | 22 | 'amount' => 'Сумма', |
23 | 23 | ]; |
24 | 24 | return $levelTypes[$level->params['type']->value] . ': ' . $level->params['amount']->value . ' ' . ($level->params['type']->value == 'procent' ? '%' : ($level->params['currency_id']->value ? \Money\Currency::get($level->params['currency_id']->value)->acronym() : '')); |
25 | 25 | }, |
26 | - 'rewarder' => function ($reward, $sums, $user, $rootUser, $level, $rewardGet) { |
|
26 | + 'rewarder' => function ($reward, $sums, $user, $rootUser, $level, $rewardGet) { |
|
27 | 27 | $wallets = \App::$cur->money->getUserWallets($user->id); |
28 | 28 | $amount = 0; |
29 | - if (!empty($wallets[$level->params['currency_id']->value])) { |
|
30 | - switch ($level->params['type']->value) { |
|
29 | + if (!empty($wallets[$level->params['currency_id']->value])) { |
|
30 | + switch ($level->params['type']->value) { |
|
31 | 31 | case 'procent': |
32 | 32 | $finalSum = 0; |
33 | - foreach ($sums as $currency_id => $sum) { |
|
34 | - if ($currency_id != $level->params['currency_id']->value) { |
|
33 | + foreach ($sums as $currency_id => $sum) { |
|
34 | + if ($currency_id != $level->params['currency_id']->value) { |
|
35 | 35 | $rate = \Money\Currency\ExchangeRate::get([ |
36 | 36 | ['currency_id', $currency_id], |
37 | 37 | ['target_currency_id', $level->params['currency_id']->value], |
38 | 38 | ]); |
39 | - if ($rate) { |
|
39 | + if ($rate) { |
|
40 | 40 | $finalSum += $sum * $rate->rate; |
41 | 41 | } |
42 | - } else { |
|
42 | + } else { |
|
43 | 43 | $finalSum += $sum; |
44 | 44 | } |
45 | 45 | } |
46 | - switch ($reward->round_type) { |
|
46 | + switch ($reward->round_type) { |
|
47 | 47 | case 'round': |
48 | 48 | $finalSum = round($finalSum, $reward->round_precision); |
49 | 49 | $amount = $finalSum / 100 * (float)$level->params['amount']->value; |
@@ -59,33 +59,33 @@ discard block |
||
59 | 59 | case 'amount': |
60 | 60 | $amount = (float)$level->params['amount']->value; |
61 | 61 | } |
62 | - if (!$amount) { |
|
62 | + if (!$amount) { |
|
63 | 63 | return 0; |
64 | 64 | } |
65 | 65 | |
66 | 66 | $text = 'Вознаграждение по программе "' . $reward->name . '"'; |
67 | - if ($rootUser->id != $user->id) { |
|
67 | + if ($rootUser->id != $user->id) { |
|
68 | 68 | $text .= ' от ' . $rootUser->name(); |
69 | 69 | } |
70 | 70 | |
71 | - if (!$rewardGet && $reward->block) { |
|
71 | + if (!$rewardGet && $reward->block) { |
|
72 | 72 | $block = new \Money\Wallet\Block(); |
73 | 73 | $block->wallet_id = $wallets[$level->params['currency_id']->value]->id; |
74 | 74 | $block->amount = $amount; |
75 | 75 | $block->comment = $text; |
76 | 76 | $block->data = 'reward:' . $reward->id; |
77 | 77 | $dateGenerators = \App::$cur->money->getSnippets('expiredDateGenerator'); |
78 | - if ($reward->block_date_expired && !empty($dateGenerators[$reward->block_date_expired])) { |
|
78 | + if ($reward->block_date_expired && !empty($dateGenerators[$reward->block_date_expired])) { |
|
79 | 79 | $date = $dateGenerators[$reward->block_date_expired]($reward, $user); |
80 | - if (!empty($date['date'])) { |
|
80 | + if (!empty($date['date'])) { |
|
81 | 81 | $block->date_expired = $date['date']; |
82 | 82 | } |
83 | - if (!empty($date['type'])) { |
|
83 | + if (!empty($date['type'])) { |
|
84 | 84 | $block->expired_type = $date['type']; |
85 | 85 | } |
86 | 86 | } |
87 | 87 | $block->save(); |
88 | - } else { |
|
88 | + } else { |
|
89 | 89 | $wallets[$level->params['currency_id']->value]->diff($amount, $text); |
90 | 90 | } |
91 | 91 | \App::$cur->users->AddUserActivity($user->id, 4, $text . '<br />' . $amount . ' ' . $wallets[$level->params['currency_id']->value]->currency->acronym()); |