@@ -13,7 +13,6 @@ |
||
13 | 13 | use Ffcms\Core\Helper\Simplify; |
14 | 14 | use Ffcms\Core\Helper\Type\Any; |
15 | 15 | use Ffcms\Core\Helper\Type\Arr; |
16 | -use Ffcms\Core\Helper\Type\Obj; |
|
17 | 16 | use Ffcms\Core\Helper\Type\Str; |
18 | 17 | |
19 | 18 | /** |
@@ -67,7 +67,7 @@ |
||
67 | 67 | /** |
68 | 68 | * Prepare model attributes from passed objects |
69 | 69 | * @throws ForbiddenException |
70 | - */ |
|
70 | + */ |
|
71 | 71 | public function before() |
72 | 72 | { |
73 | 73 | // set class attributes from ActiveRecord objects |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->id = $this->_content->id; |
89 | 89 | $this->title = $this->_content->getLocaled('title'); |
90 | 90 | $this->text = $this->_content->getLocaled('text'); |
91 | - $this->display = (bool)$this->_content->display; |
|
91 | + $this->display = (bool) $this->_content->display; |
|
92 | 92 | |
93 | 93 | $this->metaTitle = $this->_content->getLocaled('meta_title'); |
94 | 94 | $this->metaDescription = $this->_content->getLocaled('meta_description'); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | $this->source = $this->_content->source; |
110 | - $this->views = $this->_content->views+1; |
|
110 | + $this->views = $this->_content->views + 1; |
|
111 | 111 | $this->rating = $this->_content->rating; |
112 | 112 | |
113 | 113 | // update views count |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
135 | 135 | $this->canRate = true; |
136 | - if (Any::isArray($ignoredRate) && Arr::in((string)$this->id, $ignoredRate)) { |
|
136 | + if (Any::isArray($ignoredRate) && Arr::in((string) $this->id, $ignoredRate)) { |
|
137 | 137 | $this->canRate = false; |
138 | 138 | } |
139 | 139 | if (!App::$User->isAuth()) { |
@@ -149,15 +149,15 @@ discard block |
||
149 | 149 | private function prepareGallery() |
150 | 150 | { |
151 | 151 | // get gallery images and poster data |
152 | - $galleryPath = '/upload/gallery/' . $this->_content->id; |
|
152 | + $galleryPath = '/upload/gallery/'.$this->_content->id; |
|
153 | 153 | // check if gallery folder is exist |
154 | 154 | if (Directory::exist($galleryPath)) { |
155 | - $originImages = File::listFiles($galleryPath . '/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
155 | + $originImages = File::listFiles($galleryPath.'/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
156 | 156 | // generate poster data |
157 | 157 | if (Arr::in($this->_content->poster, $originImages)) { |
158 | 158 | // original poster |
159 | 159 | $posterName = $this->_content->poster; |
160 | - $this->posterFull = $galleryPath . '/orig/' . $posterName; |
|
160 | + $this->posterFull = $galleryPath.'/orig/'.$posterName; |
|
161 | 161 | if (!File::exist($this->posterFull)) { |
162 | 162 | $this->posterFull = null; |
163 | 163 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $posterSplit = explode('.', $posterName); |
167 | 167 | array_pop($posterSplit); |
168 | 168 | $posterCleanName = implode('.', $posterSplit); |
169 | - $this->posterThumb = $galleryPath . '/thumb/' . $posterCleanName . '.jpg'; |
|
169 | + $this->posterThumb = $galleryPath.'/thumb/'.$posterCleanName.'.jpg'; |
|
170 | 170 | if (!File::exist($this->posterThumb)) { |
171 | 171 | $this->posterThumb = null; |
172 | 172 | } |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | continue; |
183 | 183 | } |
184 | 184 | |
185 | - $thumbPath = $galleryPath . '/thumb/' . $imageClearName . '.jpg'; |
|
185 | + $thumbPath = $galleryPath.'/thumb/'.$imageClearName.'.jpg'; |
|
186 | 186 | if (File::exist($thumbPath)) { |
187 | - $this->galleryItems[$thumbPath] = $galleryPath . '/orig/' . $image; |
|
187 | + $this->galleryItems[$thumbPath] = $galleryPath.'/orig/'.$image; |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $record = new UserRecord(); |
29 | 29 | |
30 | 30 | // set current page num and offset |
31 | - $page = (int)$this->request->query->get('page', 0); |
|
31 | + $page = (int) $this->request->query->get('page', 0); |
|
32 | 32 | $offset = $page * self::ITEM_PER_PAGE; |
33 | 33 | |
34 | 34 | // build pagination object |