@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | foreach ($this->users as $user) { |
| 80 | 80 | $uid = $user->id; |
| 81 | 81 | // delete whole website info for this user |
| 82 | - if ((bool)$this->delete) { |
|
| 82 | + if ((bool) $this->delete) { |
|
| 83 | 83 | $model = new FormUserClear($user); |
| 84 | 84 | $model->comments = true; |
| 85 | 85 | $model->content = true; |
@@ -89,10 +89,10 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // delete avatars |
| 92 | - File::remove('/upload/user/avatar/big/' . $uid . '.jpg'); |
|
| 93 | - File::remove('/upload/user/avatar/medium/' . $uid . '.jpg'); |
|
| 94 | - File::remove('/upload/user/avatar/small/' . $uid . '.jpg'); |
|
| 95 | - File::remove('/upload/user/avatar/original/' . $uid . '.jpg'); |
|
| 92 | + File::remove('/upload/user/avatar/big/'.$uid.'.jpg'); |
|
| 93 | + File::remove('/upload/user/avatar/medium/'.$uid.'.jpg'); |
|
| 94 | + File::remove('/upload/user/avatar/small/'.$uid.'.jpg'); |
|
| 95 | + File::remove('/upload/user/avatar/original/'.$uid.'.jpg'); |
|
| 96 | 96 | // delete user profile and auth data |
| 97 | 97 | $user->profile()->delete(); |
| 98 | 98 | // delete user provider data |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | if (!$this->_content->id) { |
| 67 | 67 | $this->_new = true; |
| 68 | 68 | if (!$this->galleryFreeId) { |
| 69 | - $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32)); |
|
| 69 | + $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32)); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if (!$this->authorId) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $this->categoryId = 1; |
| 78 | 78 | } |
| 79 | 79 | if (!$this->path) { |
| 80 | - $this->path = Integer::random(8) . '-' . date('d-m-Y'); |
|
| 80 | + $this->path = Integer::random(8).'-'.date('d-m-Y'); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if ($this->cloneId > 0) { |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | public function rules(): array |
| 116 | 116 | { |
| 117 | 117 | $res = [ |
| 118 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
| 119 | - ['text.' . App::$Request->getLanguage(), 'required'], |
|
| 118 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
| 119 | + ['text.'.App::$Request->getLanguage(), 'required'], |
|
| 120 | 120 | ['text', 'used'], |
| 121 | 121 | ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'], |
| 122 | 122 | [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title', 'important'], 'required'], |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | ]; |
| 130 | 130 | |
| 131 | 131 | foreach (App::$Properties->get('languages') as $lang) { |
| 132 | - $res[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
| 133 | - $res[] = ['keywords.' . $lang, 'length_max', 150]; |
|
| 134 | - $res[] = ['description.' . $lang, 'length_max', 250]; |
|
| 132 | + $res[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
| 133 | + $res[] = ['keywords.'.$lang, 'length_max', 150]; |
|
| 134 | + $res[] = ['description.'.$lang, 'length_max', 250]; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | return $res; |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | $this->_content->meta_keywords = $this->metaKeywords; |
| 188 | 188 | $this->_content->meta_description = $this->metaDescription; |
| 189 | 189 | $this->_content->source = $this->source; |
| 190 | - $this->_content->important = (int)$this->important; |
|
| 190 | + $this->_content->important = (int) $this->important; |
|
| 191 | 191 | // check if rating is changed |
| 192 | - if ((int)$this->addRating !== 0) { |
|
| 193 | - $this->_content->rating += (int)$this->addRating; |
|
| 192 | + if ((int) $this->addRating !== 0) { |
|
| 193 | + $this->_content->rating += (int) $this->addRating; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | // check if date is updated |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // save poster data |
| 202 | - $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster; |
|
| 202 | + $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster; |
|
| 203 | 203 | if (File::exist($posterPath)) { |
| 204 | 204 | $this->_content->poster = $this->poster; |
| 205 | 205 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | // move files |
| 236 | 236 | if ($tmpGalleryId !== $this->_content->id) { |
| 237 | - Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id); |
|
| 237 | + Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id); |
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
@@ -273,9 +273,9 @@ discard block |
||
| 273 | 273 | public function getUserIdName(): ?array |
| 274 | 274 | { |
| 275 | 275 | $users = []; |
| 276 | - User::with('profile')->get()->each(function ($user) use (&$users) { |
|
| 276 | + User::with('profile')->get()->each(function($user) use (&$users) { |
|
| 277 | 277 | /** @var User $user */ |
| 278 | - $users[$user->id] = ($user->profile->nick ?? 'id' . $user->id) . ' (' . $user->email . ')'; |
|
| 278 | + $users[$user->id] = ($user->profile->nick ?? 'id'.$user->id).' ('.$user->email.')'; |
|
| 279 | 279 | }); |
| 280 | 280 | |
| 281 | 281 | return $users; |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->withTrashed() |
| 32 | 32 | ->findOrNew($id); |
| 33 | 33 | $isNew = $record->id === null; |
| 34 | - $cloneId = (int)$this->request->query->get('from', 0); |
|
| 34 | + $cloneId = (int) $this->request->query->get('from', 0); |
|
| 35 | 35 | |
| 36 | 36 | // init model |
| 37 | 37 | $model = new FormContentUpdate($record, $cloneId); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | <?php if (\App::$Debug): ?> |
| 31 | 31 | <?= \App::$Debug->renderHead() ?> |
| 32 | 32 | <?php endif; ?> |
| 33 | - <?php if (!isset($fullgrid)){ $fullgrid = false; } ?> |
|
| 33 | + <?php if (!isset($fullgrid)) { $fullgrid = false; } ?> |
|
| 34 | 34 | </head> |
| 35 | 35 | <body class="bg-light"> |
| 36 | 36 | |
@@ -45,23 +45,23 @@ discard block |
||
| 45 | 45 | if (\App::$Properties->get('multiLanguage') && count(\App::$Properties->get('languages')) > 1) { |
| 46 | 46 | foreach (\App::$Properties->get('languages') as $lang) { |
| 47 | 47 | $navbar->menu('left', [ |
| 48 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
| 49 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
| 48 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
| 49 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
| 50 | 50 | 'html' => true |
| 51 | 51 | ]); |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | if (\App::$User->isAuth()) { |
| 55 | 55 | $userId = \App::$User->identity()->getId(); |
| 56 | - $navbar->menu('right', ['text' => __('Account') . ' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [ |
|
| 56 | + $navbar->menu('right', ['text' => __('Account').' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [ |
|
| 57 | 57 | ['text' => __('My profile'), 'link' => ['profile/show', [$userId]]], |
| 58 | - ['text' => __('Messages') . ' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true], |
|
| 58 | + ['text' => __('Messages').' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true], |
|
| 59 | 59 | ['text' => __('Feed'), 'link' => ['profile/feed'], 'class' => 'dropdown-item'], |
| 60 | - ['text' => __('Notifications') . ' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true], |
|
| 60 | + ['text' => __('Notifications').' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true], |
|
| 61 | 61 | ['text' => __('Settings'), 'link' => ['profile/settings'], 'class' => 'dropdown-item'], |
| 62 | 62 | ], 'properties' => ['html' => true]]); |
| 63 | 63 | if (\App::$User->identity()->role->can('Admin/Main/Index')) { |
| 64 | - $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl . '/admin']); |
|
| 64 | + $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl.'/admin']); |
|
| 65 | 65 | } |
| 66 | 66 | $navbar->menu('right', ['text' => __('Logout'), 'link' => ['user/logout']]); |
| 67 | 67 | } else { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | var script_lang = '<?= \App::$Request->getLanguage() ?>'; |
| 28 | 28 | var site_url = '<?= \App::$Alias->baseUrl ?>'; |
| 29 | 29 | </script> |
| 30 | - <?php if (!isset($fullgrid)){ $fullgrid = false; } ?> |
|
| 30 | + <?php if (!isset($fullgrid)) { $fullgrid = false; } ?> |
|
| 31 | 31 | </head> |
| 32 | 32 | |
| 33 | 33 | <body> |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | $list = $this->listing('ul', ['class' => 'list-inline']); |
| 45 | 45 | foreach (\App::$Properties->get('languages') as $lang) { |
| 46 | 46 | $list->li([ |
| 47 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
| 48 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
| 47 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
| 48 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
| 49 | 49 | 'html' => true |
| 50 | 50 | ], ['class' => 'list-inline-item']); |
| 51 | 51 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function __construct(ContentCategory $record, $dependId = null) |
| 37 | 37 | { |
| 38 | 38 | $this->_record = $record; |
| 39 | - $this->_tmpDependId = (int)$dependId; |
|
| 39 | + $this->_tmpDependId = (int) $dependId; |
|
| 40 | 40 | parent::__construct(); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | ]; |
| 114 | 114 | |
| 115 | 115 | // general category |
| 116 | - if (!$this->_new && (int)$this->_record->id === 1) { |
|
| 116 | + if (!$this->_new && (int) $this->_record->id === 1) { |
|
| 117 | 117 | $rules[] = ['path', 'used']; |
| 118 | 118 | } else { |
| 119 | 119 | $rules[] = ['path', 'required']; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/']; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $rules[] = ['title.' . App::$Request->getLanguage(), 'required']; |
|
| 125 | + $rules[] = ['title.'.App::$Request->getLanguage(), 'required']; |
|
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | return $rules; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $this->_record->title = $this->title; |
| 137 | 137 | $this->_record->description = $this->description; |
| 138 | - $savePath = trim($this->_pathNested . '/' . $this->path, '/'); |
|
| 138 | + $savePath = trim($this->_pathNested.'/'.$this->path, '/'); |
|
| 139 | 139 | $this->_record->path = $savePath; |
| 140 | 140 | $this->_record->configs = $this->configs; |
| 141 | 141 | $this->_record->save(); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | // build path with owner category |
| 171 | 171 | $this->_pathNested = $owner->path; |
| 172 | 172 | if (Str::length($this->_pathNested) > 0) { |
| 173 | - $path = $this->_pathNested . '/' . $path; |
|
| 173 | + $path = $this->_pathNested.'/'.$path; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | // make select for check |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ]); |
| 56 | 56 | |
| 57 | 57 | foreach ($records as $user) { |
| 58 | - $roleHtml = $user->role->color ? '<span class="badge badge-light" style="color: ' . $user->role->color . '">' . $user->role->name . '</span>' : $user->role->name; |
|
| 58 | + $roleHtml = $user->role->color ? '<span class="badge badge-light" style="color: '.$user->role->color.'">'.$user->role->name.'</span>' : $user->role->name; |
|
| 59 | 59 | |
| 60 | 60 | $btngrp = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm'], 4) |
| 61 | 61 | ->add('<i class="fa fa-pencil"></i>', ['user/update', [$user->id]], ['class' => 'btn btn-primary', 'html' => true]) |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ['text' => Date::convertToDatetime($user->created_at, Date::FORMAT_TO_DAY)], |
| 76 | 76 | ['text' => $btngrp->display(), |
| 77 | 77 | 'properties' => ['class' => 'text-center'], 'html' => true], |
| 78 | - 'properties' => ['class' => 'checkbox-row' . ($user->approve_token !== null ? ' bg-warning' : null)] |
|
| 78 | + 'properties' => ['class' => 'checkbox-row'.($user->approve_token !== null ? ' bg-warning' : null)] |
|
| 79 | 79 | |
| 80 | 80 | ]); |
| 81 | 81 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $records = CommentAnswer::with(['user', 'user.profile', 'user.role']) |
| 43 | 43 | ->where('comment_id', $commentId) |
| 44 | 44 | ->where('moderate', false); |
| 45 | - if ((bool)$configs['onlyLocale']) { |
|
| 45 | + if ((bool) $configs['onlyLocale']) { |
|
| 46 | 46 | $records = $records->where('lang', $this->request->getLanguage()); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | // get configs |
| 33 | 33 | $configs = AppRecord::getConfigs('widget', 'Comments'); |
| 34 | 34 | // items per page |
| 35 | - $perPage = (int)$configs['perPage']; |
|
| 35 | + $perPage = (int) $configs['perPage']; |
|
| 36 | 36 | // offset can be only integer |
| 37 | - $index = (int)$this->request->query->get('offset', 0); |
|
| 37 | + $index = (int) $this->request->query->get('offset', 0); |
|
| 38 | 38 | $offset = $perPage * $index; |
| 39 | 39 | |
| 40 | 40 | // select comments from db and check it |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ->where('moderate', false); |
| 44 | 44 | |
| 45 | 45 | // check if comments is depend of language locale |
| 46 | - if ((bool)$configs['onlyLocale']) { |
|
| 46 | + if ((bool) $configs['onlyLocale']) { |
|
| 47 | 47 | $query = $query->where('lang', $this->request->getLanguage()); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // build output json data as array |
| 65 | 65 | $data = []; |
| 66 | - $records->each(function ($comment) use (&$data){ |
|
| 66 | + $records->each(function($comment) use (&$data){ |
|
| 67 | 67 | $data[] = (new EntityCommentData($comment))->make(); |
| 68 | 68 | }); |
| 69 | 69 | |