@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | $this->setParams($params); |
96 | 96 | if (!$this->path) { |
97 | - $this->path = $this->app->view->templatesPath . '/' . $this->name; |
|
97 | + $this->path = $this->app->view->templatesPath.'/'.$this->name; |
|
98 | 98 | } |
99 | 99 | $this->loadConfig(); |
100 | 100 | $this->setPage(); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public function loadConfig($configPath = '') |
111 | 111 | { |
112 | 112 | if (!$configPath) { |
113 | - $configPath = $this->path . '/config.php'; |
|
113 | + $configPath = $this->path.'/config.php'; |
|
114 | 114 | } |
115 | 115 | $this->configPath = $configPath; |
116 | 116 | $this->config = \Config::custom($this->configPath); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | $this->page = $page; |
142 | 142 | if (!$this->pagePath) { |
143 | - $this->pagePath = $this->path . '/' . $this->page . '.html'; |
|
143 | + $this->pagePath = $this->path.'/'.$this->page.'.html'; |
|
144 | 144 | } |
145 | 145 | $this->pagePath = \Tools::pathsResolve($this->getPagePaths(), $this->pagePath); |
146 | 146 | } |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | $page = $this->page; |
158 | 158 | } |
159 | 159 | return [ |
160 | - 'template' => $this->path . '/' . $page . '.html', |
|
161 | - 'defaultPage' => \Module::getModulePath('View') . '/templatePages/' . $page . '.html' |
|
160 | + 'template' => $this->path.'/'.$page.'.html', |
|
161 | + 'defaultPage' => \Module::getModulePath('View').'/templatePages/'.$page.'.html' |
|
162 | 162 | ]; |
163 | 163 | } |
164 | 164 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $this->content = \Controller::$cur->method; |
195 | 195 | } |
196 | 196 | if ((!$this->contentPath || $content) && \Module::$cur) { |
197 | - $this->contentPath = \Module::$cur->path . '/' . \Module::$cur->app->type . "Controllers/content/{$this->content}.php"; |
|
197 | + $this->contentPath = \Module::$cur->path.'/'.\Module::$cur->app->type."Controllers/content/{$this->content}.php"; |
|
198 | 198 | } |
199 | 199 | $this->contentPath = \Tools::pathsResolve($this->getContentPaths(), $this->contentPath); |
200 | 200 | } |
@@ -214,33 +214,33 @@ discard block |
||
214 | 214 | $paths = []; |
215 | 215 | if ($this->module) { |
216 | 216 | if (\Controller::$cur) { |
217 | - $paths['templateModuleController'] = $this->path . "/modules/{$this->module->moduleName}/" . \Controller::$cur->name . "/{$content}.php"; |
|
217 | + $paths['templateModuleController'] = $this->path."/modules/{$this->module->moduleName}/".\Controller::$cur->name."/{$content}.php"; |
|
218 | 218 | } |
219 | - $paths['templateModule'] = $this->path . "/modules/{$this->module->moduleName}/{$content}.php"; |
|
219 | + $paths['templateModule'] = $this->path."/modules/{$this->module->moduleName}/{$content}.php"; |
|
220 | 220 | } |
221 | 221 | if (\Module::$cur) { |
222 | 222 | if (\Controller::$cur) { |
223 | - $paths['templateCurModuleController'] = $this->path . "/modules/" . \Module::$cur->moduleName . "/" . \Controller::$cur->name . "/{$content}.php"; |
|
223 | + $paths['templateCurModuleController'] = $this->path."/modules/".\Module::$cur->moduleName."/".\Controller::$cur->name."/{$content}.php"; |
|
224 | 224 | } |
225 | - $paths['templateCurModule'] = $this->path . "/modules/" . \Module::$cur->moduleName . "/{$content}.php"; |
|
225 | + $paths['templateCurModule'] = $this->path."/modules/".\Module::$cur->moduleName."/{$content}.php"; |
|
226 | 226 | } |
227 | 227 | if (\Controller::$cur) { |
228 | - $paths['appControllerContentController'] = \Controller::$cur->module->app->path . '/modules/' . \Controller::$cur->module->moduleName . '/' . \Controller::$cur->module->app->type . "Controllers/content/" . \Controller::$cur->name . "/{$content}.php"; |
|
229 | - $paths['appControllerContent'] = \Controller::$cur->module->app->path . '/modules/' . \Controller::$cur->module->moduleName . '/' . \Controller::$cur->module->app->type . "Controllers/content/{$content}.php"; |
|
230 | - $paths['controllerContentController'] = \Controller::$cur->path . "/content/" . \Controller::$cur->name . "/{$content}.php"; |
|
231 | - $paths['controllerContent'] = \Controller::$cur->path . "/content/{$content}.php"; |
|
232 | - $paths['moduleControllerContentController'] = \Controller::$cur->module->path . '/' . \Controller::$cur->module->app->type . "Controllers/content/" . \Controller::$cur->name . "/{$content}.php"; |
|
233 | - $paths['moduleControllerContent'] = \Controller::$cur->module->path . '/' . \Controller::$cur->module->app->type . "Controllers/content/{$content}.php"; |
|
228 | + $paths['appControllerContentController'] = \Controller::$cur->module->app->path.'/modules/'.\Controller::$cur->module->moduleName.'/'.\Controller::$cur->module->app->type."Controllers/content/".\Controller::$cur->name."/{$content}.php"; |
|
229 | + $paths['appControllerContent'] = \Controller::$cur->module->app->path.'/modules/'.\Controller::$cur->module->moduleName.'/'.\Controller::$cur->module->app->type."Controllers/content/{$content}.php"; |
|
230 | + $paths['controllerContentController'] = \Controller::$cur->path."/content/".\Controller::$cur->name."/{$content}.php"; |
|
231 | + $paths['controllerContent'] = \Controller::$cur->path."/content/{$content}.php"; |
|
232 | + $paths['moduleControllerContentController'] = \Controller::$cur->module->path.'/'.\Controller::$cur->module->app->type."Controllers/content/".\Controller::$cur->name."/{$content}.php"; |
|
233 | + $paths['moduleControllerContent'] = \Controller::$cur->module->path.'/'.\Controller::$cur->module->app->type."Controllers/content/{$content}.php"; |
|
234 | 234 | } |
235 | 235 | if ($this->module) { |
236 | 236 | if (\Controller::$cur) { |
237 | - $paths['customModuleTemplateControllerContentController'] = $this->path . "/modules/" . $this->module->moduleName . "/" . \Controller::$cur->name . "/{$content}.php"; |
|
237 | + $paths['customModuleTemplateControllerContentController'] = $this->path."/modules/".$this->module->moduleName."/".\Controller::$cur->name."/{$content}.php"; |
|
238 | 238 | } |
239 | - $paths['customModuleTemplateControllerContent'] = $this->path . "/modules/" . $this->module->moduleName . "/{$content}.php"; |
|
239 | + $paths['customModuleTemplateControllerContent'] = $this->path."/modules/".$this->module->moduleName."/{$content}.php"; |
|
240 | 240 | } |
241 | 241 | if ($this->module && \Controller::$cur) { |
242 | - $paths['customModuleControllerContentController'] = $this->module->path . '/' . \Controller::$cur->module->app->type . "Controllers/content/" . \Controller::$cur->name . "/{$content}.php"; |
|
243 | - $paths['customModuleControllerContent'] = $this->module->path . '/' . \Controller::$cur->module->app->type . "Controllers/content/{$content}.php"; |
|
242 | + $paths['customModuleControllerContentController'] = $this->module->path.'/'.\Controller::$cur->module->app->type."Controllers/content/".\Controller::$cur->name."/{$content}.php"; |
|
243 | + $paths['customModuleControllerContent'] = $this->module->path.'/'.\Controller::$cur->module->app->type."Controllers/content/{$content}.php"; |
|
244 | 244 | } |
245 | 245 | return $paths; |
246 | 246 | } |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | if (!$templatesPath) { |
261 | 261 | $templatesPath = $app->view->templatesPath; |
262 | 262 | } |
263 | - if (file_exists($templatesPath . '/' . $templateName)) { |
|
263 | + if (file_exists($templatesPath.'/'.$templateName)) { |
|
264 | 264 | return new Template([ |
265 | 265 | 'name' => $templateName, |
266 | - 'path' => $templatesPath . '/' . $templateName, |
|
266 | + 'path' => $templatesPath.'/'.$templateName, |
|
267 | 267 | 'app' => $app |
268 | 268 | ]); |
269 | 269 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | public function el($name, $option = []) |
14 | 14 | { |
15 | - $className = get_called_class() . '\\' . $name; |
|
15 | + $className = get_called_class().'\\'.$name; |
|
16 | 16 | if (class_exists($className)) { |
17 | 17 | return new $className(); |
18 | 18 | } |
@@ -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 { |
@@ -23,7 +23,7 @@ |
||
23 | 23 | { |
24 | 24 | $user = Users\User::get($userId); |
25 | 25 | App::$cur->users->newSession($user); |
26 | - Tools::redirect('/', 'Теперь вы на сайте под пользователем ' . $user->name()); |
|
26 | + Tools::redirect('/', 'Теперь вы на сайте под пользователем '.$user->name()); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return function ($step = NULL, $params = []) { |
|
3 | +return function($step = NULL, $params = []) { |
|
4 | 4 | |
5 | 5 | $groups = [ |
6 | 6 | [ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } else { |
46 | 46 | $user = new Users\User(array( |
47 | 47 | 'user_login' => 'admin', |
48 | - 'user_mail' => 'admin@' . idn_to_utf8(INJI_DOMAIN_NAME), |
|
48 | + 'user_mail' => 'admin@'.idn_to_utf8(INJI_DOMAIN_NAME), |
|
49 | 49 | 'user_pass' => password_hash('admin', PASSWORD_DEFAULT), |
50 | 50 | 'user_group_id' => $groupObject->id, |
51 | 51 | 'user_role_id' => $roleObject->id, |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | if (!$social) { |
21 | 21 | Tools::redirect('/', 'Такой соц. сети не найдено'); |
22 | 22 | } |
23 | - $helper = 'Users\SocialHelper\\' . $social->object_name; |
|
23 | + $helper = 'Users\SocialHelper\\'.$social->object_name; |
|
24 | 24 | $helper::auth(); |
25 | 25 | } |
26 | 26 | |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | foreach (\Users\User::$cur->socials as $userSocial) { |
37 | 37 | if ($userSocial->social_id == $social->id) { |
38 | 38 | $userSocial->delete(); |
39 | - Tools::redirect('/', 'Связь с соц. сетью ' . $social->name . ' была удалена'); |
|
39 | + Tools::redirect('/', 'Связь с соц. сетью '.$social->name.' была удалена'); |
|
40 | 40 | } |
41 | 41 | } |
42 | - Tools::redirect('/', 'Связь с соц. сетью ' . $social->name . ' не найдена'); |
|
42 | + Tools::redirect('/', 'Связь с соц. сетью '.$social->name.' не найдена'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | if (!empty($_POST['partnerInvite']['email'])) { |
3 | 3 | $title = ''; |
4 | 4 | if (!empty($_POST['partnerInvite']['name'])) { |
5 | - $title .='Ув. ' . htmlspecialchars($_POST['partnerInvite']['name']) . '. '; |
|
5 | + $title .= 'Ув. '.htmlspecialchars($_POST['partnerInvite']['name']).'. '; |
|
6 | 6 | } |
7 | 7 | if (!filter_var($_POST['partnerInvite']['email'], FILTER_VALIDATE_EMAIL)) { |
8 | 8 | Tools::redirect(null, 'Вы ввели не корректный E-mail', 'danger'); |
9 | 9 | } |
10 | - $title = \Users\User::$cur->name() . ' приглашает вас зарегистрироваться на сайте: ' . idn_to_utf8(INJI_DOMAIN_NAME); |
|
10 | + $title = \Users\User::$cur->name().' приглашает вас зарегистрироваться на сайте: '.idn_to_utf8(INJI_DOMAIN_NAME); |
|
11 | 11 | $inviteCode = Tools::randomString(60); |
12 | 12 | $invite = new Users\User\Invite(); |
13 | 13 | $invite->code = $inviteCode; |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | $invite->limit = 1; |
17 | 17 | $invite->save(); |
18 | 18 | $text = "<h3>{$title}</h3>"; |
19 | - $text .= '<p>Чтобы принять приглашение, перейдите по <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/users/registration?invite_code=' . $inviteCode . '">этой ссылке</a> и завершите процедуру регистрации</p>'; |
|
20 | - Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, $_POST['partnerInvite']['email'], $title, $text); |
|
19 | + $text .= '<p>Чтобы принять приглашение, перейдите по <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/users/registration?invite_code='.$inviteCode.'">этой ссылке</a> и завершите процедуру регистрации</p>'; |
|
20 | + Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, $_POST['partnerInvite']['email'], $title, $text); |
|
21 | 21 | Tools::redirect(null, 'Приглашение было отправлено', 'success'); |
22 | 22 | } |
23 | 23 | $partners = App::$cur->users->getUserPartners(Users\User::$cur, 8); |
@@ -22,20 +22,20 @@ discard block |
||
22 | 22 | 'scope' => 'email', |
23 | 23 | 'response_type' => 'code', |
24 | 24 | 'display' => 'page', |
25 | - 'redirect_uri' => 'http://' . INJI_DOMAIN_NAME . '/users/social/auth/vk' |
|
25 | + 'redirect_uri' => 'http://'.INJI_DOMAIN_NAME.'/users/social/auth/vk' |
|
26 | 26 | ]; |
27 | - \Tools::redirect("https://oauth.vk.com/authorize?" . http_build_query($query)); |
|
27 | + \Tools::redirect("https://oauth.vk.com/authorize?".http_build_query($query)); |
|
28 | 28 | } |
29 | 29 | if (empty($_GET['code']) && !empty($_GET['error'])) { |
30 | - \Tools::redirect('/', 'Произошла ошибка во время авторизации через соц. сеть: ' . $_GET['error_description']); |
|
30 | + \Tools::redirect('/', 'Произошла ошибка во время авторизации через соц. сеть: '.$_GET['error_description']); |
|
31 | 31 | } |
32 | 32 | $query = [ |
33 | 33 | 'client_id' => $config['appId'], |
34 | 34 | 'client_secret' => $config['secret'], |
35 | 35 | 'code' => $_GET['code'], |
36 | - 'redirect_uri' => 'http://' . INJI_DOMAIN_NAME . '/users/social/auth/vk' |
|
36 | + 'redirect_uri' => 'http://'.INJI_DOMAIN_NAME.'/users/social/auth/vk' |
|
37 | 37 | ]; |
38 | - $result = @file_get_contents("https://oauth.vk.com/access_token?" . http_build_query($query)); |
|
38 | + $result = @file_get_contents("https://oauth.vk.com/access_token?".http_build_query($query)); |
|
39 | 39 | if ($result === false) { |
40 | 40 | \Tools::redirect('/', 'Во время авторизации произошли ошибки', 'danger'); |
41 | 41 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | 'fields' => 'sex, bdate, photo_max_orig, home_town', |
49 | 49 | 'access_token' => $result['access_token'] |
50 | 50 | ]; |
51 | - $userResult = @file_get_contents("https://api.vk.com/method/users.get?" . http_build_query($userQuery)); |
|
51 | + $userResult = @file_get_contents("https://api.vk.com/method/users.get?".http_build_query($userQuery)); |
|
52 | 52 | if (!$userResult) { |
53 | 53 | \Tools::redirect('/', 'Во время авторизации произошли ошибки', 'danger'); |
54 | 54 | } |
@@ -22,19 +22,19 @@ discard block |
||
22 | 22 | 'client_id' => $config['client_id'], |
23 | 23 | 'scope' => 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile', |
24 | 24 | 'response_type' => 'code', |
25 | - 'redirect_uri' => 'http://' . INJI_DOMAIN_NAME . '/users/social/auth/google' |
|
25 | + 'redirect_uri' => 'http://'.INJI_DOMAIN_NAME.'/users/social/auth/google' |
|
26 | 26 | ]; |
27 | - \Tools::redirect("https://accounts.google.com/o/oauth2/auth?" . http_build_query($query)); |
|
27 | + \Tools::redirect("https://accounts.google.com/o/oauth2/auth?".http_build_query($query)); |
|
28 | 28 | } |
29 | 29 | if (empty($_GET['code']) && !empty($_GET['error'])) { |
30 | - \Tools::redirect('/', 'Произошла ошибка во время авторизации через соц. сеть: ' . $_GET['error_description']); |
|
30 | + \Tools::redirect('/', 'Произошла ошибка во время авторизации через соц. сеть: '.$_GET['error_description']); |
|
31 | 31 | } |
32 | 32 | $query = [ |
33 | 33 | 'client_id' => $config['client_id'], |
34 | 34 | 'client_secret' => $config['secret'], |
35 | 35 | 'code' => $_GET['code'], |
36 | 36 | 'grant_type' => 'authorization_code', |
37 | - 'redirect_uri' => 'http://' . INJI_DOMAIN_NAME . '/users/social/auth/google' |
|
37 | + 'redirect_uri' => 'http://'.INJI_DOMAIN_NAME.'/users/social/auth/google' |
|
38 | 38 | ]; |
39 | 39 | $result = false; |
40 | 40 | if ($curl = curl_init()) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $userQuery = [ |
56 | 56 | 'access_token' => $result['access_token'] |
57 | 57 | ]; |
58 | - $userResult = @file_get_contents("https://www.googleapis.com/oauth2/v1/userinfo?" . http_build_query($userQuery)); |
|
58 | + $userResult = @file_get_contents("https://www.googleapis.com/oauth2/v1/userinfo?".http_build_query($userQuery)); |
|
59 | 59 | if (!$userResult) { |
60 | 60 | \Tools::redirect('/', 'Во время авторизации произошли ошибки', 'danger'); |
61 | 61 | } |