@@ -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 | ]); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <hr /> |
24 | 24 | <div class="row"> |
25 | 25 | <div class="col-md-12"> |
26 | - <?= Url::link(['content/categoryupdate', 0], '<i class="fa fa-plus"></i> ' . __('Add category'), ['class' => 'btn btn-primary pull-right']) ?> |
|
26 | + <?= Url::link(['content/categoryupdate', 0], '<i class="fa fa-plus"></i> '.__('Add category'), ['class' => 'btn btn-primary pull-right']) ?> |
|
27 | 27 | </div> |
28 | 28 | </div> |
29 | 29 | <div class="table-responsive"> |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | <tr> |
56 | 56 | <td> |
57 | 57 | <div class="row"> |
58 | - <div class="col-md-<?= $offset ?> col-xs-<?= $offset+2 ?>" style="padding-top: 8px;border-bottom: 2px solid #8a8a8a"></div> |
|
59 | - <div class="col-md-<?= $set ?> col-xs-<?= $set-2 ?>"> |
|
58 | + <div class="col-md-<?= $offset ?> col-xs-<?= $offset + 2 ?>" style="padding-top: 8px;border-bottom: 2px solid #8a8a8a"></div> |
|
59 | + <div class="col-md-<?= $set ?> col-xs-<?= $set - 2 ?>"> |
|
60 | 60 | <?= Serialize::getDecodeLocale($row->title) ?> |
61 | 61 | <sup>id: <?= $row->id ?></sup> |
62 | 62 | <span class="label label-info">/<?= $row->path ?></span> |
@@ -9,15 +9,15 @@ |
||
9 | 9 | $title = Serialize::getDecodeLocale($record->title); |
10 | 10 | $title = Text::snippet($title, 50); |
11 | 11 | $date = Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR); |
12 | - $categoryUrl = \App::$Alias->baseUrl . '/content/list/' . $record->cpath; |
|
13 | - $categoryLink = '<a href="' . $categoryUrl . '">' . Serialize::getDecodeLocale($record->ctitle) . '</a>'; |
|
14 | - $newsLink = \App::$Alias->baseUrl . '/content/read/' . $record->cpath; |
|
15 | - $newsLink = rtrim($newsLink, '/') . '/' . $record->path; |
|
12 | + $categoryUrl = \App::$Alias->baseUrl.'/content/list/'.$record->cpath; |
|
13 | + $categoryLink = '<a href="'.$categoryUrl.'">'.Serialize::getDecodeLocale($record->ctitle).'</a>'; |
|
14 | + $newsLink = \App::$Alias->baseUrl.'/content/read/'.$record->cpath; |
|
15 | + $newsLink = rtrim($newsLink, '/').'/'.$record->path; |
|
16 | 16 | |
17 | 17 | echo '<div class="row"><div class="col-md-12">'; |
18 | - echo '<a href="' . $newsLink . '">→ ' . $title . '</a><br />'; |
|
19 | - echo '<small class="pull-left">' . $categoryLink . '</small>'; |
|
20 | - echo '<small class="pull-right">' . $date . '</small>'; |
|
18 | + echo '<a href="'.$newsLink.'">→ '.$title.'</a><br />'; |
|
19 | + echo '<small class="pull-left">'.$categoryLink.'</small>'; |
|
20 | + echo '<small class="pull-right">'.$date.'</small>'; |
|
21 | 21 | echo '</div></div>'; |
22 | 22 | echo '<hr class="pretty" />'; |
23 | 23 | } |
@@ -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 = [ |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <?php foreach ($model->items as $item): ?> |
57 | 57 | <article class="article-item" itemscope="itemscope" itemtype="https://schema.org/NewsArticle"> |
58 | 58 | <h2 itemprop="name"> |
59 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>"> |
|
59 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>"> |
|
60 | 60 | <?= $item['title'] ?> |
61 | 61 | </a> |
62 | 62 | </h2> |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | <?php |
84 | 84 | $ownerNick = $item['author']->getProfile()->getNickname(); |
85 | 85 | if ($item['author']->getId() < 1) { |
86 | - echo '<s>' . $ownerNick . '</s>'; |
|
86 | + echo '<s>'.$ownerNick.'</s>'; |
|
87 | 87 | } else { |
88 | 88 | echo Url::link(['profile/show', $item['author']->getId()], $ownerNick, ['itemprop' => 'author']); |
89 | 89 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | <div class="row"> |
101 | 101 | <div class="col-md-12"> |
102 | 102 | <?php if ($catConfigs['showPoster'] === true && $item['thumb'] !== null): ?> |
103 | - <img src="<?= \App::$Alias->scriptUrl . $item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" /> |
|
103 | + <img src="<?= \App::$Alias->scriptUrl.$item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" /> |
|
104 | 104 | <?php endif; ?> |
105 | 105 | <div itemprop="text articleBody"> |
106 | 106 | <?= $item['text'] ?> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | </div> |
109 | 109 | </div> |
110 | 110 | <div class="meta"> |
111 | - <?php if ((int)$catConfigs['showRating'] === 1) { |
|
111 | + <?php if ((int) $catConfigs['showRating'] === 1) { |
|
112 | 112 | echo \App::$View->render('content/_rate', [ |
113 | 113 | 'id' => $item['id'], |
114 | 114 | 'canRate' => $item['canRate'], |
@@ -120,12 +120,12 @@ discard block |
||
120 | 120 | <a href="#"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a> |
121 | 121 | </span> |
122 | 122 | <span class="pull-right"> |
123 | - <?php if ((int)$configs['keywordsAsTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?> |
|
123 | + <?php if ((int) $configs['keywordsAsTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])): ?> |
|
124 | 124 | <span class="spaced"><i class="fa fa-tags hidden-xs"></i> |
125 | 125 | <?php |
126 | 126 | foreach ($item['tags'] as $tag) { |
127 | 127 | $tag = \App::$Security->strip_tags(trim($tag)); |
128 | - echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . " "; |
|
128 | + echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default'])." "; |
|
129 | 129 | } |
130 | 130 | ?> |
131 | 131 | </span> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $this->_path = $path; |
55 | 55 | $this->_configs = $configs; |
56 | - $this->_page = (int)$offset; |
|
56 | + $this->_page = (int) $offset; |
|
57 | 57 | parent::__construct(); |
58 | 58 | } |
59 | 59 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function before() |
66 | 66 | { |
67 | 67 | // find one or more categories where we must looking for content items |
68 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
68 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
69 | 69 | $this->findCategories(); |
70 | 70 | } else { |
71 | 71 | $this->findCategory(); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | private function findCategories() |
103 | 103 | { |
104 | 104 | // get all categories for current path and child of it |
105 | - $query = ContentCategory::where('path', 'like', $this->_path . '%'); |
|
105 | + $query = ContentCategory::where('path', 'like', $this->_path.'%'); |
|
106 | 106 | if ($query->count() < 1) { |
107 | 107 | throw new NotFoundException(__('Category is not founded')); |
108 | 108 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | // calculate selection offset |
138 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
138 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
139 | 139 | if ($itemPerPage < 1) { |
140 | 140 | $itemPerPage = 1; |
141 | 141 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | { |
162 | 162 | // prepare rss url link for current category if enabled |
163 | 163 | $rssUrl = false; |
164 | - if ((int)$this->_configs['rss'] === 1) { |
|
165 | - $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path; |
|
164 | + if ((int) $this->_configs['rss'] === 1) { |
|
165 | + $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path; |
|
166 | 166 | $rssUrl = rtrim($rssUrl, '/'); |
167 | 167 | } |
168 | 168 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | ]; |
177 | 177 | |
178 | 178 | // check if this category is hidden |
179 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
179 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
180 | 180 | throw new ForbiddenException(__('This category is not available to view')); |
181 | 181 | } |
182 | 182 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | // check if current user can rate item |
223 | 223 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
224 | 224 | $canRate = true; |
225 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
225 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
226 | 226 | $canRate = false; |
227 | 227 | } |
228 | 228 | if (!App::$User->isAuth()) { |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | 'poster' => $row->getPosterUri(), |
240 | 240 | 'thumb' => $row->getPosterThumbUri(), |
241 | 241 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
242 | - 'views' => (int)$row->views, |
|
243 | - 'rating' => (int)$row->rating, |
|
242 | + 'views' => (int) $row->views, |
|
243 | + 'rating' => (int) $row->rating, |
|
244 | 244 | 'canRate' => $canRate, |
245 | 245 | 'category' => $this->categories[$row->category_id], |
246 | - 'uri' => '/content/read/' . $itemPath, |
|
246 | + 'uri' => '/content/read/'.$itemPath, |
|
247 | 247 | 'tags' => $tags |
248 | 248 | ]; |
249 | 249 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | // build path and check is file exists on disk |
98 | - $path = '/upload/gallery/' . $this->id . '/orig/' . $pName; |
|
98 | + $path = '/upload/gallery/'.$this->id.'/orig/'.$pName; |
|
99 | 99 | if (!File::exist($path)) { |
100 | 100 | return null; |
101 | 101 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // remove extension, thumbs always in jpeg ;D |
118 | 118 | $pName = Str::cleanExtension($pName); |
119 | - $path = '/upload/gallery/' . $this->id . '/thumb/' . $pName . '.jpg'; |
|
119 | + $path = '/upload/gallery/'.$this->id.'/thumb/'.$pName.'.jpg'; |
|
120 | 120 | |
121 | 121 | if (!File::exist($path)) { |
122 | 122 | return null; |