@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if (!$this->_content->id) { |
65 | 65 | $this->_new = true; |
66 | 66 | if (!$this->galleryFreeId) { |
67 | - $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32)); |
|
67 | + $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | if (!$this->authorId) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $this->categoryId = 1; |
76 | 76 | } |
77 | 77 | if (!$this->path) { |
78 | - $this->path = Integer::random(8) . '-' . date('d-m-Y'); |
|
78 | + $this->path = Integer::random(8).'-'.date('d-m-Y'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | if ($this->cloneId > 0) { |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | public function rules(): array |
114 | 114 | { |
115 | 115 | $res = [ |
116 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
117 | - ['text.' . App::$Request->getLanguage(), 'required'], |
|
116 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
117 | + ['text.'.App::$Request->getLanguage(), 'required'], |
|
118 | 118 | ['text', 'used'], |
119 | 119 | ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'], |
120 | 120 | [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title', 'important'], 'required'], |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | ]; |
128 | 128 | |
129 | 129 | foreach (App::$Properties->get('languages') as $lang) { |
130 | - $res[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
131 | - $res[] = ['keywords.' . $lang, 'length_max', 150]; |
|
132 | - $res[] = ['description.' . $lang, 'length_max', 250]; |
|
130 | + $res[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
131 | + $res[] = ['keywords.'.$lang, 'length_max', 150]; |
|
132 | + $res[] = ['description.'.$lang, 'length_max', 250]; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return $res; |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | $this->_content->meta_keywords = $this->metaKeywords; |
186 | 186 | $this->_content->meta_description = $this->metaDescription; |
187 | 187 | $this->_content->source = $this->source; |
188 | - $this->_content->important = (int)$this->important; |
|
188 | + $this->_content->important = (int) $this->important; |
|
189 | 189 | // check if rating is changed |
190 | - if ((int)$this->addRating !== 0) { |
|
191 | - $this->_content->rating += (int)$this->addRating; |
|
190 | + if ((int) $this->addRating !== 0) { |
|
191 | + $this->_content->rating += (int) $this->addRating; |
|
192 | 192 | } |
193 | 193 | // check if special comment hash is exist |
194 | 194 | if ($this->_new || Str::length($this->_content->comment_hash) < 32) { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } |
202 | 202 | |
203 | 203 | // save poster data |
204 | - $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster; |
|
204 | + $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster; |
|
205 | 205 | if (File::exist($posterPath)) { |
206 | 206 | $this->_content->poster = $this->poster; |
207 | 207 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | // move files |
238 | 238 | if ($tmpGalleryId !== $this->_content->id) { |
239 | - Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id); |
|
239 | + Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id); |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 |