@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | App::$Session->set('content.rate.ignore', $ignored); |
65 | 65 | |
66 | 66 | // save rating changes to database |
67 | - switch($this->_type) { |
|
67 | + switch ($this->_type) { |
|
68 | 68 | case 'plus': |
69 | 69 | $this->_content->rating += 1; |
70 | 70 | break; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $this->_content->save(); |
77 | 77 | |
78 | 78 | // update content author rating |
79 | - $authorId = (int)$this->_content->author_id; |
|
79 | + $authorId = (int) $this->_content->author_id; |
|
80 | 80 | if ($authorId > 0 && App::$User->isExist($authorId)) { |
81 | 81 | $authorObject = App::$User->identity($authorId); |
82 | 82 | if ($authorObject !== null) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $this->setJsonHeader(); |
33 | 33 | $configs = AppRecord::getConfigs('widget', 'Comments'); |
34 | 34 | |
35 | - $replayTo = (int)App::$Request->request->get('replay-to'); |
|
35 | + $replayTo = (int) App::$Request->request->get('replay-to'); |
|
36 | 36 | $model = null; |
37 | 37 | // check if its a answer (comment answer type) |
38 | 38 | if ($replayTo > 0) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | // pass general comment params to model |
47 | - $model->message = App::$Security->secureHtml((string)App::$Request->request->get('message')); |
|
47 | + $model->message = App::$Security->secureHtml((string) App::$Request->request->get('message')); |
|
48 | 48 | $model->guestName = App::$Security->strip_tags(App::$Request->request->get('guest-name')); |
49 | 49 | |
50 | 50 | // check model conditions before add new row |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | // get configs |
77 | 77 | $configs = AppRecord::getConfigs('widget', 'Comments'); |
78 | 78 | // items per page |
79 | - $perPage = (int)$configs['perPage']; |
|
79 | + $perPage = (int) $configs['perPage']; |
|
80 | 80 | // offset can be only integer |
81 | - $index = (int)$index; |
|
81 | + $index = (int) $index; |
|
82 | 82 | $offset = $perPage * $index; |
83 | 83 | // get comment target path and check |
84 | - $path = (string)App::$Request->query->get('path'); |
|
84 | + $path = (string) App::$Request->query->get('path'); |
|
85 | 85 | if (Str::likeEmpty($path)) { |
86 | 86 | throw new NotFoundException('Wrong path'); |
87 | 87 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $query = CommentPost::where('pathway', '=', $path); |
91 | 91 | |
92 | 92 | // check if comments is depend of language locale |
93 | - if ((int)$configs['onlyLocale'] === 1) { |
|
93 | + if ((int) $configs['onlyLocale'] === 1) { |
|
94 | 94 | $query = $query->where('lang', '=', App::$Request->getLanguage()); |
95 | 95 | } |
96 | 96 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | $this->setJsonHeader(); |
142 | 142 | // check input data |
143 | - if (!Obj::isLikeInt($commentId) || (int)$commentId < 1) { |
|
143 | + if (!Obj::isLikeInt($commentId) || (int) $commentId < 1) { |
|
144 | 144 | throw new ForbiddenException('Input data is incorrect'); |
145 | 145 | } |
146 | 146 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // get data from db by comment id |
151 | 151 | $records = CommentAnswer::where('comment_id', '=', $commentId); |
152 | - if ((int)$configs['onlyLocale'] === 1) { |
|
152 | + if ((int) $configs['onlyLocale'] === 1) { |
|
153 | 153 | $records = $records->where('lang', '=', App::$Request->getLanguage()); |
154 | 154 | } |
155 | 155 | |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | foreach ($path as $id => $uri) { |
194 | 194 | $query = CommentPost::where('pathway', '=', $uri); |
195 | 195 | // check if comments is depend of language locale |
196 | - if ((int)$configs['onlyLocale'] === 1) { |
|
196 | + if ((int) $configs['onlyLocale'] === 1) { |
|
197 | 197 | $query = $query->where('lang', '=', App::$Request->getLanguage()); |
198 | 198 | } |
199 | 199 | // set itemId => count |
200 | - $count[(int)$id] = $query->count(); |
|
200 | + $count[(int) $id] = $query->count(); |
|
201 | 201 | } |
202 | 202 | // render json response |
203 | 203 | return json_encode(['status' => 1, 'count' => $count]); |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | public function before() |
31 | 31 | { |
32 | 32 | $this->categories = Serialize::decode($this->_configs['categories']); |
33 | - $this->count = (int)$this->_configs['count']; |
|
34 | - $this->cache = (int)$this->_configs['cache']; |
|
33 | + $this->count = (int) $this->_configs['count']; |
|
34 | + $this->cache = (int) $this->_configs['cache']; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | public function getResult() |
65 | 65 | { |
66 | 66 | return [ |
67 | - 'count' => (int)$this->count, |
|
68 | - 'cache' => (int)$this->cache, |
|
67 | + 'count' => (int) $this->count, |
|
68 | + 'cache' => (int) $this->cache, |
|
69 | 69 | 'categories' => Serialize::encode($this->categories) |
70 | 70 | ]; |
71 | 71 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | ]); |
47 | 47 | |
48 | 48 | $configs->newcontent = serialize([ |
49 | - 'categories' => serialize(['2','3']), |
|
49 | + 'categories' => serialize(['2', '3']), |
|
50 | 50 | 'count' => '5', |
51 | 51 | 'cache' => '60' |
52 | 52 | ]); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | date_default_timezone_set('Europe/Moscow'); |
12 | 12 | |
13 | 13 | return [ |
14 | - 'Database' => function () { |
|
14 | + 'Database' => function() { |
|
15 | 15 | $capsule = new Capsule; |
16 | 16 | if (env_name !== 'Install') { |
17 | 17 | try { |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | try { |
35 | 35 | $pdo = \App::$Database->connection()->getPdo(); |
36 | 36 | $handler = new PdoSessionHandler($pdo, [ |
37 | - 'db_table' => App::$Properties->get('database')['prefix'] . 'sessions' |
|
37 | + 'db_table' => App::$Properties->get('database')['prefix'].'sessions' |
|
38 | 38 | ]); |
39 | 39 | } catch (Exception $e) { |
40 | - $handler = new NativeFileSessionHandler(root . '/Private/Sessions'); |
|
40 | + $handler = new NativeFileSessionHandler(root.'/Private/Sessions'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $storage = new NativeSessionStorage([ |
@@ -48,18 +48,18 @@ discard block |
||
48 | 48 | |
49 | 49 | return new Session($storage); |
50 | 50 | }, |
51 | - 'User' => function () { |
|
51 | + 'User' => function() { |
|
52 | 52 | return new Apps\ActiveRecord\User(); |
53 | 53 | }, |
54 | - 'Mailer' => function () { |
|
54 | + 'Mailer' => function() { |
|
55 | 55 | $swiftTransport = Swift_MailTransport::newInstance(); |
56 | 56 | return Swift_Mailer::newInstance($swiftTransport); |
57 | 57 | }, |
58 | - 'Captcha' => function () { |
|
58 | + 'Captcha' => function() { |
|
59 | 59 | return new Extend\Core\Captcha\Gregwar(); |
60 | 60 | }, |
61 | - 'Cache' => function () { |
|
62 | - phpFastCache::setup('path', root . '/Private/Cache'); |
|
61 | + 'Cache' => function() { |
|
62 | + phpFastCache::setup('path', root.'/Private/Cache'); |
|
63 | 63 | return \phpFastCache(); |
64 | 64 | } |
65 | 65 | ]; |
66 | 66 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | <?php |
26 | 26 | $items = []; |
27 | -foreach($records as $role) { |
|
27 | +foreach ($records as $role) { |
|
28 | 28 | $permissions = explode(';', $role->permissions); |
29 | 29 | $permissionsLabel = null; |
30 | 30 | foreach ($permissions as $perm) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } else { |
37 | 37 | $labelMark = 'label-default'; |
38 | 38 | } |
39 | - $permissionsLabel .= '<span class="label ' . $labelMark . '">' . $perm . '</span> '; |
|
39 | + $permissionsLabel .= '<span class="label '.$labelMark.'">'.$perm.'</span> '; |
|
40 | 40 | } |
41 | 41 | $items[] = [ |
42 | 42 | ['text' => $role->id], |
@@ -25,12 +25,12 @@ |
||
25 | 25 | $items = []; |
26 | 26 | foreach ($records as $user) { |
27 | 27 | $items[] = [ |
28 | - ['text' => $user->id . ($user->approve_token != '0' ? ' <strong class="text-danger">*</strong>' : null), 'html' => true], |
|
28 | + ['text' => $user->id.($user->approve_token != '0' ? ' <strong class="text-danger">*</strong>' : null), 'html' => true], |
|
29 | 29 | ['text' => $user->email], |
30 | 30 | ['text' => $user->login], |
31 | 31 | ['text' => $user->getRole()->name], |
32 | 32 | ['text' => Date::convertToDatetime($user->created_at, Date::FORMAT_TO_DAY)], |
33 | - ['text' => Url::link(['user/update', $user->id], '<i class="fa fa-pencil fa-lg"></i>') . |
|
33 | + ['text' => Url::link(['user/update', $user->id], '<i class="fa fa-pencil fa-lg"></i>'). |
|
34 | 34 | Url::link(['user/delete', $user->id], ' <i class="fa fa-trash-o fa-lg"></i>'), |
35 | 35 | 'html' => true, 'property' => ['class' => 'text-center']] |
36 | 36 | ]; |
@@ -2,6 +2,6 @@ |
||
2 | 2 | use Ffcms\Core\Helper\Url; |
3 | 3 | |
4 | 4 | if (isset($controller)): ?> |
5 | -<a href="<?= Url::to($controller . '/index') ?>"><i class="fa fa-cogs"></i></a> |
|
5 | +<a href="<?= Url::to($controller.'/index') ?>"><i class="fa fa-cogs"></i></a> |
|
6 | 6 | <a href="<?= Url::to('widget/turn', $controller) ?>"><i class="fa fa-power-off"></i></a> |
7 | 7 | <?php endif; ?> |
8 | 8 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | <?php |
23 | 23 | $customCssCode = \App::$View->showPlainCode('css'); |
24 | 24 | if ($customCssCode !== null) { |
25 | - echo '<style>' . $customCssCode . '</style>'; |
|
25 | + echo '<style>'.$customCssCode.'</style>'; |
|
26 | 26 | } ?> |
27 | 27 | <script> |
28 | 28 | window.jQ = []; |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | 'type' => 'ul', |
131 | 131 | 'property' => ['class' => 'nav nav-second-level'], |
132 | 132 | 'items' => [ |
133 | - ['type' => 'link', 'link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> ' . __('Settings'), 'html' => true], |
|
134 | - ['type' => 'link', 'link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> ' . __('Files'), 'html' => true], |
|
135 | - ['type' => 'link', 'link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> ' . __('Antivirus'), 'html' => true], |
|
136 | - ['type' => 'link', 'link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> ' . __('Routing'), 'html' => true], |
|
137 | - ['type' => 'link', 'link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> ' . __('Updates'), 'html' => true] |
|
133 | + ['type' => 'link', 'link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> '.__('Settings'), 'html' => true], |
|
134 | + ['type' => 'link', 'link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> '.__('Files'), 'html' => true], |
|
135 | + ['type' => 'link', 'link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> '.__('Antivirus'), 'html' => true], |
|
136 | + ['type' => 'link', 'link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> '.__('Routing'), 'html' => true], |
|
137 | + ['type' => 'link', 'link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> '.__('Updates'), 'html' => true] |
|
138 | 138 | ] |
139 | 139 | ]) ?> |
140 | 140 | <!-- /.nav-second-level --> |
@@ -154,22 +154,22 @@ discard block |
||
154 | 154 | foreach ($extTable as $item) { |
155 | 155 | $menuItem = [ |
156 | 156 | 'type' => 'link', |
157 | - 'link' => [Str::lowerCase($item->sys_name) . '/index'], |
|
158 | - 'text' => $item->getLocaleName() . (!$item->checkVersion() ? ' <i class="fa fa-wrench" style="color: #ffbd26;"></i>' : null), |
|
157 | + 'link' => [Str::lowerCase($item->sys_name).'/index'], |
|
158 | + 'text' => $item->getLocaleName().(!$item->checkVersion() ? ' <i class="fa fa-wrench" style="color: #ffbd26;"></i>' : null), |
|
159 | 159 | 'html' => true |
160 | 160 | ]; |
161 | 161 | if ($item->type === 'app') { |
162 | 162 | $appControllers[] = $item->sys_name; |
163 | 163 | $appMenuItems[] = $menuItem; |
164 | - } elseif($item->type === 'widget') { |
|
164 | + } elseif ($item->type === 'widget') { |
|
165 | 165 | $widgetControllers[] = $item->sys_name; |
166 | 166 | $widgetMenuItems[] = $menuItem; |
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
170 | - $appMenuItems[] = ['type' => 'link', 'link' => ['application/index'], 'text' => __('All apps') . '...']; |
|
170 | + $appMenuItems[] = ['type' => 'link', 'link' => ['application/index'], 'text' => __('All apps').'...']; |
|
171 | 171 | $appControllers[] = 'Application'; |
172 | - $widgetMenuItems[] = ['type' => 'link', 'link' => ['widget/index'], 'text' => __('All widgets') . '...']; |
|
172 | + $widgetMenuItems[] = ['type' => 'link', 'link' => ['widget/index'], 'text' => __('All widgets').'...']; |
|
173 | 173 | $widgetControllers[] = 'Widget'; |
174 | 174 | ?> |
175 | 175 | <li<?= Arr::in(\App::$Request->getController(), $appControllers) ? ' class="active"' : null ?>> |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | echo $body; |
231 | 231 | } else { |
232 | 232 | \App::$Response->setStatusCode(404); |
233 | - echo '<p>' . __('Page is not founded!') . '</p>'; |
|
233 | + echo '<p>'.__('Page is not founded!').'</p>'; |
|
234 | 234 | } |
235 | 235 | ?> |
236 | 236 | </article> |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | <?php |
262 | 262 | $customJsCode = \App::$View->showPlainCode('js'); |
263 | 263 | if ($customJsCode !== null) { |
264 | - echo '<script>' . $customJsCode . '</script>'; |
|
264 | + echo '<script>'.$customJsCode.'</script>'; |
|
265 | 265 | } |
266 | 266 | ?> |
267 | 267 | </body> |