@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ffcms\Core\App as MainApp; |
6 | 6 | use Ffcms\Core\Arch\ActiveModel; |
7 | 7 | use Ffcms\Core\Helper\Type\Arr; |
8 | -use Ffcms\Core\Helper\Type\Str; |
|
9 | 8 | |
10 | 9 | class Role extends ActiveModel |
11 | 10 | { |
@@ -26,12 +26,12 @@ |
||
26 | 26 | */ |
27 | 27 | public static function get($role_id) |
28 | 28 | { |
29 | - $role = MainApp::$Memory->get('user.role.cache.' . $role_id); |
|
29 | + $role = MainApp::$Memory->get('user.role.cache.'.$role_id); |
|
30 | 30 | |
31 | 31 | // not founded in cache |
32 | 32 | if ($role === null) { |
33 | 33 | $role = self::find($role_id); |
34 | - MainApp::$Memory->set('user.role.cache.' . $role_id, $role); |
|
34 | + MainApp::$Memory->set('user.role.cache.'.$role_id, $role); |
|
35 | 35 | } |
36 | 36 | return $role; |
37 | 37 | } |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Ffcms\Core\Helper\Date; |
10 | 10 | use Ffcms\Core\Helper\FileSystem\Directory; |
11 | 11 | use Ffcms\Core\Helper\FileSystem\File; |
12 | -use Ffcms\Core\Helper\Type\Integer; |
|
13 | 12 | use Ffcms\Core\Helper\Type\Obj; |
14 | 13 | use Ffcms\Core\Helper\Serialize; |
15 | 14 | use Ffcms\Core\Helper\Type\Str; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if ($this->_content->id === null) { |
52 | 52 | $this->_new = true; |
53 | 53 | if (null === $this->galleryFreeId) { |
54 | - $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32)); |
|
54 | + $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32)); |
|
55 | 55 | } |
56 | 56 | if (null === $this->authorId) { |
57 | 57 | $this->authorId = App::$User->identity()->getId(); |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function rules() |
83 | 83 | { |
84 | - $res = [ |
|
85 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
86 | - ['text.' . App::$Request->getLanguage(), 'required', null, true, true], |
|
84 | + $res = [ |
|
85 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
86 | + ['text.'.App::$Request->getLanguage(), 'required', null, true, true], |
|
87 | 87 | ['text', 'used', null, true, true], |
88 | 88 | ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'], |
89 | 89 | [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title'], 'required'], |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | ]; |
97 | 97 | |
98 | 98 | foreach (App::$Properties->get('languages') as $lang) { |
99 | - $res[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
100 | - $res[] = ['keywords.' . $lang, 'length_max', 150]; |
|
101 | - $res[] = ['description.' . $lang, 'length_max', 250]; |
|
99 | + $res[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
100 | + $res[] = ['keywords.'.$lang, 'length_max', 150]; |
|
101 | + $res[] = ['description.'.$lang, 'length_max', 250]; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | return $res; |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | $this->_content->meta_description = Serialize::encode(App::$Security->strip_tags($this->metaDescription)); |
143 | 143 | $this->_content->source = App::$Security->strip_tags($this->source); |
144 | 144 | // check if rating is changed |
145 | - if ((int)$this->addRating !== 0) { |
|
146 | - $this->_content->rating += (int)$this->addRating; |
|
145 | + if ((int) $this->addRating !== 0) { |
|
146 | + $this->_content->rating += (int) $this->addRating; |
|
147 | 147 | } |
148 | 148 | // check if special comment hash is exist |
149 | 149 | if ($this->_new || Str::length($this->_content->comment_hash) < 32) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | // save poster data |
158 | - $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster; |
|
158 | + $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster; |
|
159 | 159 | if (File::exist($posterPath)) { |
160 | 160 | $this->_content->poster = $this->poster; |
161 | 161 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | // move files |
170 | 170 | if ($tmpGalleryId !== $this->_content->id) { |
171 | - Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id); |
|
171 | + Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $data = ContentCategory::getSortedCategories(); |
182 | 182 | $response = []; |
183 | 183 | foreach ($data as $key=>$val) { |
184 | - $response[] = (string)$key; |
|
184 | + $response[] = (string) $key; |
|
185 | 185 | } |
186 | 186 | return $response; |
187 | 187 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | if ($this->newpassword !== null && Str::length($this->newpassword) >= 3) { |
99 | 99 | $this->_user->password = App::$Security->password_hash($this->newpassword); |
100 | 100 | } |
101 | - } elseif($property === 'approve_token') { |
|
101 | + } elseif ($property === 'approve_token') { |
|
102 | 102 | if ($value == "1") { |
103 | 103 | $this->_user->approve_token = '0'; |
104 | 104 | } else { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | public function save() |
53 | 53 | { |
54 | 54 | // check if target is myself or always exist in block list |
55 | - if ($this->_user->getId() === (int)$this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
55 | + if ($this->_user->getId() === (int) $this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
56 | 56 | return false; |
57 | 57 | } |
58 | 58 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | [['text' => __('Name')], ['text' => $app->getLocaleName()]], |
32 | 32 | [['text' => __('System name')], ['text' => $app->sys_name]], |
33 | 33 | [['text' => __('Last update')], ['text' => Date::convertToDatetime($app->updated_at, DATE::FORMAT_TO_SECONDS)]], |
34 | - [['text' => __('Status')], ['text' => ((int)$app->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' => ((int)$app->disabled === 0) ? 'alert-success' : 'alert-danger']] |
|
34 | + [['text' => __('Status')], ['text' => ((int) $app->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' => ((int) $app->disabled === 0) ? 'alert-success' : 'alert-danger']] |
|
35 | 35 | ] |
36 | 36 | ] |
37 | 37 | ]); ?> |
@@ -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 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 0 => 'global/write', |
5 | 5 | 1 => 'global/modify', |
6 | 6 | 2 => 'global/file', |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Ffcms\Core\App; |
6 | 6 | use Ffcms\Core\Arch\Model; |
7 | -use Ffcms\Core\Helper\Type\Obj; |
|
8 | 7 | use Ffcms\Core\Helper\Type\Str; |
9 | 8 | use Ffcms\Core\Interfaces\iUser; |
10 | 9 |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ]; |
108 | 108 | |
109 | 109 | // general category |
110 | - if ($this->_new === false && (int)$this->_record->id === 1) { |
|
110 | + if ($this->_new === false && (int) $this->_record->id === 1) { |
|
111 | 111 | $rules[] = ['path', 'used']; |
112 | 112 | } else { |
113 | 113 | $rules[] = ['path', 'required']; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/']; |
117 | 117 | } |
118 | 118 | |
119 | - $rules[] = ['title.' . App::$Request->getLanguage(), 'required']; |
|
119 | + $rules[] = ['title.'.App::$Request->getLanguage(), 'required']; |
|
120 | 120 | |
121 | 121 | |
122 | 122 | return $rules; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | $this->_record->title = Serialize::encode(App::$Security->strip_tags($this->title)); |
131 | 131 | $this->_record->description = Serialize::encode(App::$Security->strip_tags($this->description)); |
132 | - $savePath = trim($this->_pathNested . '/' . $this->path, '/'); |
|
132 | + $savePath = trim($this->_pathNested.'/'.$this->path, '/'); |
|
133 | 133 | $this->_record->path = $savePath; |
134 | 134 | $this->_record->configs = Serialize::encode($this->configs); |
135 | 135 | $this->_record->save(); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | // build path with owner category |
165 | 165 | $this->_pathNested = $owner->path; |
166 | 166 | if (Str::length($this->_pathNested) > 0) { |
167 | - $path = $this->_pathNested . '/' . $path; |
|
167 | + $path = $this->_pathNested.'/'.$path; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | // make select for check |
@@ -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 |