@@ -9,4 +9,4 @@ |
||
9 | 9 | ['type' => 'link', 'text' => __('Group management'), 'link' => ['user/grouplist']], |
10 | 10 | ['type' => 'link', 'text' => __('Settings'), 'link' => ['user/settings']] |
11 | 11 | ] |
12 | -]);?> |
|
13 | 12 | \ No newline at end of file |
13 | +]); ?> |
|
14 | 14 | \ No newline at end of file |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use Ffcms\Core\Exception\NotFoundException; |
13 | 13 | use Apps\Model\Front\Content\EntityContentRead; |
14 | 14 | use Ffcms\Core\Helper\HTML\SimplePagination; |
15 | -use Ffcms\Core\Helper\Serialize; |
|
16 | 15 | use Ffcms\Core\Helper\Type\Str; |
17 | 16 | use Suin\RSSWriter\Channel; |
18 | 17 | use Suin\RSSWriter\Feed; |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | { |
47 | 47 | $path = App::$Request->getPathWithoutControllerAction(); |
48 | 48 | $configs = $this->getConfigs(); |
49 | - $page = (int)App::$Request->query->get('page'); |
|
50 | - $itemCount = (int)$configs['itemPerCategory']; |
|
49 | + $page = (int) App::$Request->query->get('page'); |
|
50 | + $itemCount = (int) $configs['itemPerCategory']; |
|
51 | 51 | |
52 | 52 | // build special model with content list and category list information |
53 | 53 | $model = new EntityCategoryList($path, $configs, $page); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $model = new EntityContentRead($categoryRecord, $contentRecord->first()); |
117 | 117 | $search = null; |
118 | 118 | // check if similar search is enabled for item category |
119 | - if ((int)$model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) { |
|
119 | + if ((int) $model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) { |
|
120 | 120 | $search = new EntityContentSearch($model->title, $model->id); |
121 | 121 | } |
122 | 122 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $configs = $this->getConfigs(); |
141 | 141 | // check if tags is enabled |
142 | - if ((int)$configs['keywordsAsTags'] !== 1) { |
|
142 | + if ((int) $configs['keywordsAsTags'] !== 1) { |
|
143 | 143 | throw new NotFoundException(__('Tag system is disabled')); |
144 | 144 | } |
145 | 145 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $this->layout = null; |
182 | 182 | |
183 | 183 | // check if rss display allowed for this category |
184 | - if ((int)$model->category['configs']['showRss'] !== 1) { |
|
184 | + if ((int) $model->category['configs']['showRss'] !== 1) { |
|
185 | 185 | throw new ForbiddenException(__('Rss feed is disabled for this category')); |
186 | 186 | } |
187 | 187 |
@@ -3,9 +3,8 @@ |
||
3 | 3 | namespace Apps\Model\Front\Content; |
4 | 4 | |
5 | 5 | |
6 | -use Apps\ActiveRecord\Content; |
|
7 | -use Apps\ActiveRecord\ContentCategory; |
|
8 | 6 | use Apps\ActiveRecord\Content as ContentRecord; |
7 | +use Apps\ActiveRecord\ContentCategory; |
|
9 | 8 | use Apps\ActiveRecord\User; |
10 | 9 | use Ffcms\Core\App; |
11 | 10 | use Ffcms\Core\Arch\Model; |
@@ -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(); |
@@ -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 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | ]; |
169 | 169 | |
170 | 170 | // check if this category is hidden |
171 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
171 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
172 | 172 | throw new ForbiddenException(__('This category is not available to view')); |
173 | 173 | } |
174 | 174 | |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | 'poster' => $row->getPosterUri(), |
219 | 219 | 'thumb' => $row->getPosterThumbUri(), |
220 | 220 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
221 | - 'views' => (int)$row->views, |
|
222 | - 'rating' => (int)$row->rating, |
|
221 | + 'views' => (int) $row->views, |
|
222 | + 'rating' => (int) $row->rating, |
|
223 | 223 | 'category' => $this->categories[$row->category_id], |
224 | 224 | 'uri' => '/content/read/' . $itemPath, |
225 | 225 | 'tags' => $tags |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * EntityContentSearch constructor. Pass search terms (query string) to model and used items to skip it by id. |
27 | 27 | * @param $terms |
28 | - * @param int|array $skipIds |
|
28 | + * @param integer $skipIds |
|
29 | 29 | */ |
30 | 30 | public function __construct($terms, $skipIds = 0) |
31 | 31 | { |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php return [ |
2 | - 'Alias' => [ |
|
3 | - 'Front' => [ |
|
4 | - '/about' => '/content/read/page/about-page' |
|
5 | - ] |
|
6 | - ], |
|
7 | - 'Callback' => [ |
|
8 | - 'Front' => [ |
|
9 | - 'Demo' => '\Apps\Controller\Front\Main' |
|
10 | - ] |
|
11 | - ] |
|
2 | + 'Alias' => [ |
|
3 | + 'Front' => [ |
|
4 | + '/about' => '/content/read/page/about-page' |
|
5 | + ] |
|
6 | + ], |
|
7 | + 'Callback' => [ |
|
8 | + 'Front' => [ |
|
9 | + 'Demo' => '\Apps\Controller\Front\Main' |
|
10 | + ] |
|
11 | + ] |
|
12 | 12 | ]; |
13 | 13 | \ No newline at end of file |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * Labels for form |
|
46 | - */ |
|
45 | + * Labels for form |
|
46 | + */ |
|
47 | 47 | public function labels() |
48 | 48 | { |
49 | 49 | return [ |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Validation rules for comments settings |
|
61 | - */ |
|
60 | + * Validation rules for comments settings |
|
61 | + */ |
|
62 | 62 | public function rules() |
63 | 63 | { |
64 | 64 | return [ |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | // set header |
22 | 22 | $this->setJsonHeader(); |
23 | 23 | // get config count per page |
24 | - $perPage = (int)AppRecord::getConfig('widget', 'Comments', 'perPage'); |
|
24 | + $perPage = (int) AppRecord::getConfig('widget', 'Comments', 'perPage'); |
|
25 | 25 | // offset can be only integer |
26 | - $index = (int)$index; |
|
26 | + $index = (int) $index; |
|
27 | 27 | $offset = $perPage * $index; |
28 | 28 | // get comment target path and check |
29 | - $path = (string)App::$Request->query->get('path'); |
|
29 | + $path = (string) App::$Request->query->get('path'); |
|
30 | 30 | if (Str::likeEmpty($path)) { |
31 | 31 | throw new JsonException('Wrong path'); |
32 | 32 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function actionShowanswers($commentId) |
89 | 89 | { |
90 | 90 | // check input data |
91 | - if (!Obj::isLikeInt($commentId) || (int)$commentId < 1) { |
|
91 | + if (!Obj::isLikeInt($commentId) || (int) $commentId < 1) { |
|
92 | 92 | throw new JsonException('Input data is incorrect'); |
93 | 93 | } |
94 | 94 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | </li> |
55 | 55 | </ul> |
56 | 56 | |
57 | -<?php if ((int)$configs['guestAdd'] === 1 || \App::$User->isAuth()): ?> |
|
57 | +<?php if ((int) $configs['guestAdd'] === 1 || \App::$User->isAuth()): ?> |
|
58 | 58 | <!-- comment form --> |
59 | 59 | <form name="comment-add-form" action="" method="post" style="padding-top: 15px;" class="form-horizontal"> |
60 | 60 | <input type="hidden" name="replay-to" value="0" /> |