@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $this->_path = $path; |
61 | 61 | $this->_configs = $configs; |
62 | - $this->_page = (int)$offset; |
|
62 | + $this->_page = (int) $offset; |
|
63 | 63 | $this->_sort = $sort; |
64 | 64 | parent::__construct(); |
65 | 65 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function before() |
73 | 73 | { |
74 | 74 | // find one or more categories where we must looking for content items |
75 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
75 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
76 | 76 | $this->findCategories(); |
77 | 77 | } else { |
78 | 78 | $this->findCategory(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setItemLimit($limit) |
93 | 93 | { |
94 | - $this->_customItemLimit = (int)$limit; |
|
94 | + $this->_customItemLimit = (int) $limit; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | private function findCategories() |
120 | 120 | { |
121 | 121 | // get all categories for current path and child of it |
122 | - $query = ContentCategory::where('path', 'like', $this->_path . '%'); |
|
122 | + $query = ContentCategory::where('path', 'like', $this->_path.'%'); |
|
123 | 123 | if ($query->count() < 1) { |
124 | 124 | throw new NotFoundException(__('Category is not founded')); |
125 | 125 | } |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | // calculate selection offset |
155 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
155 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
156 | 156 | // check if custom itemlimit defined over model api |
157 | 157 | if ($this->_customItemLimit !== false) { |
158 | - $itemPerPage = (int)$this->_customItemLimit; |
|
158 | + $itemPerPage = (int) $this->_customItemLimit; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $offset = $this->_page * $itemPerPage; |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | $catConfigs = Serialize::decode($this->_currentCategory->configs); |
198 | 198 | // prepare rss url link for current category if enabled |
199 | 199 | $rssUrl = false; |
200 | - if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) { |
|
201 | - $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path; |
|
200 | + if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) { |
|
201 | + $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path; |
|
202 | 202 | $rssUrl = rtrim($rssUrl, '/'); |
203 | 203 | } |
204 | 204 | |
205 | 205 | // prepare sorting urls |
206 | 206 | $catSortParams = []; |
207 | 207 | if (App::$Request->query->get('page') !== null) { |
208 | - $catSortParams['page'] = (int)App::$Request->query->get('page'); |
|
208 | + $catSortParams['page'] = (int) App::$Request->query->get('page'); |
|
209 | 209 | } |
210 | 210 | $catSortUrls = [ |
211 | 211 | 'views' => Url::to('content/list', $this->_currentCategory->path, null, Arr::merge($catSortParams, ['sort' => 'views']), false), |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | ]; |
225 | 225 | |
226 | 226 | // check if this category is hidden |
227 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
227 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
228 | 228 | throw new ForbiddenException(__('This category is not available to view')); |
229 | 229 | } |
230 | 230 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | // check if current user can rate item |
280 | 280 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
281 | 281 | $canRate = true; |
282 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
282 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
283 | 283 | $canRate = false; |
284 | 284 | } |
285 | 285 | if (!App::$User->isAuth()) { |
@@ -299,11 +299,11 @@ discard block |
||
299 | 299 | 'poster' => $row->getPosterUri(), |
300 | 300 | 'thumb' => $row->getPosterThumbUri(), |
301 | 301 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
302 | - 'views' => (int)$row->views, |
|
303 | - 'rating' => (int)$row->rating, |
|
302 | + 'views' => (int) $row->views, |
|
303 | + 'rating' => (int) $row->rating, |
|
304 | 304 | 'canRate' => $canRate, |
305 | 305 | 'category' => $this->categories[$row->category_id], |
306 | - 'uri' => '/content/read/' . $itemPath, |
|
306 | + 'uri' => '/content/read/'.$itemPath, |
|
307 | 307 | 'tags' => $tags |
308 | 308 | ]; |
309 | 309 | } |
@@ -52,16 +52,16 @@ discard block |
||
52 | 52 | $this->data[$lang][] = [ |
53 | 53 | 'uri' => Url::standaloneUrl($uri, $lang), |
54 | 54 | 'lastmod' => Date::convertToDatetime($lastmod, 'c'), |
55 | - 'freq' => (string)$freq, |
|
56 | - 'priority' => (float)$priority |
|
55 | + 'freq' => (string) $freq, |
|
56 | + 'priority' => (float) $priority |
|
57 | 57 | ]; |
58 | 58 | } |
59 | 59 | } else { // only one language, multilanguage is disabled |
60 | 60 | $this->data[App::$Properties->get('singleLanguage')][] = [ |
61 | 61 | 'uri' => Url::standaloneUrl($uri), |
62 | 62 | 'lastmod' => Date::convertToDatetime($lastmod, 'c'), |
63 | - 'freq' => (string)$freq, |
|
64 | - 'priority' => (float)$priority |
|
63 | + 'freq' => (string) $freq, |
|
64 | + 'priority' => (float) $priority |
|
65 | 65 | ]; |
66 | 66 | } |
67 | 67 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'items' => $items |
87 | 87 | ]); |
88 | 88 | |
89 | - File::write(EntityIndexList::INDEX_PATH . '/' . $uniqueName . '.' . $lang . '.xml', $xml); |
|
89 | + File::write(EntityIndexList::INDEX_PATH.'/'.$uniqueName.'.'.$lang.'.xml', $xml); |
|
90 | 90 | } |
91 | 91 | return true; |
92 | 92 | } |
@@ -15,19 +15,19 @@ |
||
15 | 15 | <h1><?= __('Sitemap') ?></h1> |
16 | 16 | <hr /> |
17 | 17 | <p><?= __('Sitemap its a special application to generate sitemap as xml file over sitemap standart for search engines.') ?></p> |
18 | -<p><?= __('Sitemap main index') ?>: <a href="<?= \App::$Alias->scriptUrl . '/sitemap' ?>" target="_blank">/sitemap</a></p> |
|
18 | +<p><?= __('Sitemap main index') ?>: <a href="<?= \App::$Alias->scriptUrl.'/sitemap' ?>" target="_blank">/sitemap</a></p> |
|
19 | 19 | <h3><?= __('Sitemap files') ?></h3> |
20 | 20 | <?php |
21 | 21 | $items = []; |
22 | 22 | if ($model->files === null || count($model->files) < 1) { |
23 | - echo '<p class="alert alert-warning">' . __('No sitemap files found! Maybe cron manager is not configured') . '</p>'; |
|
23 | + echo '<p class="alert alert-warning">'.__('No sitemap files found! Maybe cron manager is not configured').'</p>'; |
|
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | -foreach($model->files as $file) { |
|
27 | +foreach ($model->files as $file) { |
|
28 | 28 | $items[] = [ |
29 | 29 | 'type' => 'link', |
30 | - 'link' => \App::$Alias->scriptUrl . $file, |
|
30 | + 'link' => \App::$Alias->scriptUrl.$file, |
|
31 | 31 | 'text' => $file, |
32 | 32 | 'linkProperty' => ['target' => '_blank'] |
33 | 33 | ]; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | <hr /> |
18 | 18 | <?php |
19 | 19 | if ($model->items === null || count($model->items) < 1) { |
20 | - echo '<p class="alert alert-warning">' . __('No notifications available') . '</p>'; |
|
20 | + echo '<p class="alert alert-warning">'.__('No notifications available').'</p>'; |
|
21 | 21 | return; |
22 | 22 | } |
23 | 23 | ?> |
@@ -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 |