@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public static function uriParse($uri) |
39 | 39 | { |
40 | 40 | $answerPos = strpos($uri, '?'); |
41 | - $params = array_slice(explode('/', substr($uri, 0, $answerPos ? $answerPos : strlen($uri) )), 1); |
|
41 | + $params = array_slice(explode('/', substr($uri, 0, $answerPos ? $answerPos : strlen($uri))), 1); |
|
42 | 42 | |
43 | 43 | foreach ($params as $key => $param) { |
44 | 44 | if ($param != '') { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $path = explode('/', $path); |
65 | 65 | $cur = ''; |
66 | 66 | foreach ($path as $item) { |
67 | - $cur .= $item . '/'; |
|
67 | + $cur .= $item.'/'; |
|
68 | 68 | if (!file_exists($cur)) { |
69 | 69 | mkdir($cur); |
70 | 70 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public static function resizeImage($img_path, $max_width = 1000, $max_height = 1000, $crop = false, $pos = 'center') |
86 | 86 | { |
87 | 87 | ini_set("gd.jpeg_ignore_warning", 1); |
88 | - list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($img_path); |
|
88 | + list($img_width, $img_height, $img_type, $img_tag) = getimagesize($img_path); |
|
89 | 89 | switch ($img_type) { |
90 | 90 | case 1: |
91 | 91 | $img_type = 'gif'; |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | |
109 | 109 | if ($crop === true || $crop == 'q') { |
110 | 110 | if ($img_width > $img_height) { |
111 | - $imgX = floor(( $img_width - $img_height ) / 2); |
|
111 | + $imgX = floor(($img_width - $img_height) / 2); |
|
112 | 112 | $imgY = 0; |
113 | 113 | $img_width = $img_height; |
114 | 114 | $new_width = $max_width; |
115 | 115 | $new_height = $max_height; |
116 | 116 | } else { |
117 | 117 | $imgX = 0; |
118 | - $imgY = floor(( $img_height - $img_width ) / 2); |
|
118 | + $imgY = floor(($img_height - $img_width) / 2); |
|
119 | 119 | $img_height = $img_width; |
120 | 120 | $new_width = $max_width; |
121 | 121 | $new_height = $max_height; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $new_width = $max_width; |
137 | 137 | $new_height = $max_height; |
138 | 138 | //Находим начальные координаты (центрируем новое изображение) |
139 | - $imgX = (int) (($ow / 2) - ($img_width / 2) ); |
|
139 | + $imgX = (int) (($ow / 2) - ($img_width / 2)); |
|
140 | 140 | if ($pos == 'center') { |
141 | 141 | $imgY = (int) (($oh / 2) - ($img_height / 2)); |
142 | 142 | } else { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | if (!headers_sent()) { |
207 | 207 | header("Location: {$href}"); |
208 | 208 | } else { |
209 | - echo '\'"><script>window.location="' . $href . '";</script>'; |
|
209 | + echo '\'"><script>window.location="'.$href.'";</script>'; |
|
210 | 210 | } |
211 | 211 | exit("Перенаправление на: <a href = '{$href}'>{$href}</a>"); |
212 | 212 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $pathArray = $cleanPathArray; |
267 | 267 | $cleanPathArray = []; |
268 | 268 | } while ($changes); |
269 | - return (strpos($path, '/') === 0 ? '/' : '') . implode('/', $pathArray); |
|
269 | + return (strpos($path, '/') === 0 ? '/' : '').implode('/', $pathArray); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | if (empty($month[$mm - 1])) { |
288 | 288 | return 'Не указано'; |
289 | 289 | } |
290 | - return ($dd > 0 ? $dd . " " : '') . $month[$mm - 1] . " " . $yy . " " . $hours; |
|
290 | + return ($dd > 0 ? $dd." " : '').$month[$mm - 1]." ".$yy." ".$hours; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -369,10 +369,10 @@ discard block |
||
369 | 369 | if (in_array($file, ['.', '..'])) { |
370 | 370 | continue; |
371 | 371 | } |
372 | - if (is_dir($from . '/' . $file)) { |
|
373 | - self::copyFiles($from . '/' . $file, $to . '/' . $file); |
|
372 | + if (is_dir($from.'/'.$file)) { |
|
373 | + self::copyFiles($from.'/'.$file, $to.'/'.$file); |
|
374 | 374 | } else { |
375 | - copy($from . '/' . $file, $to . '/' . $file); |
|
375 | + copy($from.'/'.$file, $to.'/'.$file); |
|
376 | 376 | } |
377 | 377 | } |
378 | 378 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | return self::$_configs['system']; |
29 | 29 | } |
30 | 30 | |
31 | - if (!file_exists(INJI_SYSTEM_DIR . '/config/config.php')) { |
|
31 | + if (!file_exists(INJI_SYSTEM_DIR.'/config/config.php')) { |
|
32 | 32 | return []; |
33 | 33 | } |
34 | 34 | |
35 | - return self::$_configs['system'] = include INJI_SYSTEM_DIR . '/config/config.php'; |
|
35 | + return self::$_configs['system'] = include INJI_SYSTEM_DIR.'/config/config.php'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | return self::$_configs['app'][$app->name]; |
69 | 69 | } |
70 | 70 | |
71 | - $path = $app->path . "/config/config.php"; |
|
71 | + $path = $app->path."/config/config.php"; |
|
72 | 72 | if (!file_exists($path)) { |
73 | 73 | return []; |
74 | 74 | } |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | if (isset(self::$_configs['shareModules'][$module])) { |
89 | 89 | return self::$_configs['shareModules'][$module]; |
90 | 90 | } |
91 | - $path = INJI_PROGRAM_DIR . "/config/modules/{$module}.php"; |
|
91 | + $path = INJI_PROGRAM_DIR."/config/modules/{$module}.php"; |
|
92 | 92 | } else { |
93 | 93 | if (isset(self::$_configs['share'])) { |
94 | 94 | return self::$_configs['share']; |
95 | 95 | } |
96 | - $path = INJI_PROGRAM_DIR . "/config/config.php"; |
|
96 | + $path = INJI_PROGRAM_DIR."/config/config.php"; |
|
97 | 97 | } |
98 | 98 | if (!file_exists($path)) { |
99 | - if (file_exists(INJI_SYSTEM_DIR . "/modules/{$module}/defaultConfig.php")) { |
|
100 | - $path = INJI_SYSTEM_DIR . "/modules/{$module}/defaultConfig.php"; |
|
99 | + if (file_exists(INJI_SYSTEM_DIR."/modules/{$module}/defaultConfig.php")) { |
|
100 | + $path = INJI_SYSTEM_DIR."/modules/{$module}/defaultConfig.php"; |
|
101 | 101 | } else { |
102 | 102 | return []; |
103 | 103 | } |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | return self::$_configs['module'][$appName][$module_name]; |
137 | 137 | } |
138 | 138 | |
139 | - $path = $appPath . "/config/modules/{$module_name}.php"; |
|
139 | + $path = $appPath."/config/modules/{$module_name}.php"; |
|
140 | 140 | if (!file_exists($path)) { |
141 | - $path = INJI_SYSTEM_DIR . "/modules/{$module_name}/defaultConfig.php"; |
|
141 | + $path = INJI_SYSTEM_DIR."/modules/{$module_name}/defaultConfig.php"; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -163,27 +163,27 @@ discard block |
||
163 | 163 | } |
164 | 164 | switch ($type) { |
165 | 165 | case 'system': |
166 | - $path = INJI_SYSTEM_DIR . '/config/config.php'; |
|
166 | + $path = INJI_SYSTEM_DIR.'/config/config.php'; |
|
167 | 167 | self::$_configs['system'] = $data; |
168 | 168 | Inji::$inst->event('Config-change-system', $data); |
169 | 169 | break; |
170 | 170 | case 'app': |
171 | - $path = $app->path . "/config/config.php"; |
|
171 | + $path = $app->path."/config/config.php"; |
|
172 | 172 | self::$_configs['app'][$app->name] = $data; |
173 | - Inji::$inst->event('Config-change-app-' . $app->name, $data); |
|
173 | + Inji::$inst->event('Config-change-app-'.$app->name, $data); |
|
174 | 174 | break; |
175 | 175 | case 'module': |
176 | - $path = $app->path . "/config/modules/{$module}.php"; |
|
176 | + $path = $app->path."/config/modules/{$module}.php"; |
|
177 | 177 | self::$_configs['module'][$app->name][$module] = $data; |
178 | - Inji::$inst->event('Config-change-module-' . $app->name . '-' . $module, $data); |
|
178 | + Inji::$inst->event('Config-change-module-'.$app->name.'-'.$module, $data); |
|
179 | 179 | break; |
180 | 180 | case 'share': |
181 | 181 | if ($module) { |
182 | - $path = INJI_PROGRAM_DIR . "/config/modules/{$module}.php"; |
|
182 | + $path = INJI_PROGRAM_DIR."/config/modules/{$module}.php"; |
|
183 | 183 | self::$_configs['shareModules'][$module] = $data; |
184 | - Inji::$inst->event('Config-change-shareModules-' . $module, $data); |
|
184 | + Inji::$inst->event('Config-change-shareModules-'.$module, $data); |
|
185 | 185 | } else { |
186 | - $path = INJI_PROGRAM_DIR . "/config/config.php"; |
|
186 | + $path = INJI_PROGRAM_DIR."/config/config.php"; |
|
187 | 187 | self::$_configs['share'] = $data; |
188 | 188 | Inji::$inst->event('Config-change-share', $data); |
189 | 189 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | self::$_configs['custom'][$path] = $data; |
194 | 194 | break; |
195 | 195 | } |
196 | - $text = "<?php\nreturn " . CodeGenerator::genArray($data); |
|
196 | + $text = "<?php\nreturn ".CodeGenerator::genArray($data); |
|
197 | 197 | Tools::createDir(substr($path, 0, strripos($path, '/'))); |
198 | 198 | file_put_contents($path, $text); |
199 | 199 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | if ($type == 'array') { |
19 | 19 | return !is_array($_GET[$key]) ? [] : $_GET[$key]; |
20 | 20 | } |
21 | - return eval('return (' . $type . ') $_GET[$key];'); |
|
21 | + return eval('return ('.$type.') $_GET[$key];'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $month = array('января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'); |
39 | 39 | $yearPosrfix = isset($options['yearPostfix']) ? $options['yearPostfix'] : " г."; |
40 | - return ($dd > 0 ? $dd . " " : '') . $month[$mm - 1] . " " . $yy . $yearPosrfix . (empty($options['notime']) ? " " . $hours : ''); |
|
40 | + return ($dd > 0 ? $dd." " : '').$month[$mm - 1]." ".$yy.$yearPosrfix.(empty($options['notime']) ? " ".$hours : ''); |
|
41 | 41 | case 'select': |
42 | 42 | switch ($colInfo['colParams']['source']) { |
43 | 43 | case 'model': |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | case 'image': |
65 | 65 | $file = Files\File::get($this->model->{$this->valueKey}); |
66 | 66 | if ($file) { |
67 | - return '<img src="' . $file->path . '?resize=60x120" />'; |
|
67 | + return '<img src="'.$file->path.'?resize=60x120" />'; |
|
68 | 68 | } else { |
69 | 69 | return '<img src="/static/system/images/no-image.png?resize=60x120" />'; |
70 | 70 | } |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | public function listen($eventName, $listenCode, $callback, $save = false) |
50 | 50 | { |
51 | 51 | if ($save) { |
52 | - $config = Config::custom(App::$primary->path . '/config/events.php'); |
|
52 | + $config = Config::custom(App::$primary->path.'/config/events.php'); |
|
53 | 53 | $config[$eventName][$listenCode] = serialize($callback); |
54 | - Config::save(App::$primary->path . '/config/events.php', $config); |
|
54 | + Config::save(App::$primary->path.'/config/events.php', $config); |
|
55 | 55 | } else { |
56 | 56 | $this->_listeners[$eventName][$listenCode] = $callback; |
57 | 57 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if (!empty($this->_listeners[$eventName])) { |
76 | 76 | $listeners = $this->_listeners[$eventName]; |
77 | 77 | } |
78 | - $config = Config::custom(App::$primary->path . '/config/events.php'); |
|
78 | + $config = Config::custom(App::$primary->path.'/config/events.php'); |
|
79 | 79 | if (!empty($config[$eventName])) { |
80 | 80 | foreach ($config[$eventName] as $listenCode => $callback) { |
81 | 81 | $listeners[$listenCode] = (@unserialize($callback) !== false) ? unserialize($callback) : $callback; |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | public function unlisten($eventName, $listenCode, $save = false) |
111 | 111 | { |
112 | 112 | if ($save) { |
113 | - $config = Config::custom(App::$primary->path . '/config/events.php'); |
|
113 | + $config = Config::custom(App::$primary->path.'/config/events.php'); |
|
114 | 114 | if (!empty($config[$eventName][$listenCode])) { |
115 | 115 | unset($config[$eventName][$listenCode]); |
116 | - Config::save(App::$primary->path . '/config/events.php', $config); |
|
116 | + Config::save(App::$primary->path.'/config/events.php', $config); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | if (!empty($this->_listeners[$eventName][$listenCode])) { |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | { |
21 | 21 | if (!$model) { |
22 | 22 | $modulePath = Module::getModulePath($this->module->moduleName); |
23 | - $path = $modulePath . '/models'; |
|
23 | + $path = $modulePath.'/models'; |
|
24 | 24 | if (file_exists($path)) { |
25 | 25 | $files = array_slice(scandir($path), 2); |
26 | 26 | foreach ($files as $file) { |
27 | - if (is_dir($path . '/' . $file)) { |
|
27 | + if (is_dir($path.'/'.$file)) { |
|
28 | 28 | continue; |
29 | 29 | } |
30 | 30 | $model = pathinfo($file, PATHINFO_FILENAME); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | } |
35 | - $fullModelName = $this->module->moduleName . '\\' . ucfirst($model); |
|
35 | + $fullModelName = $this->module->moduleName.'\\'.ucfirst($model); |
|
36 | 36 | $dataManager = new Ui\DataManager($fullModelName, $dataManager); |
37 | 37 | $title = !empty($dataManager->managerOptions['name']) ? $dataManager->managerOptions['name'] : $fullModelName::objectName(); |
38 | 38 | $this->view->setTitle($title); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | public function viewAction($model, $pk) |
43 | 43 | { |
44 | - $fullModelName = $this->module->moduleName . '\\' . ucfirst($model); |
|
44 | + $fullModelName = $this->module->moduleName.'\\'.ucfirst($model); |
|
45 | 45 | $item = $fullModelName::get($pk); |
46 | 46 | $this->view->setTitle($item->name()); |
47 | 47 | if (!empty($_POST['comment'])) { |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | // time start |
17 | 17 | define('INJI_TIME_START', microtime(true)); |
18 | 18 | // system files dir |
19 | -define('INJI_SYSTEM_DIR', __DIR__ . '/system'); |
|
19 | +define('INJI_SYSTEM_DIR', __DIR__.'/system'); |
|
20 | 20 | // apps files dir |
21 | -define('INJI_PROGRAM_DIR', __DIR__ . '/program'); |
|
21 | +define('INJI_PROGRAM_DIR', __DIR__.'/program'); |
|
22 | 22 | |
23 | 23 | // check base config |
24 | 24 | if (!file_exists(INJI_SYSTEM_DIR) || !is_dir(INJI_SYSTEM_DIR)) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | -require_once( INJI_SYSTEM_DIR . '/init.php' ); |
|
38 | +require_once(INJI_SYSTEM_DIR.'/init.php'); |
|
39 | 39 | /** |
40 | 40 | * System error messages |
41 | 41 | */ |
@@ -89,16 +89,16 @@ |
||
89 | 89 | |
90 | 90 | public function name() |
91 | 91 | { |
92 | - if ($this->first_name . $this->last_name . $this->middle_name) { |
|
92 | + if ($this->first_name.$this->last_name.$this->middle_name) { |
|
93 | 93 | $name = ''; |
94 | 94 | if ($this->first_name) { |
95 | - $name.=$this->first_name; |
|
95 | + $name .= $this->first_name; |
|
96 | 96 | } |
97 | 97 | if ($this->middle_name) { |
98 | - $name.=($name ? ' ' : '') . $this->middle_name; |
|
98 | + $name .= ($name ? ' ' : '').$this->middle_name; |
|
99 | 99 | } |
100 | 100 | if ($this->last_name) { |
101 | - $name.=($name ? ' ' : '') . $this->last_name; |
|
101 | + $name .= ($name ? ' ' : '').$this->last_name; |
|
102 | 102 | } |
103 | 103 | return $name; |
104 | 104 | } else { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | |
2 | 2 | <?php |
3 | 3 | echo empty($options['noContainer']) ? '<div class="form-group">' : ''; |
4 | -echo $label !== false ? "<label>{$label}" . (!empty($options['required']) ? ' <span class="required-star">*</span>' : '') . "</label>" : ''; |
|
4 | +echo $label !== false ? "<label>{$label}".(!empty($options['required']) ? ' <span class="required-star">*</span>' : '')."</label>" : ''; |
|
5 | 5 | ?> |
6 | 6 | <div class="row"> |
7 | 7 | <div class="col-xs-6"> |