@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="dashboard-widgets"> |
2 | - <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', ' . \Users\User::$cur->name() : ''; ?></h4> |
|
2 | + <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', '.\Users\User::$cur->name() : ''; ?></h4> |
|
3 | 3 | <div class = "row"> |
4 | 4 | <?php |
5 | 5 | $rowSum = 0; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | } |
10 | 10 | |
11 | 11 | $widgetSize = !empty($section['size']) ? $section['size'] : 1; |
12 | - $rowSum+=$widgetSize; |
|
12 | + $rowSum += $widgetSize; |
|
13 | 13 | ?> |
14 | 14 | <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div> |
15 | 15 | <?php |
@@ -15,8 +15,8 @@ |
||
15 | 15 | foreach ($templates['app']['installed'] as $template => $name) { |
16 | 16 | $table->addRow([ |
17 | 17 | $name, |
18 | - (empty($templates['app']['current']) || $templates['app']['current'] != $template) ? '<a href = "/admin/view/setDefault/' . $template . '">Установить по умолчанию</a>' : 'Тема по умолчанию', |
|
19 | - '<a href = "/admin/view/template/editFile/' . $template . '">Файлы</a> <a href = "/admin/view/editTemplate/' . $template . '">Редактировать</a>' |
|
18 | + (empty($templates['app']['current']) || $templates['app']['current'] != $template) ? '<a href = "/admin/view/setDefault/'.$template.'">Установить по умолчанию</a>' : 'Тема по умолчанию', |
|
19 | + '<a href = "/admin/view/template/editFile/'.$template.'">Файлы</a> <a href = "/admin/view/editTemplate/'.$template.'">Редактировать</a>' |
|
20 | 20 | ]); |
21 | 21 | } |
22 | 22 | $table->draw(); |
23 | 23 | \ No newline at end of file |
@@ -22,15 +22,15 @@ |
||
22 | 22 | function editFileAction($templateName) |
23 | 23 | { |
24 | 24 | $template = \View\Template::get($templateName, \App::$primary); |
25 | - if (!empty($_GET['path']) && file_exists($template->path . '/' . Tools::parsePath($_GET['path']))) { |
|
25 | + if (!empty($_GET['path']) && file_exists($template->path.'/'.Tools::parsePath($_GET['path']))) { |
|
26 | 26 | $code = file_get_contents("php://input"); |
27 | 27 | if (!empty($code)) { |
28 | 28 | $result = new Server\Result(); |
29 | 29 | $result->successMsg = 'Файл сохранен'; |
30 | - $content = file_put_contents($template->path . '/' . Tools::parsePath($_GET['path']), $code); |
|
30 | + $content = file_put_contents($template->path.'/'.Tools::parsePath($_GET['path']), $code); |
|
31 | 31 | $result->send(); |
32 | 32 | } |
33 | - $content = file_get_contents($template->path . '/' . Tools::parsePath($_GET['path'])); |
|
33 | + $content = file_get_contents($template->path.'/'.Tools::parsePath($_GET['path'])); |
|
34 | 34 | $this->libs->loadLib('Ace'); |
35 | 35 | $this->view->page(['content' => 'template/edit', 'data' => compact('template', 'content')]); |
36 | 36 | } else { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $this->info = $this->getInfo(); |
73 | 73 | $this->config = Config::module($this->moduleName, !empty($this->info['systemConfig'])); |
74 | 74 | $that = $this; |
75 | - Inji::$inst->listen('Config-change-module-' . $this->app->name . '-' . $this->moduleName, $this->app->name . '-' . $this->moduleName . 'config', function($event) use ($that) { |
|
75 | + Inji::$inst->listen('Config-change-module-'.$this->app->name.'-'.$this->moduleName, $this->app->name.'-'.$this->moduleName.'config', function($event) use ($that) { |
|
76 | 76 | $that->config = $event['eventObject']; |
77 | 77 | }); |
78 | 78 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | $moduleName = ucfirst($moduleName); |
89 | 89 | $paths = []; |
90 | 90 | if (App::$cur !== App::$primary) { |
91 | - $paths['primaryAppPath'] = App::$primary->path . '/modules/' . $moduleName; |
|
91 | + $paths['primaryAppPath'] = App::$primary->path.'/modules/'.$moduleName; |
|
92 | 92 | } |
93 | - $paths['curAppPath'] = App::$cur->path . '/modules/' . $moduleName; |
|
94 | - $paths['systemPath'] = INJI_SYSTEM_DIR . '/modules/' . $moduleName; |
|
93 | + $paths['curAppPath'] = App::$cur->path.'/modules/'.$moduleName; |
|
94 | + $paths['systemPath'] = INJI_SYSTEM_DIR.'/modules/'.$moduleName; |
|
95 | 95 | return $paths; |
96 | 96 | } |
97 | 97 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $moduleName = ucfirst($moduleName); |
107 | 107 | $paths = Module::getModulePaths($moduleName); |
108 | 108 | foreach ($paths as $path) { |
109 | - if (file_exists($path . '/' . $moduleName . '.php')) { |
|
109 | + if (file_exists($path.'/'.$moduleName.'.php')) { |
|
110 | 110 | return $path; |
111 | 111 | } |
112 | 112 | } |
@@ -159,12 +159,12 @@ discard block |
||
159 | 159 | foreach ($moduleDirs as $moduleDir) { |
160 | 160 | if (is_dir($moduleDir)) { |
161 | 161 | foreach (scandir($moduleDir) as $dir) { |
162 | - if (preg_match('!Controllers$!', $dir) && is_dir($moduleDir . '/' . $dir)) { |
|
163 | - $path = $moduleDir . '/' . $dir; |
|
162 | + if (preg_match('!Controllers$!', $dir) && is_dir($moduleDir.'/'.$dir)) { |
|
163 | + $path = $moduleDir.'/'.$dir; |
|
164 | 164 | foreach (scandir($path) as $file) { |
165 | - if (preg_match('!Controller\.php$!', $file) && is_file($path . '/' . $file)) { |
|
165 | + if (preg_match('!Controller\.php$!', $file) && is_file($path.'/'.$file)) { |
|
166 | 166 | $controllerName = preg_replace('!Controller\.php$!', '', $file); |
167 | - $controllers[preg_replace('!Controllers$!', '', $dir)][$controllerName] = $path . '/' . $file; |
|
167 | + $controllers[preg_replace('!Controllers$!', '', $dir)][$controllerName] = $path.'/'.$file; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
@@ -211,31 +211,31 @@ discard block |
||
211 | 211 | $paths = []; |
212 | 212 | if (App::$cur != App::$primary) { |
213 | 213 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
214 | - $paths['primaryAppAppTypePath_slice'] = App::$primary->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
214 | + $paths['primaryAppAppTypePath_slice'] = App::$primary->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
215 | 215 | if (App::$primary->{$this->moduleName}) { |
216 | - $paths['primaryAppAppTypePath_slice'] = App::$primary->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
216 | + $paths['primaryAppAppTypePath_slice'] = App::$primary->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
217 | 217 | } |
218 | 218 | } |
219 | - $paths['primaryAppAppAppTypePath'] = App::$primary->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
219 | + $paths['primaryAppAppAppTypePath'] = App::$primary->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
220 | 220 | if (App::$primary->{$this->moduleName}) { |
221 | - $paths['primaryAppAppTypePath'] = App::$primary->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
221 | + $paths['primaryAppAppTypePath'] = App::$primary->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
222 | 222 | } |
223 | - $paths['curAppAppTypePath'] = $this->app->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
223 | + $paths['curAppAppTypePath'] = $this->app->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
227 | - $paths['appAppTypePath_slice'] = $this->app->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
228 | - $paths['appTypePath_slice'] = $this->path . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
227 | + $paths['appAppTypePath_slice'] = $this->app->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
228 | + $paths['appTypePath_slice'] = $this->path.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
229 | 229 | } |
230 | - $paths['appAppTypePath'] = $this->app->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
231 | - $paths['appTypePath'] = $this->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
230 | + $paths['appAppTypePath'] = $this->app->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
231 | + $paths['appTypePath'] = $this->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
232 | 232 | |
233 | 233 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
234 | - $paths['appUniversalPath_slice'] = $this->app->path . '/modules/' . $this->moduleName . '/Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
235 | - $paths['universalPath_slice'] = $this->path . '/Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
234 | + $paths['appUniversalPath_slice'] = $this->app->path.'/modules/'.$this->moduleName.'/Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
235 | + $paths['universalPath_slice'] = $this->path.'/Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
236 | 236 | } |
237 | - $paths['appUniversalPath'] = $this->app->path . '/modules/' . $this->moduleName . '/Controllers/' . $this->moduleName . 'Controller.php'; |
|
238 | - $paths['universalPath'] = $this->path . '/Controllers/' . $this->moduleName . 'Controller.php'; |
|
237 | + $paths['appUniversalPath'] = $this->app->path.'/modules/'.$this->moduleName.'/Controllers/'.$this->moduleName.'Controller.php'; |
|
238 | + $paths['universalPath'] = $this->path.'/Controllers/'.$this->moduleName.'Controller.php'; |
|
239 | 239 | |
240 | 240 | return $paths; |
241 | 241 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $controllerName = $this->moduleName; |
259 | 259 | $params = $this->params; |
260 | 260 | } |
261 | - $fullControllerName = $controllerName . 'Controller'; |
|
261 | + $fullControllerName = $controllerName.'Controller'; |
|
262 | 262 | $controller = new $fullControllerName(); |
263 | 263 | $controller->params = $params; |
264 | 264 | $controller->module = $this; |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | } |
285 | 285 | $paths = Module::getModulePaths($moduleName); |
286 | 286 | foreach ($paths as $path) { |
287 | - if (file_exists($path . '/info.php')) { |
|
288 | - return include $path . '/info.php'; |
|
287 | + if (file_exists($path.'/info.php')) { |
|
288 | + return include $path.'/info.php'; |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | return []; |
@@ -304,16 +304,16 @@ discard block |
||
304 | 304 | { |
305 | 305 | $moduleName = $moduleName ? $moduleName : $this->moduleName; |
306 | 306 | $modulePaths = Module::getModulePaths($moduleName); |
307 | - $modulePaths['templatePath'] = App::$cur->view->template->path . '/modules/' . ucfirst($moduleName); |
|
307 | + $modulePaths['templatePath'] = App::$cur->view->template->path.'/modules/'.ucfirst($moduleName); |
|
308 | 308 | $snippets = []; |
309 | 309 | foreach ($modulePaths as $path) { |
310 | - if (file_exists($path . $dir . '/' . $snippetsPath)) { |
|
311 | - $snippetsPaths = array_slice(scandir($path . $dir . '/' . $snippetsPath), 2); |
|
310 | + if (file_exists($path.$dir.'/'.$snippetsPath)) { |
|
311 | + $snippetsPaths = array_slice(scandir($path.$dir.'/'.$snippetsPath), 2); |
|
312 | 312 | foreach ($snippetsPaths as $snippetPath) { |
313 | - if (is_dir($path . $dir . '/' . $snippetsPath . '/' . $snippetPath)) { |
|
314 | - $snippets[$snippetPath] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath . '/info.php'; |
|
313 | + if (is_dir($path.$dir.'/'.$snippetsPath.'/'.$snippetPath)) { |
|
314 | + $snippets[$snippetPath] = include $path.$dir.'/'.$snippetsPath.'/'.$snippetPath.'/info.php'; |
|
315 | 315 | } else { |
316 | - $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath; |
|
316 | + $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path.$dir.'/'.$snippetsPath.'/'.$snippetPath; |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | } |
@@ -335,9 +335,9 @@ discard block |
||
335 | 335 | { |
336 | 336 | $extensions = []; |
337 | 337 | $modules = Module::getInstalled(App::$cur); |
338 | - $method = 'get' . ucfirst($extensionType); |
|
338 | + $method = 'get'.ucfirst($extensionType); |
|
339 | 339 | foreach ($modules as $module) { |
340 | - $extensions = array_merge($extensions, $this->{$method}($request, false, "/extensions/{$this->moduleName}/" . $extensionType, $module)); |
|
340 | + $extensions = array_merge($extensions, $this->{$method}($request, false, "/extensions/{$this->moduleName}/".$extensionType, $module)); |
|
341 | 341 | } |
342 | 342 | return $extensions; |
343 | 343 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | public function realType() |
57 | 57 | { |
58 | - if ($this->option && $this->option->type) { |
|
58 | + if ($this->option && $this->option->type) { |
|
59 | 59 | $type = $this->option->type; |
60 | 60 | |
61 | 61 | if ($type == 'select') { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | 'col' => 'item_offer_id', |
77 | 77 | //'resultKey' => 'code', |
78 | 78 | 'resultKey' => 'item_offer_option_id', |
79 | - 'join' => [Offer\Option::table(), Offer\Option::index() . ' = ' . Offer\Param::colPrefix() . Offer\Option::index()] |
|
79 | + 'join' => [Offer\Option::table(), Offer\Option::index().' = '.Offer\Param::colPrefix().Offer\Option::index()] |
|
80 | 80 | ], |
81 | 81 | 'item' => [ |
82 | 82 | 'model' => 'Ecommerce\Item', |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | { |
90 | 90 | $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]); |
91 | 91 | if ($warehouse) { |
92 | - $warehouse->count +=(float) $count; |
|
92 | + $warehouse->count += (float) $count; |
|
93 | 93 | $warehouse->save(); |
94 | 94 | } else { |
95 | 95 | $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]); |
96 | 96 | if ($warehouse) { |
97 | - $warehouse->count +=(float) $count; |
|
97 | + $warehouse->count += (float) $count; |
|
98 | 98 | $warehouse->save(); |
99 | 99 | } |
100 | 100 | } |
@@ -112,21 +112,21 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | if ($warehouseIds) { |
115 | - \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Warehouse::index(), $warehouseIds, 'IN'); |
|
115 | + \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Warehouse::index(), $warehouseIds, 'IN'); |
|
116 | 116 | } |
117 | - \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
|
118 | - \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count),0) as `sum` '; |
|
117 | + \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index(), $this->id); |
|
118 | + \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Item\Offer\Warehouse::colPrefix().'count),0) as `sum` '; |
|
119 | 119 | $warehouse = \App::$cur->db->select(\Ecommerce\Item\Offer\Warehouse::table())->fetch(); |
120 | 120 | |
121 | - \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` '; |
|
122 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
|
121 | + \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Warehouse\Block::colPrefix().'count) ,0) as `sum` '; |
|
122 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index(), $this->id); |
|
123 | 123 | if ($cart_id) { |
124 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
124 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
125 | 125 | } |
126 | 126 | $on = ' |
127 | - ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND ( |
|
128 | - (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) || |
|
129 | - (`' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
127 | + ' . \Ecommerce\Cart::index().' = '.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND ( |
|
128 | + (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) || |
|
129 | + (`' . \Ecommerce\Cart::colPrefix().'cart_status_id` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
130 | 130 | ) |
131 | 131 | '; |
132 | 132 | \App::$cur->db->join(\Ecommerce\Cart::table(), $on, 'inner'); |
@@ -38,25 +38,25 @@ |
||
38 | 38 | $return = new Server\Result(); |
39 | 39 | ob_start(); |
40 | 40 | $form->checkRequest($params, true); |
41 | - $_GET['item'] = get_class($form->model) . ($model->pk() ? ':' . $model->pk() : ''); |
|
41 | + $_GET['item'] = get_class($form->model).($model->pk() ? ':'.$model->pk() : ''); |
|
42 | 42 | $get = $_GET; |
43 | 43 | if (isset($get['notSave'])) { |
44 | 44 | unset($get['notSave']); |
45 | 45 | } |
46 | - $form->action = (App::$cur->system ? '/' . App::$cur->name : '') . '/ui/formPopUp/?' . http_build_query($get); |
|
46 | + $form->action = (App::$cur->system ? '/'.App::$cur->name : '').'/ui/formPopUp/?'.http_build_query($get); |
|
47 | 47 | $form->draw($params, true); |
48 | 48 | $return->content = ob_get_contents(); |
49 | 49 | ob_end_clean(); |
50 | 50 | $return->send(); |
51 | 51 | } else { |
52 | 52 | $form->checkRequest($params); |
53 | - $_GET['item'] = get_class($form->model) . ($model->pk() ? ':' . $model->pk() : ''); |
|
53 | + $_GET['item'] = get_class($form->model).($model->pk() ? ':'.$model->pk() : ''); |
|
54 | 54 | $get = $_GET; |
55 | 55 | if (isset($get['notSave'])) { |
56 | 56 | unset($get['notSave']); |
57 | 57 | } |
58 | - $form->action = (App::$cur->system ? '/' . App::$cur->name : '') . '/ui/formPopUp/?' . http_build_query($get); |
|
59 | - $this->view->setTitle(($model && $model->pk() ? 'Изменить ' : 'Создать ') . $form->header); |
|
58 | + $form->action = (App::$cur->system ? '/'.App::$cur->name : '').'/ui/formPopUp/?'.http_build_query($get); |
|
59 | + $this->view->setTitle(($model && $model->pk() ? 'Изменить ' : 'Создать ').$form->header); |
|
60 | 60 | $this->view->page(['content' => 'form', 'data' => compact('form', 'params')]); |
61 | 61 | } |
62 | 62 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | 'procent' => 'Процент', |
22 | 22 | 'amount' => 'Сумма', |
23 | 23 | ]; |
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() : '')); |
|
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 | 26 | 'rewarder' => function($reward, $sums, $user, $rootUser, $level, $rewardGet) { |
27 | 27 | $wallets = \App::$cur->money->getUserWallets($user->id); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | return 0; |
64 | 64 | } |
65 | 65 | |
66 | - $text = 'Вознаграждение по программе "' . $reward->name . '"'; |
|
66 | + $text = 'Вознаграждение по программе "'.$reward->name.'"'; |
|
67 | 67 | if ($rootUser->id != $user->id) { |
68 | - $text .= ' от ' . $rootUser->name(); |
|
68 | + $text .= ' от '.$rootUser->name(); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | if (!$rewardGet && $reward->block) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $block->wallet_id = $wallets[$level->params['currency_id']->value]->id; |
74 | 74 | $block->amount = $amount; |
75 | 75 | $block->comment = $text; |
76 | - $block->data = 'reward:' . $reward->id; |
|
76 | + $block->data = 'reward:'.$reward->id; |
|
77 | 77 | $dateGenerators = \App::$cur->money->getSnippets('expiredDateGenerator'); |
78 | 78 | if ($reward->block_date_expired && !empty($dateGenerators[$reward->block_date_expired])) { |
79 | 79 | $date = $dateGenerators[$reward->block_date_expired]($reward, $user); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } else { |
89 | 89 | $wallets[$level->params['currency_id']->value]->diff($amount, $text); |
90 | 90 | } |
91 | - \App::$cur->users->AddUserActivity($user->id, 4, $text . '<br />' . $amount . ' ' . $wallets[$level->params['currency_id']->value]->currency->acronym()); |
|
91 | + \App::$cur->users->AddUserActivity($user->id, 4, $text.'<br />'.$amount.' '.$wallets[$level->params['currency_id']->value]->currency->acronym()); |
|
92 | 92 | } |
93 | 93 | return $amount; |
94 | 94 | } |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | if (isset($_GET['logout'])) { |
25 | 25 | return $this->logOut(); |
26 | 26 | } |
27 | - if (filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_session_hash') && filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_id')) { |
|
28 | - return $this->cuntinueSession(filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_session_hash'), filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_id')); |
|
27 | + if (filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_session_hash') && filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_id')) { |
|
28 | + return $this->cuntinueSession(filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_session_hash'), filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_id')); |
|
29 | 29 | } |
30 | 30 | if (isset($_POST['autorization']) && trim(filter_input(INPUT_POST, 'user_login')) && trim(filter_input(INPUT_POST, 'user_pass'))) { |
31 | 31 | unset($_POST['autorization']); |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | |
42 | 42 | public function logOut($redirect = true) |
43 | 43 | { |
44 | - if (!empty($_COOKIE[$this->cookiePrefix . "_user_session_hash"]) && !empty($_COOKIE[$this->cookiePrefix . "_user_id"])) { |
|
44 | + if (!empty($_COOKIE[$this->cookiePrefix."_user_session_hash"]) && !empty($_COOKIE[$this->cookiePrefix."_user_id"])) { |
|
45 | 45 | $session = Users\Session::get([ |
46 | - ['user_id', $_COOKIE[$this->cookiePrefix . "_user_id"]], |
|
47 | - ['hash', $_COOKIE[$this->cookiePrefix . "_user_session_hash"]] |
|
46 | + ['user_id', $_COOKIE[$this->cookiePrefix."_user_id"]], |
|
47 | + ['hash', $_COOKIE[$this->cookiePrefix."_user_session_hash"]] |
|
48 | 48 | ]); |
49 | 49 | if ($session) { |
50 | 50 | $session->delete(); |
51 | 51 | } |
52 | 52 | } |
53 | 53 | if (!headers_sent()) { |
54 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
55 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
54 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
55 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
56 | 56 | } |
57 | 57 | if ($redirect) { |
58 | 58 | if (!empty($this->config['logoutUrl'][$this->app->type])) { |
@@ -70,25 +70,25 @@ discard block |
||
70 | 70 | ]); |
71 | 71 | if ($session && $session->user && $session->user->blocked) { |
72 | 72 | if (!headers_sent()) { |
73 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
74 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
73 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
74 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
75 | 75 | } |
76 | 76 | Msg::add('Ваш аккаунт заблокирован', 'info'); |
77 | 77 | return; |
78 | 78 | } |
79 | 79 | if ($session && $session->user && !$session->user->blocked) { |
80 | 80 | if (!headers_sent()) { |
81 | - setcookie($this->cookiePrefix . "_user_session_hash", $session->hash, time() + 360000, "/"); |
|
82 | - setcookie($this->cookiePrefix . "_user_id", $session->user_id, time() + 360000, "/"); |
|
81 | + setcookie($this->cookiePrefix."_user_session_hash", $session->hash, time() + 360000, "/"); |
|
82 | + setcookie($this->cookiePrefix."_user_id", $session->user_id, time() + 360000, "/"); |
|
83 | 83 | } |
84 | 84 | if (!empty($this->config['needActivation']) && $session->user->activation) { |
85 | 85 | if (!headers_sent()) { |
86 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
87 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
86 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
87 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
88 | 88 | } |
89 | - Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $session->user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
89 | + Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$session->user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
90 | 90 | } elseif ($session->user->activation) { |
91 | - Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $session->user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
91 | + Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$session->user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
92 | 92 | } |
93 | 93 | if (!$session->user->mail && !empty($this->config['noMailNotify'])) { |
94 | 94 | Msg::add($this->config['noMailNotify']); |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | Users\User::$cur->save(); |
99 | 99 | } else { |
100 | 100 | if (!headers_sent()) { |
101 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
102 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
101 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
102 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
103 | 103 | } |
104 | 104 | Msg::add('Ваша сессия устарела или более недействительна, вам необходимо пройти <a href = "/users/login">авторизацию</a> заново', 'info'); |
105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $user = $this->get($user_mail, 'mail'); |
111 | 111 | if (!$user) { |
112 | - Msg::add('Пользователь ' . $user_mail . ' не найден, проверьте првильность ввода e-mail или зарегистрируйтесь', 'danger'); |
|
112 | + Msg::add('Пользователь '.$user_mail.' не найден, проверьте првильность ввода e-mail или зарегистрируйтесь', 'danger'); |
|
113 | 113 | return false; |
114 | 114 | } |
115 | 115 | $passre = Users\Passre::get([['user_id', $user->id], ['status', 1]]); |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | $passre->status = 2; |
118 | 118 | $passre->save(); |
119 | 119 | } |
120 | - $hash = $user->id . '_' . Tools::randomString(50); |
|
120 | + $hash = $user->id.'_'.Tools::randomString(50); |
|
121 | 121 | $passre = new Users\Passre(['user_id' => $user->id, 'status' => 1, 'hash' => $hash]); |
122 | 122 | $passre->save(); |
123 | - Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, $user_mail, 'Восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для продолжения восстановления пароля перейдите по ссылке: <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/?passrecont=1&hash=' . $hash . '">' . idn_to_utf8(INJI_DOMAIN_NAME) . '/?passrecont=1&hash=' . $hash . '</a>'); |
|
123 | + Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, $user_mail, 'Восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для продолжения восстановления пароля перейдите по ссылке: <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/?passrecont=1&hash='.$hash.'">'.idn_to_utf8(INJI_DOMAIN_NAME).'/?passrecont=1&hash='.$hash.'</a>'); |
|
124 | 124 | Tools::redirect('/', 'На указанный почтовый ящик была выслана инструкция по восстановлению пароля', 'success'); |
125 | 125 | } |
126 | 126 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $user->pass = $this->hashpass($pass); |
139 | 139 | $user->save(); |
140 | 140 | $this->autorization($user->mail, $user->pass, 'mail'); |
141 | - Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, $user->mail, 'Новый пароль на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />Ваш новый пароль: ' . $pass); |
|
141 | + Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, $user->mail, 'Новый пароль на сайте '.idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />Ваш новый пароль: '.$pass); |
|
142 | 142 | Tools::redirect('/', 'На указанный почтовый ящик был выслан новый пароль', 'success'); |
143 | 143 | } |
144 | 144 | } |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | $user = $this->get($login, $ltype); |
152 | 152 | if ($user && $this->verifypass($pass, $user->pass) && !$user->blocked) { |
153 | 153 | if (!empty($this->config['needActivation']) && $user->activation) { |
154 | - Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
154 | + Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
155 | 155 | } elseif ($user->activation) { |
156 | - Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
156 | + Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
157 | 157 | } |
158 | 158 | if (!$user->mail && !empty($this->config['noMailNotify'])) { |
159 | 159 | Msg::add($this->config['noMailNotify']); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($user && $user->blocked) { |
173 | 173 | Msg::add('Вы заблокированы', 'danger'); |
174 | 174 | } elseif ($user) { |
175 | - Msg::add('Вы ошиблись при наборе пароля или логина, попробуйте ещё раз или воспользуйтесь <a href = "?passre=1&user_mail=' . $user->mail . '">Восстановлением пароля</a>', 'danger'); |
|
175 | + Msg::add('Вы ошиблись при наборе пароля или логина, попробуйте ещё раз или воспользуйтесь <a href = "?passre=1&user_mail='.$user->mail.'">Восстановлением пароля</a>', 'danger'); |
|
176 | 176 | } else { |
177 | 177 | Msg::add('Данный почтовый ящик не зарегистрирован в системе', 'danger'); |
178 | 178 | } |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | $session->save(); |
196 | 196 | |
197 | 197 | if (!headers_sent()) { |
198 | - setcookie($this->cookiePrefix . "_user_session_hash", $session->hash, time() + 360000, "/"); |
|
199 | - setcookie($this->cookiePrefix . "_user_id", $session->user_id, time() + 360000, "/"); |
|
198 | + setcookie($this->cookiePrefix."_user_session_hash", $session->hash, time() + 360000, "/"); |
|
199 | + setcookie($this->cookiePrefix."_user_id", $session->user_id, time() + 360000, "/"); |
|
200 | 200 | } else { |
201 | 201 | Msg::add('Не удалось провести авторизацию. Попробуйте позже', 'info'); |
202 | 202 | } |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | $this->autorization($user_mail, $pass, 'mail'); |
319 | 319 | } |
320 | 320 | if (!empty($this->config['needActivation'])) { |
321 | - $from = 'noreply@' . INJI_DOMAIN_NAME; |
|
321 | + $from = 'noreply@'.INJI_DOMAIN_NAME; |
|
322 | 322 | $to = $user_mail; |
323 | - $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME); |
|
324 | - $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass; |
|
325 | - $text .='<br />'; |
|
323 | + $subject = 'Регистрация на сайте '.idn_to_utf8(INJI_DOMAIN_NAME); |
|
324 | + $text = 'Вы были зарегистрированы на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: '.$pass; |
|
326 | 325 | $text .= '<br />'; |
327 | - $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://' . INJI_DOMAIN_NAME . '/users/activation/' . $user->id . '/' . $user->activation . '">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/users/activation/' . $user->id . '/' . $user->activation . '</a>'; |
|
326 | + $text .= '<br />'; |
|
327 | + $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://'.INJI_DOMAIN_NAME.'/users/activation/'.$user->id.'/'.$user->activation.'">http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/users/activation/'.$user->id.'/'.$user->activation.'</a>'; |
|
328 | 328 | Tools::sendMail($from, $to, $subject, $text); |
329 | 329 | Msg::add('Вы были зарегистрированы. На указанный почтовый ящик был выслан ваш пароль и ссылка для активации', 'success'); |
330 | 330 | } else { |
331 | - $from = 'noreply@' . INJI_DOMAIN_NAME; |
|
331 | + $from = 'noreply@'.INJI_DOMAIN_NAME; |
|
332 | 332 | $to = $user_mail; |
333 | - $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME); |
|
334 | - $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass; |
|
333 | + $subject = 'Регистрация на сайте '.idn_to_utf8(INJI_DOMAIN_NAME); |
|
334 | + $text = 'Вы были зарегистрированы на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: '.$pass; |
|
335 | 335 | Tools::sendMail($from, $to, $subject, $text); |
336 | 336 | Msg::add('Вы были зарегистрированы. На указанный почтовый ящик был выслан ваш пароль', 'success'); |
337 | 337 | } |