@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | $catConfigs = []; |
17 | 17 | foreach ($model->category['configs'] as $key=>$value) { |
18 | - $catConfigs[$key] = (int)$value === 1; |
|
18 | + $catConfigs[$key] = (int) $value === 1; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $catMeta = [ |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | <?php foreach ($model->items as $item): ?> |
69 | 69 | <article class="article-item" itemscope="itemscope" itemtype="https://schema.org/NewsArticle"> |
70 | 70 | <h2 itemprop="name"> |
71 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>"> |
|
71 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>"> |
|
72 | 72 | <?= $item['title'] ?> |
73 | 73 | </a> |
74 | 74 | </h2> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | <?php |
96 | 96 | $ownerNick = $item['author']->getProfile()->getNickname(); |
97 | 97 | if ($item['author']->getId() < 1) { |
98 | - echo '<s>' . $ownerNick . '</s>'; |
|
98 | + echo '<s>'.$ownerNick.'</s>'; |
|
99 | 99 | } else { |
100 | 100 | echo Url::link(['profile/show', $item['author']->getId()], $ownerNick, ['itemprop' => 'author']); |
101 | 101 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | <div class="row"> |
113 | 113 | <div class="col-md-12"> |
114 | 114 | <?php if ($catConfigs['showPoster'] === true && $item['thumb'] !== null): ?> |
115 | - <img src="<?= \App::$Alias->scriptUrl . $item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" /> |
|
115 | + <img src="<?= \App::$Alias->scriptUrl.$item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" /> |
|
116 | 116 | <?php endif; ?> |
117 | 117 | <div itemprop="text articleBody"> |
118 | 118 | <?= $item['text'] ?> |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | </div> |
121 | 121 | </div> |
122 | 122 | <div class="meta"> |
123 | - <?php if ((int)$catConfigs['showRating'] === 1) { |
|
123 | + <?php if ((int) $catConfigs['showRating'] === 1) { |
|
124 | 124 | echo \App::$View->render('content/_rate', [ |
125 | 125 | 'id' => $item['id'], |
126 | 126 | 'canRate' => $item['canRate'], |
@@ -129,15 +129,15 @@ discard block |
||
129 | 129 | } ?> |
130 | 130 | |
131 | 131 | <span class="spaced hidden-xs"><i class="fa fa-comments"></i> |
132 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>#comments-list"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a> |
|
132 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>#comments-list"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a> |
|
133 | 133 | </span> |
134 | 134 | <span class="pull-right"> |
135 | - <?php if ((int)$catConfigs['showTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?> |
|
135 | + <?php if ((int) $catConfigs['showTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?> |
|
136 | 136 | <span class="spaced"><i class="fa fa-tags hidden-xs"></i> |
137 | 137 | <?php |
138 | 138 | foreach ($item['tags'] as $tag) { |
139 | 139 | $tag = \App::$Security->strip_tags(trim($tag)); |
140 | - echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . " "; |
|
140 | + echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default'])." "; |
|
141 | 141 | } |
142 | 142 | ?> |
143 | 143 | </span> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | // don't use breadcrumbs on injected pathway rule |
26 | -if (!\App::$Request->isPathInjected() && (bool)$model->getCategory()->getProperty('showCategory')) { |
|
26 | +if (!\App::$Request->isPathInjected() && (bool) $model->getCategory()->getProperty('showCategory')) { |
|
27 | 27 | $breadcrumbs = [ |
28 | 28 | Url::to('/') => __('Home') |
29 | 29 | ]; |
@@ -35,22 +35,22 @@ discard block |
||
35 | 35 | $breadcrumbs[Url::to('content/list', $cat['path'], null, [], false)] = $cat['name']; |
36 | 36 | } |
37 | 37 | } |
38 | - $breadcrumbs[] = __('Content') . ': ' . Str::sub($this->title, 0, 40); |
|
38 | + $breadcrumbs[] = __('Content').': '.Str::sub($this->title, 0, 40); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->breadcrumbs = $breadcrumbs; |
42 | 42 | } |
43 | 43 | |
44 | 44 | $properties = [ |
45 | - 'date' => (bool)$model->getCategory()->getProperty('showDate'), |
|
46 | - 'author' => (bool)$model->getCategory()->getProperty('showAuthor'), |
|
47 | - 'views' => (bool)$model->getCategory()->getProperty('showViews'), |
|
48 | - 'category' => (bool)$model->getCategory()->getProperty('showCategory'), |
|
49 | - 'rating' => (bool)$model->getCategory()->getProperty('showRating'), |
|
50 | - 'tags' => (bool)$model->getCategory()->getProperty('showTags') |
|
45 | + 'date' => (bool) $model->getCategory()->getProperty('showDate'), |
|
46 | + 'author' => (bool) $model->getCategory()->getProperty('showAuthor'), |
|
47 | + 'views' => (bool) $model->getCategory()->getProperty('showViews'), |
|
48 | + 'category' => (bool) $model->getCategory()->getProperty('showCategory'), |
|
49 | + 'rating' => (bool) $model->getCategory()->getProperty('showRating'), |
|
50 | + 'tags' => (bool) $model->getCategory()->getProperty('showTags') |
|
51 | 51 | ]; |
52 | -$showComments = (bool)$model->getCategory()->getProperty('showComments'); |
|
53 | -$showPoster = (bool)$model->getCategory()->getProperty('showPoster'); |
|
52 | +$showComments = (bool) $model->getCategory()->getProperty('showComments'); |
|
53 | +$showPoster = (bool) $model->getCategory()->getProperty('showPoster'); |
|
54 | 54 | |
55 | 55 | ?> |
56 | 56 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | <span class="spaced"><i class="fa fa-eye"></i> <?= $model->views ?></span> |
76 | 76 | <?php endif ?> |
77 | 77 | <?php if (\App::$User->isAuth() && \App::$User->identity()->getRole()->can('Admin/Content/Update')): ?> |
78 | - <span class="pull-right"><a href="<?= \App::$Alias->scriptUrl . '/admin/content/update/' . $model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
78 | + <span class="pull-right"><a href="<?= \App::$Alias->scriptUrl.'/admin/content/update/'.$model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
79 | 79 | <?php endif; ?> |
80 | 80 | </div> |
81 | 81 | <?php else: ?> |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | <div id="content-text"> |
88 | 88 | <?php if ($showPoster === true && $model->posterFull !== null && $model->posterThumb !== null): ?> |
89 | 89 | <a href="#showPoster" data-toggle="modal" data-target="#showPoster"> |
90 | - <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase(\App::$Security->strip_tags($model->title)) ?>" src="<?= \App::$Alias->scriptUrl . $model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
90 | + <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase(\App::$Security->strip_tags($model->title)) ?>" src="<?= \App::$Alias->scriptUrl.$model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
91 | 91 | </a> |
92 | 92 | |
93 | 93 | <!-- Modal poster pop-up --> |
@@ -99,19 +99,19 @@ discard block |
||
99 | 99 | <h4 class="modal-title" id="myModalLabel"><?= __('View poster') ?></h4> |
100 | 100 | </div> |
101 | 101 | <div class="modal-body"> |
102 | - <img class="img-responsive" src="<?= \App::$Alias->scriptUrl . $model->posterFull ?>" alt="<?= __('Poster image') ?>" style="margin: 0 auto;" /> |
|
102 | + <img class="img-responsive" src="<?= \App::$Alias->scriptUrl.$model->posterFull ?>" alt="<?= __('Poster image') ?>" style="margin: 0 auto;" /> |
|
103 | 103 | </div> |
104 | 104 | </div> |
105 | 105 | </div> |
106 | 106 | </div> |
107 | - <?php endif ;?> |
|
107 | + <?php endif; ?> |
|
108 | 108 | <?= $model->text ?> |
109 | 109 | </div> |
110 | 110 | <?php if ($model->galleryItems !== null && Obj::isArray($model->galleryItems)): ?> |
111 | 111 | <div class="row"> |
112 | 112 | <?php foreach ($model->galleryItems as $thumbPic => $fullPic): ?> |
113 | 113 | <div class="col-md-2 well"> |
114 | - <a href="#showGallery" class="modalGallery" content="<?= \App::$Alias->scriptUrl . $fullPic ?>"><img src="<?= \App::$Alias->scriptUrl . $thumbPic ?>" class="img-responsive image-item" /></a> |
|
114 | + <a href="#showGallery" class="modalGallery" content="<?= \App::$Alias->scriptUrl.$fullPic ?>"><img src="<?= \App::$Alias->scriptUrl.$thumbPic ?>" class="img-responsive image-item" /></a> |
|
115 | 115 | </div> |
116 | 116 | <?php endforeach; ?> |
117 | 117 | </div> |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | <h4 class="modal-title" id="showModalLabel"><?= __('View picture') ?></h4> |
124 | 124 | </div> |
125 | 125 | <div class="modal-body" id="modal-gallery-body"> |
126 | - <img class="img-responsive" src="<?= \App::$Alias->scriptUrl . $model->posterFull ?>" alt="<?= __('Gallery picture') ?>" style="margin: 0 auto;" /> |
|
126 | + <img class="img-responsive" src="<?= \App::$Alias->scriptUrl.$model->posterFull ?>" alt="<?= __('Gallery picture') ?>" style="margin: 0 auto;" /> |
|
127 | 127 | </div> |
128 | 128 | </div> |
129 | 129 | </div> |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | </div> |
145 | 145 | <div id="similar<?= $idx ?>" class="panel-collapse collapse"> |
146 | 146 | <div class="panel-body"> |
147 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>"> |
|
147 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>"> |
|
148 | 148 | <?= $item['snippet'] ?> |
149 | 149 | </a> |
150 | 150 | </div> |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | echo '<i class="fa fa-tags hidden-xs"></i> '; |
176 | 176 | foreach ($model->metaKeywords as $tag) { |
177 | 177 | $tag = \App::$Security->strip_tags(trim($tag)); |
178 | - echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . " "; |
|
178 | + echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default'])." "; |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | ?> |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | { |
56 | 56 | $path = $this->request->getPathWithoutControllerAction(); |
57 | 57 | $configs = $this->getConfigs(); |
58 | - $page = (int)$this->request->query->get('page', 0); |
|
59 | - $sort = (string)$this->request->query->get('sort', 'newest'); |
|
60 | - $itemCount = (int)$configs['itemPerCategory']; |
|
58 | + $page = (int) $this->request->query->get('page', 0); |
|
59 | + $sort = (string) $this->request->query->get('sort', 'newest'); |
|
60 | + $itemCount = (int) $configs['itemPerCategory']; |
|
61 | 61 | |
62 | 62 | // build special model with content list and category list information |
63 | 63 | $model = new EntityCategoryList($path, $configs, $page, $sort); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $model = new EntityContentRead($categoryRecord, $contentRecord->first()); |
138 | 138 | $search = null; |
139 | 139 | // check if similar search is enabled for item category |
140 | - if ((int)$model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) { |
|
140 | + if ((int) $model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) { |
|
141 | 141 | $search = new EntityContentSearch($model->title, $model->id); |
142 | 142 | } |
143 | 143 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | // get equal rows order by creation date |
177 | - $records = ContentEntity::where('meta_keywords', 'like', '%' . $tagName . '%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE); |
|
177 | + $records = ContentEntity::where('meta_keywords', 'like', '%'.$tagName.'%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE); |
|
178 | 178 | // check if result is not empty |
179 | 179 | if ($records->count() < 1) { |
180 | 180 | throw new NotFoundException(__('Nothing founded')); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $this->layout = null; |
209 | 209 | |
210 | 210 | // check if rss display allowed for this category |
211 | - if ((int)$model->category['configs']['showRss'] !== 1) { |
|
211 | + if ((int) $model->category['configs']['showRss'] !== 1) { |
|
212 | 212 | throw new ForbiddenException(__('Rss feed is disabled for this category')); |
213 | 213 | } |
214 | 214 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | // set channel data |
220 | 220 | $channel->title($model->category['title']) |
221 | 221 | ->description($model->category['description']) |
222 | - ->url(App::$Alias->baseUrl . '/content/list/' . $model->category['path']) |
|
222 | + ->url(App::$Alias->baseUrl.'/content/list/'.$model->category['path']) |
|
223 | 223 | ->appendTo($feed); |
224 | 224 | |
225 | 225 | // add content data |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | // add title, short text, url |
230 | 230 | $item->title($row['title']) |
231 | 231 | ->description($row['text']) |
232 | - ->url(App::$Alias->baseUrl . $row['uri']); |
|
232 | + ->url(App::$Alias->baseUrl.$row['uri']); |
|
233 | 233 | // add poster |
234 | 234 | if ($row['thumb'] !== null) { |
235 | - $item->enclosure(App::$Alias->scriptUrl . $row['thumb'], $row['thumbSize'], 'image/jpeg'); |
|
235 | + $item->enclosure(App::$Alias->scriptUrl.$row['thumb'], $row['thumbSize'], 'image/jpeg'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | // append response to channel |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | |
268 | 268 | // check if user add enabled |
269 | 269 | $configs = $this->getConfigs(); |
270 | - if (!(bool)$configs['userAdd']) { |
|
270 | + if (!(bool) $configs['userAdd']) { |
|
271 | 271 | throw new NotFoundException(__('User add is disabled')); |
272 | 272 | } |
273 | 273 | |
274 | 274 | // prepare query |
275 | - $page = (int)$this->request->query->get('page', 0); |
|
275 | + $page = (int) $this->request->query->get('page', 0); |
|
276 | 276 | $offset = $page * 10; |
277 | 277 | $query = ContentRecord::where('author_id', '=', App::$User->identity()->getId()); |
278 | 278 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | // check if user add enabled |
314 | 314 | $configs = $this->getConfigs(); |
315 | - if (!(bool)$configs['userAdd']) { |
|
315 | + if (!(bool) $configs['userAdd']) { |
|
316 | 316 | throw new NotFoundException(__('User add is disabled')); |
317 | 317 | } |
318 | 318 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $new = $record->id === null; |
322 | 322 | |
323 | 323 | // reject edit published items and items from other authors |
324 | - if (($new === false && (int)$record->author_id !== App::$User->identity()->getId()) || (int)$record->display === 1) { |
|
324 | + if (($new === false && (int) $record->author_id !== App::$User->identity()->getId()) || (int) $record->display === 1) { |
|
325 | 325 | throw new ForbiddenException(__('You have no permissions to edit this content')); |
326 | 326 | } |
327 | 327 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $category = $content->getCategory(); |
371 | 371 | $uri = '/content/read/'; |
372 | 372 | if (!Str::likeEmpty($category->path)) { |
373 | - $uri .= $category->path . '/'; |
|
373 | + $uri .= $category->path.'/'; |
|
374 | 374 | } |
375 | 375 | $uri .= $content->path; |
376 | 376 | $sitemap->add($uri, $content->created_at, 'weekly', 0.7); |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | // add categories |
379 | 379 | $categories = ContentCategory::getAll(); |
380 | 380 | foreach ($categories as $item) { |
381 | - if ((bool)$item->getProperty('showCategory')) { |
|
382 | - $uri = '/content/list/' . $item->path; |
|
381 | + if ((bool) $item->getProperty('showCategory')) { |
|
382 | + $uri = '/content/list/'.$item->path; |
|
383 | 383 | $sitemap->add($uri, date('c'), 'daily', 0.9); |
384 | 384 | } |
385 | 385 | } |