@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | public function check() |
50 | 50 | { |
51 | 51 | // check if user is auth'd or guest name is defined |
52 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
52 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
53 | 53 | throw new JsonException(__('Guest name is not defined')); |
54 | 54 | } |
55 | 55 | |
56 | 56 | // guest moderation |
57 | - if (!App::$User->isAuth() && (bool)$this->_configs['guestModerate']) { |
|
57 | + if (!App::$User->isAuth() && (bool) $this->_configs['guestModerate']) { |
|
58 | 58 | $captcha = App::$Request->request->get('captcha'); |
59 | 59 | if (!App::$Captcha->validate($captcha)) { |
60 | 60 | throw new JsonException(__('Captcha is incorrect! Click on image to refresh and try again')); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | // check if message length is correct |
70 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
70 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
71 | 71 | throw new JsonException(__('Message length is incorrect. Current: %cur%, min - %min%, max - %max%', [ |
72 | 72 | 'cur' => Str::length($this->message), |
73 | 73 | 'min' => $this->_configs['minLength'], |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | $record->lang = App::$Request->getLanguage(); |
113 | 113 | $record->ip = $this->ip; |
114 | 114 | // check if premoderation is enabled and user is guest |
115 | - if ((bool)$this->_configs['guestModerate'] && $this->_userId < 1) { |
|
115 | + if ((bool) $this->_configs['guestModerate'] && $this->_userId < 1) { |
|
116 | 116 | $record->moderate = 1; |
117 | 117 | } |
118 | 118 | $record->save(); |
119 | 119 | |
120 | 120 | // add notification for comment post owner |
121 | 121 | $commentPost = $record->getCommentPost(); |
122 | - if ($commentPost !== null && (int)$commentPost->user_id !== 0 && (int)$commentPost->user_id !== $this->_userId) { |
|
123 | - $notify = new EntityAddNotification((int)$commentPost->user_id); |
|
122 | + if ($commentPost !== null && (int) $commentPost->user_id !== 0 && (int) $commentPost->user_id !== $this->_userId) { |
|
123 | + $notify = new EntityAddNotification((int) $commentPost->user_id); |
|
124 | 124 | $notify->add($commentPost->pathway, EntityAddNotification::MSG_ADD_COMMENTANSWER, [ |
125 | 125 | 'snippet' => Text::snippet(App::$Security->strip_tags($this->message), 50), |
126 | 126 | 'post' => Text::snippet(App::$Security->strip_tags($commentPost->message), 50) |
@@ -62,7 +62,7 @@ |
||
62 | 62 | // add user notification |
63 | 63 | if ($target->id !== $viewer->id) { |
64 | 64 | $notify = new EntityAddNotification($target->id); |
65 | - $notify->add('profile/show/' . $target->id . '#wall-post-' . $record->id, EntityAddNotification::MSG_ADD_WALLPOST, ['snippet' => Text::snippet($this->message, 50)]); |
|
65 | + $notify->add('profile/show/'.$target->id.'#wall-post-'.$record->id, EntityAddNotification::MSG_ADD_WALLPOST, ['snippet' => Text::snippet($this->message, 50)]); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // cleanup message |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | $scan = File::listFiles(static::INDEX_PATH, ['.xml'], true); |
48 | 48 | if (Obj::isArray($scan)) { |
49 | 49 | foreach ($scan as $file) { |
50 | - if ($this->_lang !== null && !Str::contains('.' . $this->_lang, $file)) { |
|
50 | + if ($this->_lang !== null && !Str::contains('.'.$this->_lang, $file)) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | - $this->files[] = static::INDEX_PATH . '/' . $file; |
|
53 | + $this->files[] = static::INDEX_PATH.'/'.$file; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // build file information data |
68 | 68 | foreach ($this->files as $file) { |
69 | 69 | $this->info[] = [ |
70 | - 'loc' => App::$Alias->scriptUrl . $file, |
|
70 | + 'loc' => App::$Alias->scriptUrl.$file, |
|
71 | 71 | 'lastmod' => Date::convertToDatetime(File::mTime($file), 'c') |
72 | 72 | ]; |
73 | 73 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $this->items[] = [ |
59 | 59 | 'text' => $text, |
60 | 60 | 'date' => Date::humanize($record->created_at), |
61 | - 'new' => (bool)$record->readed === false |
|
61 | + 'new' => (bool) $record->readed === false |
|
62 | 62 | ]; |
63 | 63 | } |
64 | 64 | } |
@@ -5,30 +5,30 @@ |
||
5 | 5 | } |
6 | 6 | |
7 | 7 | // require all tables |
8 | -require_once(root . '/Private/Database/Tables/App.php'); |
|
9 | -require_once(root . '/Private/Database/Tables/Blacklist.php'); |
|
10 | -require_once(root . '/Private/Database/Tables/CommentAnswer.php'); |
|
11 | -require_once(root . '/Private/Database/Tables/CommentPost.php'); |
|
12 | -require_once(root . '/Private/Database/Tables/Content.php'); |
|
13 | -require_once(root . '/Private/Database/Tables/ContentCategory.php'); |
|
14 | -require_once(root . '/Private/Database/Tables/ContentRating.php'); |
|
15 | -require_once(root . '/Private/Database/Tables/ContentTag.php'); |
|
16 | -require_once(root . '/Private/Database/Tables/FeedbackAnswer.php'); |
|
17 | -require_once(root . '/Private/Database/Tables/FeedbackPost.php'); |
|
18 | -require_once(root . '/Private/Database/Tables/Invite.php'); |
|
19 | -require_once(root . '/Private/Database/Tables/Message.php'); |
|
20 | -require_once(root . '/Private/Database/Tables/Profile.php'); |
|
21 | -require_once(root . '/Private/Database/Tables/ProfileField.php'); |
|
22 | -require_once(root . '/Private/Database/Tables/ProfileRating.php'); |
|
23 | -require_once(root . '/Private/Database/Tables/Role.php'); |
|
24 | -require_once(root . '/Private/Database/Tables/Session.php'); |
|
25 | -require_once(root . '/Private/Database/Tables/User.php'); |
|
26 | -require_once(root . '/Private/Database/Tables/UserLog.php'); |
|
27 | -require_once(root . '/Private/Database/Tables/UserNotification.php'); |
|
28 | -require_once(root . '/Private/Database/Tables/UserProvider.php'); |
|
29 | -require_once(root . '/Private/Database/Tables/UserRecovery.php'); |
|
30 | -require_once(root . '/Private/Database/Tables/WallPost.php'); |
|
31 | -require_once(root . '/Private/Database/Tables/WallAnswer.php'); |
|
8 | +require_once(root.'/Private/Database/Tables/App.php'); |
|
9 | +require_once(root.'/Private/Database/Tables/Blacklist.php'); |
|
10 | +require_once(root.'/Private/Database/Tables/CommentAnswer.php'); |
|
11 | +require_once(root.'/Private/Database/Tables/CommentPost.php'); |
|
12 | +require_once(root.'/Private/Database/Tables/Content.php'); |
|
13 | +require_once(root.'/Private/Database/Tables/ContentCategory.php'); |
|
14 | +require_once(root.'/Private/Database/Tables/ContentRating.php'); |
|
15 | +require_once(root.'/Private/Database/Tables/ContentTag.php'); |
|
16 | +require_once(root.'/Private/Database/Tables/FeedbackAnswer.php'); |
|
17 | +require_once(root.'/Private/Database/Tables/FeedbackPost.php'); |
|
18 | +require_once(root.'/Private/Database/Tables/Invite.php'); |
|
19 | +require_once(root.'/Private/Database/Tables/Message.php'); |
|
20 | +require_once(root.'/Private/Database/Tables/Profile.php'); |
|
21 | +require_once(root.'/Private/Database/Tables/ProfileField.php'); |
|
22 | +require_once(root.'/Private/Database/Tables/ProfileRating.php'); |
|
23 | +require_once(root.'/Private/Database/Tables/Role.php'); |
|
24 | +require_once(root.'/Private/Database/Tables/Session.php'); |
|
25 | +require_once(root.'/Private/Database/Tables/User.php'); |
|
26 | +require_once(root.'/Private/Database/Tables/UserLog.php'); |
|
27 | +require_once(root.'/Private/Database/Tables/UserNotification.php'); |
|
28 | +require_once(root.'/Private/Database/Tables/UserProvider.php'); |
|
29 | +require_once(root.'/Private/Database/Tables/UserRecovery.php'); |
|
30 | +require_once(root.'/Private/Database/Tables/WallPost.php'); |
|
31 | +require_once(root.'/Private/Database/Tables/WallAnswer.php'); |
|
32 | 32 | |
33 | 33 | // use default preset (for none or other presets) |
34 | -require_once (root . '/Private/Database/Other/PresetDefault.php'); |
|
35 | 34 | \ No newline at end of file |
35 | +require_once (root.'/Private/Database/Other/PresetDefault.php'); |
|
36 | 36 | \ No newline at end of file |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <?php |
24 | 24 | $customCssCode = \App::$View->showPlainCode('css'); |
25 | 25 | if ($customCssCode !== null) { |
26 | - echo '<style>' . $customCssCode . '</style>'; |
|
26 | + echo '<style>'.$customCssCode.'</style>'; |
|
27 | 27 | } ?> |
28 | 28 | <script> |
29 | 29 | window.jQ = []; |
@@ -40,32 +40,32 @@ discard block |
||
40 | 40 | if (\App::$User->isAuth()) { |
41 | 41 | $userId = \App::$User->identity()->getId(); |
42 | 42 | // show 'add content' button if current controller is Content and user add is enabled |
43 | - if (\App::$Request->getController() === 'Content' && (bool)AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
44 | - $items[] = ['type' => 'link', 'link' => ['content/update'], 'text' => '<i class="fa fa-plus"></i> ' . __('Add content'), 'html' => true, 'position' => 'right']; |
|
43 | + if (\App::$Request->getController() === 'Content' && (bool) AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
44 | + $items[] = ['type' => 'link', 'link' => ['content/update'], 'text' => '<i class="fa fa-plus"></i> '.__('Add content'), 'html' => true, 'position' => 'right']; |
|
45 | 45 | } |
46 | 46 | $accountDropdown[] = ['link' => ['profile/show', $userId], 'text' => __('My profile')]; |
47 | - $accountDropdown[] = ['link' => ['profile/messages'], 'text' => __('Messages') . ' <span class="badge" id="pm-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
48 | - $accountDropdown[] = ['link' => ['profile/notifications'], 'text' => __('Notifications') . ' <span class="badge" id="notify-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
49 | - if ((bool)AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
47 | + $accountDropdown[] = ['link' => ['profile/messages'], 'text' => __('Messages').' <span class="badge" id="pm-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
48 | + $accountDropdown[] = ['link' => ['profile/notifications'], 'text' => __('Notifications').' <span class="badge" id="notify-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
49 | + if ((bool) AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
50 | 50 | $accountDropdown[] = ['link' => ['content/my'], 'text' => __('My content')]; |
51 | 51 | } |
52 | 52 | $accountDropdown[] = ['link' => ['profile/settings'], 'text' => __('Settings')]; |
53 | 53 | |
54 | 54 | $items[] = [ |
55 | 55 | 'type' => 'dropdown', |
56 | - 'text' => '<i class="fa fa-user"></i> ' . __('Account') . ' <span class="badge" id="summary-count-block">0</span>', |
|
56 | + 'text' => '<i class="fa fa-user"></i> '.__('Account').' <span class="badge" id="summary-count-block">0</span>', |
|
57 | 57 | 'html' => true, |
58 | 58 | '!secure' => true, |
59 | 59 | 'position' => 'right', |
60 | 60 | 'items' => $accountDropdown |
61 | 61 | ]; |
62 | 62 | if (\App::$User->identity()->getRole()->can('Admin/Main/Index')) { |
63 | - $items[] = ['type' => 'link', 'link' => \App::$Alias->scriptUrl . '/admin/', 'text' => '<i class="fa fa-cogs"></i> Admin', 'position' => 'right', 'html' => true]; |
|
63 | + $items[] = ['type' => 'link', 'link' => \App::$Alias->scriptUrl.'/admin/', 'text' => '<i class="fa fa-cogs"></i> Admin', 'position' => 'right', 'html' => true]; |
|
64 | 64 | } |
65 | - $items[] = ['type' => 'link', 'link' => ['user/logout'], 'text' => '<i class="fa fa-user-times"></i> ' . __('Logout'), 'html' => true, 'position' => 'right']; |
|
65 | + $items[] = ['type' => 'link', 'link' => ['user/logout'], 'text' => '<i class="fa fa-user-times"></i> '.__('Logout'), 'html' => true, 'position' => 'right']; |
|
66 | 66 | } else { |
67 | - $items[] = ['type' => 'link', 'link' => ['user/login'], 'text' => '<i class="fa fa-sign-in"></i> ' . __('Sign in'), 'position' => 'right', 'html' => true]; |
|
68 | - $items[] = ['type' => 'link', 'link' => ['user/signup'], 'text' => '<i class="fa fa-check-square-o"></i> ' . __('Sign up'), 'position' => 'right', 'html' => true]; |
|
67 | + $items[] = ['type' => 'link', 'link' => ['user/login'], 'text' => '<i class="fa fa-sign-in"></i> '.__('Sign in'), 'position' => 'right', 'html' => true]; |
|
68 | + $items[] = ['type' => 'link', 'link' => ['user/signup'], 'text' => '<i class="fa fa-check-square-o"></i> '.__('Sign up'), 'position' => 'right', 'html' => true]; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | echo Navbar::display([ |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'container' => 'container', |
76 | 76 | 'collapseId' => 'collapse-object', |
77 | 77 | 'items' => $items |
78 | -]);?> |
|
78 | +]); ?> |
|
79 | 79 | </header> |
80 | 80 | |
81 | 81 | <div class="container body-container"> |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | echo $body; |
151 | 151 | } else { |
152 | 152 | \App::$Response->setStatusCode(404); |
153 | - echo '<p>' . __('Page is not founded!') . '</p>'; |
|
153 | + echo '<p>'.__('Page is not founded!').'</p>'; |
|
154 | 154 | } |
155 | 155 | ?> |
156 | 156 | </div> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | <?php |
244 | 244 | $customJsCode = \App::$View->showPlainCode('js'); |
245 | 245 | if ($customJsCode !== null) { |
246 | - echo '<script>' . $customJsCode . '</script>'; |
|
246 | + echo '<script>'.$customJsCode.'</script>'; |
|
247 | 247 | } |
248 | 248 | // render google analytics code here |
249 | 249 | echo \App::$View->render('blocks/googleanalytics'); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $this->cache = $cfg['cache']; |
40 | 40 | } |
41 | 41 | |
42 | - $this->_cacheName = 'widget.newcomment.' . $this->createStringClassSnapshotHash(); |
|
42 | + $this->_cacheName = 'widget.newcomment.'.$this->createStringClassSnapshotHash(); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | // work with cache and make query |
55 | 55 | $records = null; |
56 | - if ((int)$this->cache > 0) { |
|
56 | + if ((int) $this->cache > 0) { |
|
57 | 57 | if (App::$Cache->get($this->_cacheName) !== null) { |
58 | 58 | $records = App::$Cache->get($this->_cacheName); |
59 | 59 | } else { |
@@ -30,15 +30,15 @@ |
||
30 | 30 | $cfg = $this->getConfigs(); |
31 | 31 | // check cache is defined |
32 | 32 | if ($this->cache === null || !Obj::isLikeInt($this->cache)) { |
33 | - $this->cache = (int)$cfg['cache']; |
|
33 | + $this->cache = (int) $cfg['cache']; |
|
34 | 34 | } |
35 | 35 | // check tag count is defined |
36 | 36 | if ($this->count === null || !Obj::isLikeInt($this->count)) { |
37 | - $this->count = (int)$cfg['count']; |
|
37 | + $this->count = (int) $cfg['count']; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $this->_lang = App::$Request->getLanguage(); |
41 | - $this->_cacheName = 'widget.contenttag.' . $this->createStringClassSnapshotHash(); |
|
41 | + $this->_cacheName = 'widget.contenttag.'.$this->createStringClassSnapshotHash(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -34,14 +34,14 @@ |
||
34 | 34 | } |
35 | 35 | // check cache is defined |
36 | 36 | if ($this->cache === null || !Obj::isLikeInt($this->cache)) { |
37 | - $this->cache = (int)$cfg['cache']; |
|
37 | + $this->cache = (int) $cfg['cache']; |
|
38 | 38 | } |
39 | 39 | // check item count is defined |
40 | 40 | if ($this->count === null || !Obj::isLikeInt($this->count)) { |
41 | - $this->count = (int)$cfg['count']; |
|
41 | + $this->count = (int) $cfg['count']; |
|
42 | 42 | } |
43 | 43 | |
44 | - $this->_cacheName = 'widget.newcontent.' . $this->createStringClassSnapshotHash(); |
|
44 | + $this->_cacheName = 'widget.newcontent.'.$this->createStringClassSnapshotHash(); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |