@@ -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 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->name = $this->managerOptions['name']; |
59 | 59 | } |
60 | 60 | |
61 | - $this->managerId = str_replace('\\', '_', 'dataManager_' . $this->modelName . '_' . $this->managerName . '_' . \Tools::randomString()); |
|
61 | + $this->managerId = str_replace('\\', '_', 'dataManager_'.$this->modelName.'_'.$this->managerName.'_'.\Tools::randomString()); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | if (!empty($this->managerOptions['filters'])) { |
103 | 103 | $buttons[] = [ |
104 | 104 | 'text' => 'Фильтры', |
105 | - 'onclick' => ' var modal = $("#' . $this->managerId . '_filters"); |
|
105 | + 'onclick' => ' var modal = $("#'.$this->managerId.'_filters"); |
|
106 | 106 | modal.modal("show");', |
107 | 107 | ]; |
108 | 108 | } |
109 | 109 | $buttons[] = [ |
110 | 110 | 'text' => 'Добавить элемент', |
111 | - 'onclick' => 'inji.Ui.forms.popUp("' . str_replace('\\', '\\\\', $modelName) . '",' . json_encode($formParams) . ')', |
|
111 | + 'onclick' => 'inji.Ui.forms.popUp("'.str_replace('\\', '\\\\', $modelName).'",'.json_encode($formParams).')', |
|
112 | 112 | ]; |
113 | 113 | |
114 | 114 | return $buttons; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | 'className' => $action |
139 | 139 | ]; |
140 | 140 | } |
141 | - $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\' . $return[$key]['className']) ? 'Ui\DataManager\Action\\' . $return[$key]['className'] : $return[$key]['className']; |
|
141 | + $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\'.$return[$key]['className']) ? 'Ui\DataManager\Action\\'.$return[$key]['className'] : $return[$key]['className']; |
|
142 | 142 | if (!class_exists($return[$key]['className']) || ($onlyGroupActions && !$return[$key]['className']::$groupAction)) { |
143 | 143 | unset($return[$key]); |
144 | 144 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | <?php |
171 | 171 | foreach ($actions as $action => $actionParams) { |
172 | 172 | if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) { |
173 | - echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>"; |
|
173 | + echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"".str_replace('\\', '\\\\', $action)."\");return false;'>{$actionParams['className']::$name}</a></li>"; |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | ?> |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | return []; |
222 | 222 | } |
223 | 223 | if (!$this->checkAccess()) { |
224 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"'); |
|
224 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"'); |
|
225 | 225 | return []; |
226 | 226 | } |
227 | 227 | $modelName = $this->modelName; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $queryParams['start'] = $this->page * $this->limit - $this->limit; |
238 | 238 | } |
239 | 239 | if (!empty($params['categoryPath']) && $modelName::$categoryModel) { |
240 | - $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE']; |
|
240 | + $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE']; |
|
241 | 241 | } |
242 | 242 | if (!empty($params['appType'])) { |
243 | 243 | $queryParams['appType'] = $params['appType']; |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | if (!empty($params['filters'][$col]['max'])) { |
297 | 297 | if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) { |
298 | 298 | |
299 | - $date = $params['filters'][$col]['max'] . ' 23:59:59'; |
|
299 | + $date = $params['filters'][$col]['max'].' 23:59:59'; |
|
300 | 300 | } else { |
301 | 301 | $date = $params['filters'][$col]['max']; |
302 | 302 | } |
@@ -323,16 +323,16 @@ discard block |
||
323 | 323 | } |
324 | 324 | switch ($params['filters'][$col]['compareType']) { |
325 | 325 | case 'contains': |
326 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
326 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE']; |
|
327 | 327 | break; |
328 | 328 | case 'equals': |
329 | 329 | $queryParams['where'][] = [$col, $params['filters'][$col]['value']]; |
330 | 330 | break; |
331 | 331 | case 'starts_with': |
332 | - $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
332 | + $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE']; |
|
333 | 333 | break; |
334 | 334 | case 'ends_with': |
335 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE']; |
|
335 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE']; |
|
336 | 336 | break; |
337 | 337 | } |
338 | 338 | break; |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $item = $relation['relModel']::get([[$item->index(), $item->id], [$model->index(), $model->id]]); |
372 | 372 | } |
373 | 373 | $row = []; |
374 | - $row[] = '<input type ="checkbox" name = "pk[]" value =' . $item->pk() . '>'; |
|
374 | + $row[] = '<input type ="checkbox" name = "pk[]" value ='.$item->pk().'>'; |
|
375 | 375 | $row[] = $item->pk(); |
376 | 376 | foreach ($this->managerOptions['cols'] as $key => $colName) { |
377 | 377 | if (!empty($params['download'])) { |
@@ -417,16 +417,16 @@ discard block |
||
417 | 417 | $managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
418 | 418 | $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
419 | 419 | $count = $count ? $count : 'Нет'; |
420 | - return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>"; |
|
420 | + return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>"; |
|
421 | 421 | case 'many': |
422 | 422 | $managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
423 | 423 | $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
424 | 424 | $count = $count ? $count : 'Нет'; |
425 | - return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>"; |
|
425 | + return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>"; |
|
426 | 426 | default : |
427 | 427 | if ($item->{$modelName::$cols[$colName]['relation']}) { |
428 | 428 | if (\App::$cur->name == 'admin') { |
429 | - $href = "<a href ='/admin/" . str_replace('\\', '/view/', $relations[$modelName::$cols[$colName]['relation']]['model']) . "/" . $item->{$modelName::$cols[$colName]['relation']}->pk() . "'>"; |
|
429 | + $href = "<a href ='/admin/".str_replace('\\', '/view/', $relations[$modelName::$cols[$colName]['relation']]['model'])."/".$item->{$modelName::$cols[$colName]['relation']}->pk()."'>"; |
|
430 | 430 | if (!empty($modelName::$cols[$colName]['showCol'])) { |
431 | 431 | $href .= $item->{$modelName::$cols[$colName]['relation']}->{$modelName::$cols[$colName]['showCol']}; |
432 | 432 | } else { |
@@ -456,18 +456,18 @@ discard block |
||
456 | 456 | case 'many': |
457 | 457 | $managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
458 | 458 | $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
459 | - return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>"; |
|
459 | + return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count} ".\Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов'])."</a>"; |
|
460 | 460 | default: |
461 | 461 | return $item->$colName; |
462 | 462 | } |
463 | 463 | } elseif (!empty($modelName::$cols[$colName]['type'])) { |
464 | - if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) { |
|
464 | + if (\App::$cur->name == 'admin' && $originalCol == 'name' || ($dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) { |
|
465 | 465 | $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager'; |
466 | - $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem)); |
|
467 | - return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($originalItem)) . "/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
466 | + $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem)); |
|
467 | + return "<a href ='/admin/".str_replace('\\', '/view/', get_class($originalItem))."/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
468 | 468 | } elseif (\App::$cur->name == 'admin' && $colName == 'name') { |
469 | - $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem)); |
|
470 | - return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($item)) . "/{$item->id}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
469 | + $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem)); |
|
470 | + return "<a href ='/admin/".str_replace('\\', '/view/', get_class($item))."/{$item->id}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
471 | 471 | } else { |
472 | 472 | return \Model::resloveTypeValue($item, $colName); |
473 | 473 | } |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | return []; |
503 | 503 | } |
504 | 504 | if (!$this->checkAccess()) { |
505 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"'); |
|
505 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"'); |
|
506 | 506 | return []; |
507 | 507 | } |
508 | 508 | if (!empty($params['limit'])) { |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | ]; |
517 | 517 | $modelName = $this->modelName; |
518 | 518 | if (!empty($params['categoryPath']) && $modelName::$categoryModel) { |
519 | - $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE']; |
|
519 | + $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE']; |
|
520 | 520 | } |
521 | 521 | if (!empty($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'])) { |
522 | 522 | foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) { |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | if (!empty($params['filters'][$col]['max'])) { |
571 | 571 | if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) { |
572 | 572 | |
573 | - $date = $params['filters'][$col]['max'] . ' 23:59:59'; |
|
573 | + $date = $params['filters'][$col]['max'].' 23:59:59'; |
|
574 | 574 | } else { |
575 | 575 | $date = $params['filters'][$col]['max']; |
576 | 576 | } |
@@ -597,16 +597,16 @@ discard block |
||
597 | 597 | } |
598 | 598 | switch ($params['filters'][$col]['compareType']) { |
599 | 599 | case 'contains': |
600 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
600 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE']; |
|
601 | 601 | break; |
602 | 602 | case 'equals': |
603 | 603 | $queryParams['where'][] = [$col, $params['filters'][$col]['value']]; |
604 | 604 | break; |
605 | 605 | case 'starts_with': |
606 | - $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
606 | + $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE']; |
|
607 | 607 | break; |
608 | 608 | case 'ends_with': |
609 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE']; |
|
609 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE']; |
|
610 | 610 | break; |
611 | 611 | } |
612 | 612 | break; |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | $tableCols[] = !empty($colOptions['label']) ? $colOptions['label'] : $colName; |
641 | 641 | } |
642 | 642 | $tableCols[] = ''; |
643 | - $this->table->class .=' datamanagertable'; |
|
643 | + $this->table->class .= ' datamanagertable'; |
|
644 | 644 | $this->table->setCols($tableCols); |
645 | 645 | } |
646 | 646 | |
@@ -663,12 +663,12 @@ discard block |
||
663 | 663 | return false; |
664 | 664 | } |
665 | 665 | if (!$this->checkAccess()) { |
666 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"'); |
|
666 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"'); |
|
667 | 667 | return []; |
668 | 668 | } |
669 | 669 | $tree = new Tree(); |
670 | 670 | $tree->ul($this->managerOptions['categorys']['model'], 0, function($category) { |
671 | - $path = $category->tree_path . ($category->pk() ? $category->pk() . "/" : ''); |
|
671 | + $path = $category->tree_path.($category->pk() ? $category->pk()."/" : ''); |
|
672 | 672 | $cleanClassName = str_replace('\\', '\\\\', get_class($category)); |
673 | 673 | return "<a href='#' onclick='inji.Ui.dataManagers.get(this).switchCategory(this);return false;' data-index='{$category->index()}' data-path ='{$path}' data-id='{$category->pk()}'> {$category->name}</a> |
674 | 674 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $name = ''; |
53 | 53 | foreach ($fields as $field) { |
54 | 54 | if ($field->save && !empty($data[$field->id])) { |
55 | - $name .= htmlspecialchars($data[$field->id]) . ' '; |
|
55 | + $name .= htmlspecialchars($data[$field->id]).' '; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | $name = trim($name); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $name = ''; |
110 | 110 | foreach ($fields as $field) { |
111 | 111 | if ($field->save && !empty($data[$field->id])) { |
112 | - $name .= htmlspecialchars($data[$field->id]) . ' '; |
|
112 | + $name .= htmlspecialchars($data[$field->id]).' '; |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | $name = trim($name); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | foreach ($options['sort'] as $col => $direction) { |
197 | 197 | switch ($col) { |
198 | 198 | case 'price': |
199 | - $selectOptions['order'][] = [Ecommerce\Item\Offer\Price::colPrefix() . 'price', strtolower($direction) == 'desc' ? 'desc' : 'asc']; |
|
199 | + $selectOptions['order'][] = [Ecommerce\Item\Offer\Price::colPrefix().'price', strtolower($direction) == 'desc' ? 'desc' : 'asc']; |
|
200 | 200 | break; |
201 | 201 | case 'name': |
202 | 202 | $selectOptions['order'][] = ['name', strtolower($direction) == 'desc' ? 'desc' : 'asc']; |
@@ -215,22 +215,22 @@ discard block |
||
215 | 215 | $selectOptions['where'][] = ['image_file_id', 0, '!=']; |
216 | 216 | } |
217 | 217 | |
218 | - $selectOptions['join'][] = [Ecommerce\Item\Offer::table(), Ecommerce\Item::index() . ' = ' . Ecommerce\Item\Offer::colPrefix() . Ecommerce\Item::index(), 'inner']; |
|
218 | + $selectOptions['join'][] = [Ecommerce\Item\Offer::table(), Ecommerce\Item::index().' = '.Ecommerce\Item\Offer::colPrefix().Ecommerce\Item::index(), 'inner']; |
|
219 | 219 | |
220 | 220 | $selectOptions['join'][] = [Ecommerce\Item\Offer\Price::table(), |
221 | - Ecommerce\Item\Offer::index() . ' = ' . Ecommerce\Item\Offer\Price::colPrefix() . Ecommerce\Item\Offer::index() . |
|
222 | - (empty($this->config['show_zero_price']) ? ' and ' . Ecommerce\Item\Offer\Price::colPrefix() . 'price>0' : ''), |
|
221 | + Ecommerce\Item\Offer::index().' = '.Ecommerce\Item\Offer\Price::colPrefix().Ecommerce\Item\Offer::index(). |
|
222 | + (empty($this->config['show_zero_price']) ? ' and '.Ecommerce\Item\Offer\Price::colPrefix().'price>0' : ''), |
|
223 | 223 | empty($this->config['show_without_price']) ? 'inner' : 'left']; |
224 | 224 | |
225 | 225 | $selectOptions['join'][] = [ |
226 | - Ecommerce\Item\Offer\Price\Type::table(), Ecommerce\Item\Offer\Price::colPrefix() . Ecommerce\Item\Offer\Price\Type::index() . ' = ' . Ecommerce\Item\Offer\Price\Type::index() |
|
226 | + Ecommerce\Item\Offer\Price\Type::table(), Ecommerce\Item\Offer\Price::colPrefix().Ecommerce\Item\Offer\Price\Type::index().' = '.Ecommerce\Item\Offer\Price\Type::index() |
|
227 | 227 | ]; |
228 | 228 | |
229 | 229 | $selectOptions['where'][] = [ |
230 | 230 | [Ecommerce\Item\Offer\Price\Type::index(), NULL, 'is'], |
231 | 231 | [ |
232 | - [Ecommerce\Item\Offer\Price\Type::colPrefix() . 'roles', '', '=', 'OR'], |
|
233 | - [Ecommerce\Item\Offer\Price\Type::colPrefix() . 'roles', '%|' . \Users\User::$cur->role_id . '|%', 'LIKE', 'OR'], |
|
232 | + [Ecommerce\Item\Offer\Price\Type::colPrefix().'roles', '', '=', 'OR'], |
|
233 | + [Ecommerce\Item\Offer\Price\Type::colPrefix().'roles', '%|'.\Users\User::$cur->role_id.'|%', 'LIKE', 'OR'], |
|
234 | 234 | ], |
235 | 235 | ]; |
236 | 236 | |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | if (!empty($this->config['view_filter'])) { |
239 | 239 | if (!empty($this->config['view_filter']['options'])) { |
240 | 240 | foreach ($this->config['view_filter']['options'] as $optionId => $optionValue) { |
241 | - $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index() . ' = ' . 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item::index() . ' AND ' . |
|
242 | - 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item\Option::index() . ' = "' . (int) $optionId . '" AND ' . |
|
243 | - 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . 'value = "' . (int) $optionValue . '"', |
|
244 | - 'inner', 'option' . $optionId]; |
|
241 | + $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index().' = '.'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item::index().' AND '. |
|
242 | + 'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item\Option::index().' = "'.(int) $optionId.'" AND '. |
|
243 | + 'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().'value = "'.(int) $optionValue.'"', |
|
244 | + 'inner', 'option'.$optionId]; |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | } |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | switch ($col) { |
252 | 252 | case 'price': |
253 | 253 | if (!empty($filter['min'])) { |
254 | - $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix() . 'price', (float) $filter['min'], '>=']; |
|
254 | + $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix().'price', (float) $filter['min'], '>=']; |
|
255 | 255 | } |
256 | 256 | if (!empty($filter['max'])) { |
257 | - $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix() . 'price', (float) $filter['max'], '<=']; |
|
257 | + $selectOptions['where'][] = [Ecommerce\Item\Offer\Price::colPrefix().'price', (float) $filter['max'], '<=']; |
|
258 | 258 | } |
259 | 259 | break; |
260 | 260 | case 'options': |
261 | 261 | foreach ($filter as $optionId => $optionValue) { |
262 | 262 | $optionId = (int) $optionId; |
263 | - $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index() . ' = ' . 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item::index() . ' AND ' . |
|
264 | - 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . Ecommerce\Item\Option::index() . ' = "' . (int) $optionId . '" AND ' . |
|
265 | - 'option' . $optionId . '.' . Ecommerce\Item\Param::colPrefix() . 'value = ' . \App::$cur->db->connection->pdo->quote($optionValue) . '', |
|
266 | - 'inner', 'option' . $optionId]; |
|
263 | + $selectOptions['join'][] = [Ecommerce\Item\Param::table(), Ecommerce\Item::index().' = '.'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item::index().' AND '. |
|
264 | + 'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().Ecommerce\Item\Option::index().' = "'.(int) $optionId.'" AND '. |
|
265 | + 'option'.$optionId.'.'.Ecommerce\Item\Param::colPrefix().'value = '.\App::$cur->db->connection->pdo->quote($optionValue).'', |
|
266 | + 'inner', 'option'.$optionId]; |
|
267 | 267 | } |
268 | 268 | break; |
269 | 269 | case 'offerOptions': |
270 | 270 | //$selectOptions['join'][] = [Ecommerce\Item\Offer::table(), Ecommerce\Item::index() . ' = offer.' . Ecommerce\Item\Offer::colPrefix() . Ecommerce\Item::index(), 'left', 'offer']; |
271 | 271 | foreach ($filter as $optionId => $optionValue) { |
272 | 272 | $optionId = (int) $optionId; |
273 | - $selectOptions['join'][] = [Ecommerce\Item\Offer\Param::table(), Ecommerce\Item\Offer::index() . ' = ' . 'offerOption' . $optionId . '.' . Ecommerce\Item\Offer\Param::colPrefix() . Ecommerce\Item\Offer::index() . ' AND ' . |
|
274 | - 'offerOption' . $optionId . '.' . Ecommerce\Item\Offer\Param::colPrefix() . Ecommerce\Item\Offer\Option::index() . ' = "' . (int) $optionId . '" AND ' . |
|
275 | - 'offerOption' . $optionId . '.' . Ecommerce\Item\Offer\Param::colPrefix() . 'value = ' . \App::$cur->db->connection->pdo->quote($optionValue) . '', |
|
276 | - 'inner', 'offerOption' . $optionId]; |
|
273 | + $selectOptions['join'][] = [Ecommerce\Item\Offer\Param::table(), Ecommerce\Item\Offer::index().' = '.'offerOption'.$optionId.'.'.Ecommerce\Item\Offer\Param::colPrefix().Ecommerce\Item\Offer::index().' AND '. |
|
274 | + 'offerOption'.$optionId.'.'.Ecommerce\Item\Offer\Param::colPrefix().Ecommerce\Item\Offer\Option::index().' = "'.(int) $optionId.'" AND '. |
|
275 | + 'offerOption'.$optionId.'.'.Ecommerce\Item\Offer\Param::colPrefix().'value = '.\App::$cur->db->connection->pdo->quote($optionValue).'', |
|
276 | + 'inner', 'offerOption'.$optionId]; |
|
277 | 277 | } |
278 | 278 | break; |
279 | 279 | } |
@@ -288,13 +288,13 @@ discard block |
||
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | $category = \Ecommerce\Category::get($categoryId); |
291 | - $where[] = ['tree_path', $category->tree_path . (int) $categoryId . '/%', 'LIKE', $first ? 'AND' : 'OR']; |
|
291 | + $where[] = ['tree_path', $category->tree_path.(int) $categoryId.'/%', 'LIKE', $first ? 'AND' : 'OR']; |
|
292 | 292 | $first = false; |
293 | 293 | } |
294 | 294 | $selectOptions['where'][] = $where; |
295 | 295 | } elseif (!empty($options['parent'])) { |
296 | 296 | $category = \Ecommerce\Category::get($options['parent']); |
297 | - $selectOptions['where'][] = ['tree_path', $category->tree_path . (int) $options['parent'] . '/%', 'LIKE']; |
|
297 | + $selectOptions['where'][] = ['tree_path', $category->tree_path.(int) $options['parent'].'/%', 'LIKE']; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | //search |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | foreach (explode(' ', $searchStr) as $part) { |
305 | 305 | $part = trim($part); |
306 | 306 | if ($part && strlen($part) > 2) { |
307 | - $searchArr[] = ['search_index', '%' . $part . '%', 'LIKE']; |
|
307 | + $searchArr[] = ['search_index', '%'.$part.'%', 'LIKE']; |
|
308 | 308 | } |
309 | 309 | } |
310 | 310 | if (!empty($searchArr)) { |
@@ -323,19 +323,19 @@ discard block |
||
323 | 323 | } |
324 | 324 | $selectOptions['where'][] = [ |
325 | 325 | '( |
326 | - (SELECT COALESCE(sum(`' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count`),0) |
|
327 | - FROM ' . \App::$cur->db->table_prefix . \Ecommerce\Item\Offer\Warehouse::table() . ' iciw |
|
328 | - WHERE iciw.' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index() . ' = ' . \Ecommerce\Item\Offer::index() . ' |
|
329 | - ' . ($warehouseIds ? ' AND iciw.' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Warehouse::index() . ' IN(' . implode(',', $warehouseIds) . ')' : '') . ' |
|
326 | + (SELECT COALESCE(sum(`' . \Ecommerce\Item\Offer\Warehouse::colPrefix().'count`),0) |
|
327 | + FROM ' . \App::$cur->db->table_prefix.\Ecommerce\Item\Offer\Warehouse::table().' iciw |
|
328 | + WHERE iciw.' . \Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index().' = '.\Ecommerce\Item\Offer::index().' |
|
329 | + ' . ($warehouseIds ? ' AND iciw.'.\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Warehouse::index().' IN('.implode(',', $warehouseIds).')' : '').' |
|
330 | 330 | ) |
331 | 331 | - |
332 | - (SELECT COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) |
|
333 | - FROM ' . \App::$cur->db->table_prefix . \Ecommerce\Warehouse\Block::table() . ' iewb |
|
334 | - inner JOIN ' . \App::$cur->db->table_prefix . \Ecommerce\Cart::table() . ' icc ON icc.' . \Ecommerce\Cart::index() . ' = iewb.' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND ( |
|
335 | - (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) || |
|
336 | - (`' . \Ecommerce\Cart::colPrefix() . \Ecommerce\Cart\Status::index() . '` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
332 | + (SELECT COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix().'count) ,0) |
|
333 | + FROM ' . \App::$cur->db->table_prefix.\Ecommerce\Warehouse\Block::table().' iewb |
|
334 | + inner JOIN ' . \App::$cur->db->table_prefix.\Ecommerce\Cart::table().' icc ON icc.'.\Ecommerce\Cart::index().' = iewb.'.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND ( |
|
335 | + (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) || |
|
336 | + (`' . \Ecommerce\Cart::colPrefix().\Ecommerce\Cart\Status::index().'` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
337 | 337 | ) |
338 | - WHERE iewb.' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index() . ' = ' . \Ecommerce\Item\Offer::index() . ') |
|
338 | + WHERE iewb.' . \Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index().' = '.\Ecommerce\Item\Offer::index().') |
|
339 | 339 | )', |
340 | 340 | 0, |
341 | 341 | '>' |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $items = Ecommerce\Item::getList($selectOptions); |
365 | 365 | $items = Ecommerce\Item\Param::getList([ |
366 | 366 | 'where' => ['item_id', array_keys($items), 'IN'], |
367 | - 'join' => [[Ecommerce\Item\Option::table(), Ecommerce\Item\Option::index() . ' = ' . \Ecommerce\Item\Param::colPrefix() . Ecommerce\Item\Option::index() . ' and ' . \Ecommerce\Item\Option::colPrefix() . 'searchable = 1', 'inner']], |
|
367 | + 'join' => [[Ecommerce\Item\Option::table(), Ecommerce\Item\Option::index().' = '.\Ecommerce\Item\Param::colPrefix().Ecommerce\Item\Option::index().' and '.\Ecommerce\Item\Option::colPrefix().'searchable = 1', 'inner']], |
|
368 | 368 | 'distinct' => \Ecommerce\Item\Option::index() |
369 | 369 | ]); |
370 | 370 | return $items; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | if (is_array($counts)) { |
398 | 398 | $sum = 0; |
399 | 399 | foreach ($counts as $count) { |
400 | - $sum +=$count['count']; |
|
400 | + $sum += $count['count']; |
|
401 | 401 | } |
402 | 402 | return $sum; |
403 | 403 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | |
434 | 434 | if (!empty($conf['files']['aditionTemplateFiels'])) { |
435 | 435 | foreach ($conf['files']['aditionTemplateFiels'] as $file) { |
436 | - $return[$file['file']] = '- ' . $file['name']; |
|
436 | + $return[$file['file']] = '- '.$file['name']; |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 | return $return; |
@@ -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 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $this->formName = $form; |
49 | 49 | $this->form = \App::$cur->ui->getModelForm($this->modelName, $form); |
50 | 50 | if (empty($this->form)) { |
51 | - throw new \Exception('empty form ' . $form); |
|
51 | + throw new \Exception('empty form '.$form); |
|
52 | 52 | } |
53 | 53 | $this->inputs = $this->getInputs(); |
54 | 54 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->model->_params[$modelName::index()] = 0; |
85 | 85 | } |
86 | 86 | $relOptions['model']::fixPrefix($relOptions['col']); |
87 | - $inputs[$col] = new ActiveForm(new $relOptions['model']([ $relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
87 | + $inputs[$col] = new ActiveForm(new $relOptions['model']([$relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
88 | 88 | } |
89 | 89 | $inputs[$col]->parent = $this; |
90 | 90 | } elseif (!empty($modelName::$cols[$col])) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public function checkRequest($params = [], $ajax = false) |
99 | 99 | { |
100 | 100 | if (!$this->checkAccess()) { |
101 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->formName . '"'); |
|
101 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->formName.'"'); |
|
102 | 102 | return []; |
103 | 103 | } |
104 | 104 | $successId = 0; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if (!empty($this->form['userGroupReadonly'][\Users\User::$cur->group_id]) && in_array($col, $this->form['userGroupReadonly'][\Users\User::$cur->group_id])) { |
123 | 123 | continue; |
124 | 124 | } |
125 | - $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($param['type']); |
|
125 | + $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($param['type']); |
|
126 | 126 | $input = new $inputClassName(); |
127 | 127 | $input->activeForm = $this; |
128 | 128 | $input->activeFormParams = $params; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | if ($ajax) { |
168 | 168 | \Msg::show(); |
169 | 169 | } elseif (!empty($_GET['redirectUrl'])) { |
170 | - \Tools::redirect($_GET['redirectUrl'] . (!empty($_GET['dataManagerHash']) ? '#' . $_GET['dataManagerHash'] : '')); |
|
170 | + \Tools::redirect($_GET['redirectUrl'].(!empty($_GET['dataManagerHash']) ? '#'.$_GET['dataManagerHash'] : '')); |
|
171 | 171 | } |
172 | 172 | $successId = $this->model->pk(); |
173 | 173 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function draw($params = [], $ajax = false) |
183 | 183 | { |
184 | 184 | if (!$this->checkAccess()) { |
185 | - $this->drawError('you not have access to "' . $this->modelName . '" form with name: "' . $this->formName . '"'); |
|
185 | + $this->drawError('you not have access to "'.$this->modelName.'" form with name: "'.$this->formName.'"'); |
|
186 | 186 | return []; |
187 | 187 | } |
188 | 188 | $form = new Form(!empty($this->form['formOptions']) ? $this->form['formOptions'] : []); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | if (is_object($options)) { |
195 | 195 | $options->draw(); |
196 | 196 | } else { |
197 | - $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($options['type']); |
|
197 | + $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($options['type']); |
|
198 | 198 | $input = new $inputClassName(); |
199 | 199 | $input->form = $form; |
200 | 200 | $input->activeForm = $this; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | foreach ($values as $key => $value) { |
273 | 273 | if (is_array($value) && !empty($value['input']) && empty($value['input']['noprefix'])) { |
274 | - $values[$key]['input']['name'] = $aditionalInputNamePrefix . "[{$value['input']['name']}]"; |
|
274 | + $values[$key]['input']['name'] = $aditionalInputNamePrefix."[{$value['input']['name']}]"; |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | return $values; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | public function checkAccess() |
296 | 296 | { |
297 | 297 | if (empty($this->form)) { |
298 | - $this->drawError('"' . $this->modelName . '" form with name: "' . $this->formName . '" not found'); |
|
298 | + $this->drawError('"'.$this->modelName.'" form with name: "'.$this->formName.'" not found'); |
|
299 | 299 | return false; |
300 | 300 | } |
301 | 301 | if (\App::$cur->Access && !\App::$cur->Access->checkAccess($this)) { |