@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if (empty($blocks[$block->wallet->currency_id])) { |
103 | 103 | $blocks[$block->wallet->currency_id] = $block->amount; |
104 | 104 | } else { |
105 | - $blocks[$block->wallet->currency_id]+= $block->amount; |
|
105 | + $blocks[$block->wallet->currency_id] += $block->amount; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | return $blocks; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $rootUser = $rootUser ? $rootUser : \Users\User::$cur; |
169 | 169 | $reward = \Money\Reward::get($reward_id); |
170 | 170 | $reward->checkBlocked(); |
171 | - $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id]]); |
|
171 | + $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]); |
|
172 | 172 | if ($reward_count >= $reward->quantity && $reward->quantity) |
173 | 173 | return false; |
174 | 174 | $types = $this->getSnippets('rewardType'); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]); |
190 | 190 | $amount = 0; |
191 | 191 | foreach ($recives as $recive) { |
192 | - $amount+=$recive->amount; |
|
192 | + $amount += $recive->amount; |
|
193 | 193 | } |
194 | 194 | if ($amount >= $reward->peruser) { |
195 | 195 | continue; |
@@ -61,21 +61,21 @@ |
||
61 | 61 | if ($first) { |
62 | 62 | $first = false; |
63 | 63 | } else { |
64 | - $string.= '<br />'; |
|
64 | + $string .= '<br />'; |
|
65 | 65 | } |
66 | - $string.= '<span style="white-space:nowrap;">'; |
|
67 | - $string.= number_format($sum, 2, '.', ' '); |
|
66 | + $string .= '<span style="white-space:nowrap;">'; |
|
67 | + $string .= number_format($sum, 2, '.', ' '); |
|
68 | 68 | if (\App::$cur->money) { |
69 | 69 | $currency = \Money\Currency::get($currency_id); |
70 | 70 | if ($currency) { |
71 | - $string.= ' ' . $currency->acronym(); |
|
71 | + $string .= ' ' . $currency->acronym(); |
|
72 | 72 | } else { |
73 | - $string.= ' руб.'; |
|
73 | + $string .= ' руб.'; |
|
74 | 74 | } |
75 | 75 | } else { |
76 | - $string.= ' руб.'; |
|
76 | + $string .= ' руб.'; |
|
77 | 77 | } |
78 | - $string.= '</span>'; |
|
78 | + $string .= '</span>'; |
|
79 | 79 | } |
80 | 80 | return $string; |
81 | 81 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return function ($step = NULL, $params = []) { |
|
3 | +return function($step = NULL, $params = []) { |
|
4 | 4 | |
5 | 5 | $groups = [ |
6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return function ($step = NULL, $params = []) { |
|
3 | +return function ($step = null, $params = []) { |
|
4 | 4 | App::$cur->db->createTable('notifications_notification', [ |
5 | 5 | 'notification_id' => 'pk', |
6 | 6 | 'notification_chanel_id' => 'int(11) UNSIGNED NOT NULL', |
@@ -132,7 +132,7 @@ |
||
132 | 132 | * Get installed modules for app |
133 | 133 | * |
134 | 134 | * @param \App $app |
135 | - * @param boolean|\App $primary |
|
135 | + * @param App $primary |
|
136 | 136 | * @return array |
137 | 137 | */ |
138 | 138 | public static function getInstalled($app, $primary = false) |
@@ -81,7 +81,7 @@ |
||
81 | 81 | return true; |
82 | 82 | } |
83 | 83 | } |
84 | - return FALSE; |
|
84 | + return false; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -11,6 +11,10 @@ |
||
11 | 11 | |
12 | 12 | function indexAction() { |
13 | 13 | |
14 | + /** |
|
15 | + * @param DOMDocument $xml |
|
16 | + * @param string $nodeName |
|
17 | + */ |
|
14 | 18 | function addToXml($xml, $parent, $nodeName, $text) { |
15 | 19 | $node = $parent->appendChild($xml->createElement($nodeName)); |
16 | 20 | $node->appendChild($xml->createTextNode($text)); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | if ($type->allow_resize && $type->options && json_decode($type->options, true)) { |
60 | 60 | $typeOptions = json_decode($type->options, true); |
61 | - list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($sitePath . $fileObject->path); |
|
61 | + list($img_width, $img_height, $img_type, $img_tag) = getimagesize($sitePath . $fileObject->path); |
|
62 | 62 | if ($img_height > $typeOptions['max_height'] || $img_width > $typeOptions['max_width']) { |
63 | 63 | Tools::resizeImage($sitePath . $fileObject->path, $typeOptions['max_width'], $typeOptions['max_height']); |
64 | 64 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | if ($type->allow_resize && $type->options && json_decode($type->options, true)) { |
122 | 122 | $typeOptions = json_decode($type->options, true); |
123 | - list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($sitePath . $fileObject->path); |
|
123 | + list($img_width, $img_height, $img_type, $img_tag) = getimagesize($sitePath . $fileObject->path); |
|
124 | 124 | if ($img_height > $typeOptions['max_height'] || $img_width > $typeOptions['max_width']) { |
125 | 125 | Tools::resizeImage($sitePath . $fileObject->path, $typeOptions['max_width'], $typeOptions['max_height']); |
126 | 126 | } |
@@ -22,16 +22,19 @@ discard block |
||
22 | 22 | |
23 | 23 | $sitePath = App::$primary->path; |
24 | 24 | |
25 | - if (!is_uploaded_file($file['tmp_name'])) |
|
26 | - return 0; |
|
25 | + if (!is_uploaded_file($file['tmp_name'])) { |
|
26 | + return 0; |
|
27 | + } |
|
27 | 28 | |
28 | 29 | $fileinfo = pathinfo($file['name']); |
29 | - if (empty($fileinfo['extension'])) |
|
30 | - return 0; |
|
30 | + if (empty($fileinfo['extension'])) { |
|
31 | + return 0; |
|
32 | + } |
|
31 | 33 | |
32 | 34 | $type = Files\Type::get($fileinfo['extension'], 'ext'); |
33 | - if (!$type) |
|
34 | - return 0; |
|
35 | + if (!$type) { |
|
36 | + return 0; |
|
37 | + } |
|
35 | 38 | |
36 | 39 | if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) { |
37 | 40 | return 0; |
@@ -47,8 +50,9 @@ discard block |
||
47 | 50 | } |
48 | 51 | $fileObject->name = $fileinfo['filename']; |
49 | 52 | $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension']; |
50 | - if ($fileObject->id && file_exists($sitePath . $fileObject->path)) |
|
51 | - unlink($sitePath . $fileObject->path); |
|
53 | + if ($fileObject->id && file_exists($sitePath . $fileObject->path)) { |
|
54 | + unlink($sitePath . $fileObject->path); |
|
55 | + } |
|
52 | 56 | |
53 | 57 | Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
54 | 58 | |
@@ -84,12 +88,14 @@ discard block |
||
84 | 88 | $sitePath = App::$primary->path; |
85 | 89 | |
86 | 90 | $fileinfo = pathinfo($url); |
87 | - if (empty($fileinfo['extension'])) |
|
88 | - return 0; |
|
91 | + if (empty($fileinfo['extension'])) { |
|
92 | + return 0; |
|
93 | + } |
|
89 | 94 | |
90 | 95 | $type = Files\Type::get($fileinfo['extension'], 'ext'); |
91 | - if (!$type) |
|
92 | - return 0; |
|
96 | + if (!$type) { |
|
97 | + return 0; |
|
98 | + } |
|
93 | 99 | |
94 | 100 | if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) { |
95 | 101 | return 0; |
@@ -105,8 +111,9 @@ discard block |
||
105 | 111 | } |
106 | 112 | $fileObject->name = $fileinfo['filename']; |
107 | 113 | $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension']; |
108 | - if ($fileObject->id && file_exists($sitePath . $fileObject->path)) |
|
109 | - unlink($sitePath . $fileObject->path); |
|
114 | + if ($fileObject->id && file_exists($sitePath . $fileObject->path)) { |
|
115 | + unlink($sitePath . $fileObject->path); |
|
116 | + } |
|
110 | 117 | |
111 | 118 | Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
112 | 119 |
@@ -1,33 +1,33 @@ |
||
1 | 1 | <div class="container-fluid"> |
2 | 2 | <div class="row panel"> |
3 | 3 | <?php |
4 | - if (!empty($_FILES['file'])) { |
|
5 | - App::$cur->files->upload($_FILES['file'], ['upload_code' => 'editorManager']); |
|
6 | - } |
|
7 | - $form = new Ui\Form(); |
|
8 | - $form->begin(); |
|
9 | - $form->input('file', 'file', 'Загрузить файл'); |
|
10 | - echo '<div class="form-group"><button class ="btn btn-primary btn-sm">Загузить</button></div>'; |
|
11 | - $form->end(false); |
|
12 | - ?> |
|
4 | + if (!empty($_FILES['file'])) { |
|
5 | + App::$cur->files->upload($_FILES['file'], ['upload_code' => 'editorManager']); |
|
6 | + } |
|
7 | + $form = new Ui\Form(); |
|
8 | + $form->begin(); |
|
9 | + $form->input('file', 'file', 'Загрузить файл'); |
|
10 | + echo '<div class="form-group"><button class ="btn btn-primary btn-sm">Загузить</button></div>'; |
|
11 | + $form->end(false); |
|
12 | + ?> |
|
13 | 13 | </div> |
14 | 14 | <h2>Последние файлы</h2> |
15 | 15 | <div class="row"> |
16 | 16 | <?php |
17 | - $files = Files\File::getList(['where' => ['upload_code', 'editorManager'], 'limit' => 12, 'order' => ['date_create', 'DESC']]); |
|
18 | - $i = 0; |
|
19 | - foreach ($files as $file) { |
|
20 | - ?> |
|
17 | + $files = Files\File::getList(['where' => ['upload_code', 'editorManager'], 'limit' => 12, 'order' => ['date_create', 'DESC']]); |
|
18 | + $i = 0; |
|
19 | + foreach ($files as $file) { |
|
20 | + ?> |
|
21 | 21 | <div class="col-xs-6 col-sm-2 fileChooser" onclick="OpenFile('<?= $file->path; ?>'); |
22 | 22 | return false;"> |
23 | 23 | <div class="thumbnail"> |
24 | 24 | <?php |
25 | - if ($file->type->group == 'image') { |
|
26 | - echo "<img class='img-responsive' src ='{$file->path}?resize=200x200' />"; |
|
27 | - } else { |
|
28 | - echo "<img class='img-responsive' src ='/static/moduleAsset/Files/images/formats/" . pathinfo($file->path, PATHINFO_EXTENSION) . ".png' />"; |
|
29 | - } |
|
30 | - ?> |
|
25 | + if ($file->type->group == 'image') { |
|
26 | + echo "<img class='img-responsive' src ='{$file->path}?resize=200x200' />"; |
|
27 | + } else { |
|
28 | + echo "<img class='img-responsive' src ='/static/moduleAsset/Files/images/formats/" . pathinfo($file->path, PATHINFO_EXTENSION) . ".png' />"; |
|
29 | + } |
|
30 | + ?> |
|
31 | 31 | |
32 | 32 | <?= $file->name; ?><br /> |
33 | 33 | <small class="text-muted"> |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return function($step = NULL, $params = []) { |
|
3 | +return function($step = null, $params = []) { |
|
4 | 4 | $options = ['max_height' => 1200, 'max_width' => 1200]; |
5 | 5 | $types = [ |
6 | 6 | [ |
@@ -15,23 +15,23 @@ |
||
15 | 15 | <div class="tab-content"> |
16 | 16 | <div role="tabpanel" class="tab-pane fade in active" id="home"> |
17 | 17 | <?php |
18 | - $form = new Ui\Form(); |
|
19 | - $form->begin(); |
|
20 | - $form->input('checkbox', 'config[view_empty_warehouse]', 'Показывать отсутствующие товары', ['value' => App::$cur->ecommerce->config['view_empty_warehouse']]); |
|
21 | - $form->input('checkbox', 'config[view_empty_image]', 'Показывать товары без изображения', ['value' => App::$cur->ecommerce->config['view_empty_image']]); |
|
22 | - $form->input('checkbox', 'config[sell_empty_warehouse]', 'Продавать отсутствующие товары', ['value' => App::$cur->ecommerce->config['sell_empty_warehouse']]); |
|
23 | - $form->input('checkbox', 'config[sell_over_warehouse]', 'Продавать сверх остатоков на складе', ['value' => App::$cur->ecommerce->config['sell_over_warehouse']]); |
|
24 | - $form->input('checkbox', 'config[show_zero_price]', 'Показывать товары с нулевой ценой', ['value' => App::$cur->ecommerce->config['show_zero_price']]); |
|
25 | - $form->input('checkbox', 'config[show_without_price]', 'Показывать товары без цен', ['value' => App::$cur->ecommerce->config['show_without_price']]); |
|
26 | - $form->input('select', 'config[defaultCategoryView]', 'Стандартный вид категории', ['value' => App::$cur->ecommerce->config['defaultCategoryView'], 'values' => App::$cur->ecommerce->viewsCategoryList()]); |
|
27 | - if (App::$cur->money) { |
|
28 | - $form->input('select', 'config[defaultCurrency]', 'Валюта по умолчанию', ['value' => App::$cur->ecommerce->config['defaultCurrency'], 'values' => ['' => 'Выберите'] + \Money\Currency::getList()]); |
|
29 | - } |
|
30 | - $form->input('text', 'config[orderPrefix]', 'Префикс для номеров заказов', ['value' => App::$cur->ecommerce->config['orderPrefix']]); |
|
31 | - $form->input('text', 'config[notify_mail]', 'E-mail оповещений о новых заказах', ['value' => App::$cur->ecommerce->config['notify_mail']]); |
|
32 | - $form->input('hidden', 'config[save]', '', ['value' => 1]); |
|
33 | - $form->end('Сохранить'); |
|
34 | - ?> |
|
18 | + $form = new Ui\Form(); |
|
19 | + $form->begin(); |
|
20 | + $form->input('checkbox', 'config[view_empty_warehouse]', 'Показывать отсутствующие товары', ['value' => App::$cur->ecommerce->config['view_empty_warehouse']]); |
|
21 | + $form->input('checkbox', 'config[view_empty_image]', 'Показывать товары без изображения', ['value' => App::$cur->ecommerce->config['view_empty_image']]); |
|
22 | + $form->input('checkbox', 'config[sell_empty_warehouse]', 'Продавать отсутствующие товары', ['value' => App::$cur->ecommerce->config['sell_empty_warehouse']]); |
|
23 | + $form->input('checkbox', 'config[sell_over_warehouse]', 'Продавать сверх остатоков на складе', ['value' => App::$cur->ecommerce->config['sell_over_warehouse']]); |
|
24 | + $form->input('checkbox', 'config[show_zero_price]', 'Показывать товары с нулевой ценой', ['value' => App::$cur->ecommerce->config['show_zero_price']]); |
|
25 | + $form->input('checkbox', 'config[show_without_price]', 'Показывать товары без цен', ['value' => App::$cur->ecommerce->config['show_without_price']]); |
|
26 | + $form->input('select', 'config[defaultCategoryView]', 'Стандартный вид категории', ['value' => App::$cur->ecommerce->config['defaultCategoryView'], 'values' => App::$cur->ecommerce->viewsCategoryList()]); |
|
27 | + if (App::$cur->money) { |
|
28 | + $form->input('select', 'config[defaultCurrency]', 'Валюта по умолчанию', ['value' => App::$cur->ecommerce->config['defaultCurrency'], 'values' => ['' => 'Выберите'] + \Money\Currency::getList()]); |
|
29 | + } |
|
30 | + $form->input('text', 'config[orderPrefix]', 'Префикс для номеров заказов', ['value' => App::$cur->ecommerce->config['orderPrefix']]); |
|
31 | + $form->input('text', 'config[notify_mail]', 'E-mail оповещений о новых заказах', ['value' => App::$cur->ecommerce->config['notify_mail']]); |
|
32 | + $form->input('hidden', 'config[save]', '', ['value' => 1]); |
|
33 | + $form->end('Сохранить'); |
|
34 | + ?> |
|
35 | 35 | <h3>Обслужвание</h3> |
36 | 36 | <a href="/admin/ecommerce/reSearchIndex" class="btn btn-primary">Обновить поисковые индексы</a> |
37 | 37 | <h3>Уведомления в браузере</h3> |