@@ -33,17 +33,17 @@ discard block |
||
33 | 33 | { |
34 | 34 | $cfg = $this->getConfigs(); |
35 | 35 | // check cache is defined |
36 | - if (!$this->cache|| !Any::isInt($this->cache)) { |
|
37 | - $this->cache = (int)$cfg['cache']; |
|
36 | + if (!$this->cache || !Any::isInt($this->cache)) { |
|
37 | + $this->cache = (int) $cfg['cache']; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | // check tag count is defined |
41 | 41 | if (!$this->count || !Any::isInt($this->count)) { |
42 | - $this->count = (int)$cfg['count']; |
|
42 | + $this->count = (int) $cfg['count']; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $this->_lang = App::$Request->getLanguage(); |
46 | - $this->_cacheName = 'widget.contenttag.' . $this->createStringClassSnapshotHash(); |
|
46 | + $this->_cacheName = 'widget.contenttag.'.$this->createStringClassSnapshotHash(); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } else { |
61 | 61 | $cache = App::$Cache->getItem($this->_cacheName); |
62 | 62 | if (!$cache->isHit()) { |
63 | - $cache->set($this->makeQuery())->expiresAfter((int)$this->cache); |
|
63 | + $cache->set($this->makeQuery())->expiresAfter((int) $this->cache); |
|
64 | 64 | App::$Cache->save($cache); |
65 | 65 | } |
66 | 66 | $records = $cache->get(); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | $user = App::$User->identity(); |
93 | 93 | // user is not authed ? |
94 | 94 | if (!$user || !App::$User->isAuth()) { |
95 | - $redirectUrl = App::$Alias->scriptUrl . '/user/login'; |
|
95 | + $redirectUrl = App::$Alias->scriptUrl.'/user/login'; |
|
96 | 96 | App::$Response->redirect($redirectUrl, true); |
97 | 97 | exit(); |
98 | 98 | } |
99 | 99 | |
100 | - $permission = env_name . '/' . App::$Request->getController() . '/' . App::$Request->getAction(); |
|
100 | + $permission = env_name.'/'.App::$Request->getController().'/'.App::$Request->getAction(); |
|
101 | 101 | // doesn't have permission? get the f*ck out |
102 | 102 | if (!$user->role->can($permission)) { |
103 | 103 | throw new ForbiddenException(__('You got no access rights to this page')); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function getConfigs(): ?array |
149 | 149 | { |
150 | - $configs = $this->type === 'widget' ? (array)$this->widget->configs : (array)$this->application->configs; |
|
150 | + $configs = $this->type === 'widget' ? (array) $this->widget->configs : (array) $this->application->configs; |
|
151 | 151 | foreach ($configs as $cfg => $value) { |
152 | 152 | if (Any::isInt($value)) { |
153 | 153 | $configs[$cfg] = $value; |
@@ -25,9 +25,9 @@ |
||
25 | 25 | */ |
26 | 26 | public function deleteRoute(): ?string |
27 | 27 | { |
28 | - $type = (string)$this->request->query->get('type'); |
|
29 | - $loader = (string)$this->request->query->get('loader'); |
|
30 | - $source = Str::lowerCase((string)$this->request->query->get('path')); |
|
28 | + $type = (string) $this->request->query->get('type'); |
|
29 | + $loader = (string) $this->request->query->get('loader'); |
|
30 | + $source = Str::lowerCase((string) $this->request->query->get('path')); |
|
31 | 31 | |
32 | 32 | $model = new EntityDeleteRoute($type, $loader, $source); |
33 | 33 | if ($model->send() && $model->validate()) { |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function files(): ?string |
25 | 25 | { |
26 | 26 | return $this->view->render('main/files', [ |
27 | - 'connector' => App::$Alias->scriptUrl . '/api/main/files?lang=' . $this->request->getLanguage() |
|
27 | + 'connector' => App::$Alias->scriptUrl.'/api/main/files?lang='.$this->request->getLanguage() |
|
28 | 28 | ]); |
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $search = \Apps\ActiveRecord\App::getItem('widget', $controller); |
83 | 83 | |
84 | 84 | // check what we got |
85 | - if (!$search || (int)$search->id < 1) { |
|
85 | + if (!$search || (int) $search->id < 1) { |
|
86 | 86 | throw new NotFoundException('Widget is not founded'); |
87 | 87 | } |
88 | 88 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | ->first(); |
118 | 118 | |
119 | 119 | // check if widget admin controller exists |
120 | - if (!$record || (int)$record->id < 1) { |
|
120 | + if (!$record || (int) $record->id < 1) { |
|
121 | 121 | throw new ForbiddenException('Widget is not founded'); |
122 | 122 | } |
123 | 123 |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $search = \Apps\ActiveRecord\App::getItem('app', $controller); |
85 | 85 | |
86 | 86 | // check what we got |
87 | - if (!$search || (int)$search->id < 1) { |
|
87 | + if (!$search || (int) $search->id < 1) { |
|
88 | 88 | throw new NotFoundException('App is not founded'); |
89 | 89 | } |
90 | 90 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $search = \Apps\ActiveRecord\App::where('sys_name', $controllerName) |
117 | 117 | ->where('type', 'app') |
118 | 118 | ->first(); |
119 | - if (!$search || (int)$search->id < 1) { |
|
119 | + if (!$search || (int) $search->id < 1) { |
|
120 | 120 | throw new ForbiddenException('App is not founded'); |
121 | 121 | } |
122 | 122 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | <h1><?= __('Feedback list') ?></h1> |
26 | 26 | <?php |
27 | 27 | if (!$records || $records->count() < 1) { |
28 | - echo '<p class="alert alert-warning">' . __('Feedback requests is empty now!') . '</p>'; |
|
28 | + echo '<p class="alert alert-warning">'.__('Feedback requests is empty now!').'</p>'; |
|
29 | 29 | $this->stop(); |
30 | 30 | return; |
31 | 31 | } |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | foreach ($records as $item) { |
46 | 46 | /** @var \Apps\ActiveRecord\FeedbackPost $item*/ |
47 | 47 | $table->row([ |
48 | - ['text' => $item->id . (!$item->readed ? ' <i class="fa fa-bell alert-info"></i>' : null) . ($item->closed ? ' <i class="fa fa-eye-slash alert-danger"></i>' : null), 'html' => true], |
|
48 | + ['text' => $item->id.(!$item->readed ? ' <i class="fa fa-bell alert-info"></i>' : null).($item->closed ? ' <i class="fa fa-eye-slash alert-danger"></i>' : null), 'html' => true], |
|
49 | 49 | ['text' => Url::a(['feedback/read', [$item->id]], Text::snippet($item->message, 40)), 'html' => true], |
50 | - ['text' => '<span class="badge badge-light">' . $item->answers->count() . '</span>', 'html' => true], |
|
50 | + ['text' => '<span class="badge badge-light">'.$item->answers->count().'</span>', 'html' => true], |
|
51 | 51 | ['text' => $item->email], |
52 | - ['text' => (bool)$item->closed ? '<span class="badge badge-danger">' . __('Closed') . '</span>' : '<span class="label label-success">' . __('Opened') . '</span>', 'html' => true, '!secure' => true], |
|
52 | + ['text' => (bool) $item->closed ? '<span class="badge badge-danger">'.__('Closed').'</span>' : '<span class="label label-success">'.__('Opened').'</span>', 'html' => true, '!secure' => true], |
|
53 | 53 | ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)], |
54 | 54 | ['text' => $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm', 'role' => 'group']) |
55 | 55 | ->add('<i class="fa fa-feed"></i>', ['feedback/read', [$item->id]], ['class' => 'btn btn-light', 'html' => true]) |
@@ -37,7 +37,7 @@ |
||
37 | 37 | <div class="text-right"><strong><?= __('Profile preview') ?></strong></div> |
38 | 38 | </div> |
39 | 39 | <div class="col-md-9"> |
40 | - <a href="<?= \App::$Alias->scriptUrl . '/profile/show/' . $model->_user->id ?>" target="_blank"><?= __('View profile on website') ?></a> |
|
40 | + <a href="<?= \App::$Alias->scriptUrl.'/profile/show/'.$model->_user->id ?>" target="_blank"><?= __('View profile on website') ?></a> |
|
41 | 41 | </div> |
42 | 42 | </div> |
43 | 43 | <div class="row mt-3 mb-3"> |
@@ -134,7 +134,8 @@ discard block |
||
134 | 134 | <span class="text-sm">No feedback queries found</span> |
135 | 135 | </div> |
136 | 136 | </div> |
137 | - <?php else: ?> |
|
137 | + <?php else { |
|
138 | + : ?> |
|
138 | 139 | <?php foreach ($features->getFeedback() as $feed): ?> |
139 | 140 | <div class="media"> |
140 | 141 | <div class="media-left"> |
@@ -145,7 +146,9 @@ discard block |
||
145 | 146 | <span class="text-sm"><?= Text::snippet($feed->message, 100) ?></span> |
146 | 147 | </div> |
147 | 148 | </div> |
148 | - <?php endforeach; ?> |
|
149 | + <?php endforeach; |
|
150 | +} |
|
151 | +?> |
|
149 | 152 | <?php endif; ?> |
150 | 153 | </div> |
151 | 154 | |
@@ -167,7 +170,8 @@ discard block |
||
167 | 170 | <span class="text-sm">No comments found</span> |
168 | 171 | </div> |
169 | 172 | </div> |
170 | - <?php else: ?> |
|
173 | + <?php else { |
|
174 | + : ?> |
|
171 | 175 | <?php foreach ($features->getComments() as $comment): ?> |
172 | 176 | <?php /** @var \Apps\ActiveRecord\CommentPost $comment */ ?> |
173 | 177 | <div class="media"> |
@@ -175,6 +179,7 @@ discard block |
||
175 | 179 | <a href="<?= ($comment->user ? Url::link(['user/update', [$comment->user->id]]) : '#') ?>"> |
176 | 180 | <?php |
177 | 181 | $commentAva = \App::$Alias->scriptUrl . '/upload/user/avatar/small/default.jpg'; |
182 | +} |
|
178 | 183 | if ($comment->user && $comment->user->id > 0) { |
179 | 184 | $commentAva = $comment->user->profile->getAvatarUrl('small'); |
180 | 185 | } |
@@ -220,9 +225,12 @@ discard block |
||
220 | 225 | <?php foreach ($breadcrumbs as $url => $text): ?> |
221 | 226 | <?php if (\Ffcms\Core\Helper\Type\Any::isInt($url)): ?> |
222 | 227 | <?= $text ?> |
223 | - <?php else: ?> |
|
228 | + <?php else { |
|
229 | + : ?> |
|
224 | 230 | <a href="<?= $url ?>"><?= $text ?></a> / |
225 | - <?php endif; ?> |
|
231 | + <?php endif; |
|
232 | +} |
|
233 | +?> |
|
226 | 234 | <?php endforeach; ?> |
227 | 235 | <?php endif; ?> |
228 | 236 | </h2> |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | <div class="media-left"> |
179 | 179 | <a href="<?= ($comment->user ? Url::link(['user/update', [$comment->user->id]]) : '#') ?>"> |
180 | 180 | <?php |
181 | - $commentAva = \App::$Alias->scriptUrl . '/upload/user/avatar/small/default.jpg'; |
|
181 | + $commentAva = \App::$Alias->scriptUrl.'/upload/user/avatar/small/default.jpg'; |
|
182 | 182 | if ($comment->user && $comment->user->id > 0) { |
183 | 183 | $commentAva = $comment->user->profile->getAvatarUrl('small'); |
184 | 184 | } |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | $list = $this->listing('ul', ['class' => 'list-inline']); |
223 | 223 | foreach (\App::$Properties->get('languages') as $lang) { |
224 | 224 | $list->li([ |
225 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
226 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
225 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
226 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
227 | 227 | 'html' => true |
228 | 228 | ], ['class' => 'list-inline-item']); |
229 | 229 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | </li> |
267 | 267 | <li class="nav-item<?= (\App::$Request->getController() === 'Main' && \App::$Request->getAction() !== 'Index') ? ' active' : null ?>"> |
268 | 268 | <?= Url::a(['#system-dropdown'], |
269 | - '<i class="fa fa-fire"></i> <span class="nav-text">' . __('System') . '</span>', |
|
269 | + '<i class="fa fa-fire"></i> <span class="nav-text">'.__('System').'</span>', |
|
270 | 270 | [ |
271 | 271 | 'class' => 'nav-container', |
272 | 272 | 'data-toggle' => 'collapse', |
@@ -274,12 +274,12 @@ discard block |
||
274 | 274 | ]) |
275 | 275 | ?> |
276 | 276 | |
277 | - <?= $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse' . ((\App::$Request->getController() === 'Main' && \App::$Request->getAction() !== 'Index') ? 'in show' : null), 'id' => 'system-dropdown']) |
|
278 | - ->menu(['link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> ' . __('Settings'), 'html' => true]) |
|
279 | - ->menu(['link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> ' . __('Files'), 'html' => true]) |
|
280 | - ->menu(['link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> ' . __('Antivirus'), 'html' => true]) |
|
281 | - ->menu(['link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> ' . __('Routing'), 'html' => true]) |
|
282 | - ->menu(['link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> ' . __('Updates'), 'html' => true]) |
|
277 | + <?= $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse'.((\App::$Request->getController() === 'Main' && \App::$Request->getAction() !== 'Index') ? 'in show' : null), 'id' => 'system-dropdown']) |
|
278 | + ->menu(['link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> '.__('Settings'), 'html' => true]) |
|
279 | + ->menu(['link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> '.__('Files'), 'html' => true]) |
|
280 | + ->menu(['link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> '.__('Antivirus'), 'html' => true]) |
|
281 | + ->menu(['link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> '.__('Routing'), 'html' => true]) |
|
282 | + ->menu(['link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> '.__('Updates'), 'html' => true]) |
|
283 | 283 | ->display(); |
284 | 284 | ?> |
285 | 285 | </li> |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | ?> |
298 | 298 | <li class="nav-item<?= (array_key_exists(\App::$Request->getController(), $apps) || \App::$Request->getController() === 'Application') ? ' active' : null ?>"> |
299 | 299 | <?= Url::a(['#apps-dropdown'], |
300 | - '<i class="fa fa-plug"></i> <span class="nav-text">' . __('Applications') . '</span>', |
|
300 | + '<i class="fa fa-plug"></i> <span class="nav-text">'.__('Applications').'</span>', |
|
301 | 301 | [ |
302 | 302 | 'class' => 'nav-container', |
303 | 303 | 'data-toggle' => 'collapse', |
@@ -306,18 +306,18 @@ discard block |
||
306 | 306 | ?> |
307 | 307 | |
308 | 308 | <?php |
309 | - $appMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse' . ((array_key_exists(\App::$Request->getController(), $apps) || \App::$Request->getController() === 'Application') ? 'in show' : null), 'id' => 'apps-dropdown']); |
|
309 | + $appMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse'.((array_key_exists(\App::$Request->getController(), $apps) || \App::$Request->getController() === 'Application') ? 'in show' : null), 'id' => 'apps-dropdown']); |
|
310 | 310 | foreach ($apps as $app) { |
311 | 311 | /** @var \Apps\ActiveRecord\App $app */ |
312 | - $appMenu->menu(['link' => [Str::lowerCase($app->sys_name) . '/index'], 'text' => $app->getLocaleName()]); |
|
312 | + $appMenu->menu(['link' => [Str::lowerCase($app->sys_name).'/index'], 'text' => $app->getLocaleName()]); |
|
313 | 313 | } |
314 | - $appMenu->menu(['link' => 'application/index', 'text' => __('All apps') . '...']); |
|
314 | + $appMenu->menu(['link' => 'application/index', 'text' => __('All apps').'...']); |
|
315 | 315 | echo $appMenu->display(); |
316 | 316 | ?> |
317 | 317 | </li> |
318 | 318 | <li class="nav-item<?= (array_key_exists(\App::$Request->getController(), $widgets) || \App::$Request->getController() === 'Widget') ? ' active' : null ?>"> |
319 | 319 | <?= Url::a(['#widgets-dropdown'], |
320 | - '<i class="fa fa-puzzle-piece"></i> <span class="nav-text">' . __('Widgets') . '</span>', |
|
320 | + '<i class="fa fa-puzzle-piece"></i> <span class="nav-text">'.__('Widgets').'</span>', |
|
321 | 321 | [ |
322 | 322 | 'class' => 'nav-container', |
323 | 323 | 'data-toggle' => 'collapse', |
@@ -326,12 +326,12 @@ discard block |
||
326 | 326 | ?> |
327 | 327 | |
328 | 328 | <?php |
329 | - $widgetMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse' . ((array_key_exists(\App::$Request->getController(), $widgets) || \App::$Request->getController() === 'Widget') ? 'in show' : null), 'id' => 'widgets-dropdown']); |
|
329 | + $widgetMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse'.((array_key_exists(\App::$Request->getController(), $widgets) || \App::$Request->getController() === 'Widget') ? 'in show' : null), 'id' => 'widgets-dropdown']); |
|
330 | 330 | foreach ($widgets as $widget) { |
331 | 331 | /** @var \Apps\ActiveRecord\App $widget */ |
332 | - $widgetMenu->menu(['link' => [Str::lowerCase($widget->sys_name) . '/index'], 'text' => $widget->getLocaleName()]); |
|
332 | + $widgetMenu->menu(['link' => [Str::lowerCase($widget->sys_name).'/index'], 'text' => $widget->getLocaleName()]); |
|
333 | 333 | } |
334 | - $widgetMenu->menu(['link' => 'widget/index', 'text' => __('All widgets') . '...']); |
|
334 | + $widgetMenu->menu(['link' => 'widget/index', 'text' => __('All widgets').'...']); |
|
335 | 335 | echo $widgetMenu->display(); |
336 | 336 | ?> |
337 | 337 | </li> |