@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | } |
| 31 | 31 | // don't use breadcrumbs on injected pathway rule |
| 32 | 32 | $breadcrumbs = null; |
| 33 | -if (!\App::$Request->isPathInjected() && (bool)$model->getCategory()->getProperty('showCategory')) { |
|
| 33 | +if (!\App::$Request->isPathInjected() && (bool) $model->getCategory()->getProperty('showCategory')) { |
|
| 34 | 34 | $breadcrumbs = [ |
| 35 | 35 | Url::to('/') => __('Home') |
| 36 | 36 | ]; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $breadcrumbs[Url::to('content/list', [$cat['path']])] = $cat['name']; |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | - $breadcrumbs[] = __('Content') . ': ' . Str::sub($title, 0, 40); |
|
| 45 | + $breadcrumbs[] = __('Content').': '.Str::sub($title, 0, 40); |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | ]); |
| 56 | 56 | |
| 57 | 57 | $properties = [ |
| 58 | - 'date' => (bool)$model->getCategory()->getProperty('showDate'), |
|
| 59 | - 'author' => (bool)$model->getCategory()->getProperty('showAuthor'), |
|
| 60 | - 'views' => (bool)$model->getCategory()->getProperty('showViews'), |
|
| 61 | - 'category' => (bool)$model->getCategory()->getProperty('showCategory'), |
|
| 62 | - 'rating' => (bool)$model->getCategory()->getProperty('showRating'), |
|
| 63 | - 'tags' => (bool)$model->getCategory()->getProperty('showTags') |
|
| 58 | + 'date' => (bool) $model->getCategory()->getProperty('showDate'), |
|
| 59 | + 'author' => (bool) $model->getCategory()->getProperty('showAuthor'), |
|
| 60 | + 'views' => (bool) $model->getCategory()->getProperty('showViews'), |
|
| 61 | + 'category' => (bool) $model->getCategory()->getProperty('showCategory'), |
|
| 62 | + 'rating' => (bool) $model->getCategory()->getProperty('showRating'), |
|
| 63 | + 'tags' => (bool) $model->getCategory()->getProperty('showTags') |
|
| 64 | 64 | ]; |
| 65 | -$showComments = (bool)$model->getCategory()->getProperty('showComments'); |
|
| 66 | -$showPoster = (bool)$model->getCategory()->getProperty('showPoster'); |
|
| 65 | +$showComments = (bool) $model->getCategory()->getProperty('showComments'); |
|
| 66 | +$showPoster = (bool) $model->getCategory()->getProperty('showPoster'); |
|
| 67 | 67 | ?> |
| 68 | 68 | |
| 69 | 69 | <?php $this->push('css') ?> |
@@ -75,24 +75,24 @@ discard block |
||
| 75 | 75 | <h1><?= $model->title ?></h1> |
| 76 | 76 | <?php if (Arr::in(true, $properties)): ?> |
| 77 | 77 | <div class="meta"> |
| 78 | - <?php if ((bool)$properties['category']): ?> |
|
| 78 | + <?php if ((bool) $properties['category']): ?> |
|
| 79 | 79 | <span class="spaced"><i class="fa fa-list"></i> <?= Url::a(['content/list', [$model->catPath]], $model->catName, ['itemprop' => 'genre']) ?></span> |
| 80 | 80 | <?php endif; ?> |
| 81 | - <?php if ((bool)$properties['date']): ?> |
|
| 81 | + <?php if ((bool) $properties['date']): ?> |
|
| 82 | 82 | <span class="spaced"><i class="fa fa-calendar"></i> <time datetime="<?= date('c', Date::convertToTimestamp($model->getRecord()->created_at)) ?> itemprop="datePublished"><?= $model->createDate ?></time></span> |
| 83 | 83 | <?php endif; ?> |
| 84 | - <?php if ((bool)$properties['author']): ?> |
|
| 84 | + <?php if ((bool) $properties['author']): ?> |
|
| 85 | 85 | <?php if ($model->authorId && $model->authorId > 0): ?> |
| 86 | 86 | <span class="spaced"><i class="fa fa-user"></i> <?= Url::a(['profile/show', [$model->authorId]], $model->authorName, ['itemprop' => 'author']) ?></span> |
| 87 | 87 | <?php else: ?> |
| 88 | 88 | <span class="spaced"><i class="fa fa-user"></i> <s><?= $model->authorName ?></s></span> |
| 89 | 89 | <?php endif; ?> |
| 90 | 90 | <?php endif; ?> |
| 91 | - <?php if ((bool)$properties['views']): ?> |
|
| 91 | + <?php if ((bool) $properties['views']): ?> |
|
| 92 | 92 | <span class="spaced"><i class="fa fa-eye"></i> <?= $model->views ?></span> |
| 93 | 93 | <?php endif ?> |
| 94 | 94 | <?php if (\App::$User->isAuth() && \App::$User->identity()->role->can('Admin/Content/Update')): ?> |
| 95 | - <span class="float-right"><a href="<?= \App::$Alias->scriptUrl . '/admin/content/update/' . $model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
| 95 | + <span class="float-right"><a href="<?= \App::$Alias->scriptUrl.'/admin/content/update/'.$model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
| 96 | 96 | <?php endif; ?> |
| 97 | 97 | </div> |
| 98 | 98 | <?php else: ?> |
@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | <div id="content-text"> |
| 110 | 110 | <?php if ($showPoster === true && $model->posterFull && $model->posterThumb): ?> |
| 111 | 111 | <a href="<?= $model->posterFull ?>" data-fancybox="image"> |
| 112 | - <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase($model->title) ?>" src="<?= \App::$Alias->scriptUrl . $model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
| 112 | + <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase($model->title) ?>" src="<?= \App::$Alias->scriptUrl.$model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
| 113 | 113 | </a> |
| 114 | - <?php endif ;?> |
|
| 114 | + <?php endif; ?> |
|
| 115 | 115 | <?= $model->text ?> |
| 116 | 116 | </div> |
| 117 | 117 | </div> |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | <?php foreach ($model->galleryItems as $thumb => $full): ?> |
| 122 | 122 | <div class="col-6 col-lg-4 mt-2"> |
| 123 | 123 | <figure> |
| 124 | - <a class="d-block mb-4" data-fancybox="images" href="<?= \App::$Alias->scriptUrl . $full ?>"> |
|
| 125 | - <img class="img-fluid" src="<?= \App::$Alias->scriptUrl . $thumb ?>" alt="gallery image"> |
|
| 124 | + <a class="d-block mb-4" data-fancybox="images" href="<?= \App::$Alias->scriptUrl.$full ?>"> |
|
| 125 | + <img class="img-fluid" src="<?= \App::$Alias->scriptUrl.$thumb ?>" alt="gallery image"> |
|
| 126 | 126 | </a> |
| 127 | 127 | </figure> |
| 128 | 128 | </div> |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | </div> |
| 145 | 145 | <div id="similar-collapse-<?= $item['id'] ?>" class="collapse" aria-labelledby="similar-heading-<?= $item['id'] ?>" data-parent="#accordion-similar-group"> |
| 146 | 146 | <div class="card-body"> |
| 147 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>"> |
|
| 147 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>"> |
|
| 148 | 148 | <?= $item['snippet'] ?> |
| 149 | 149 | </a> |
| 150 | 150 | </div> |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | echo '<i class="fa fa-tags"></i> '; |
| 176 | 176 | foreach ($model->metaKeywords as $tag) { |
| 177 | 177 | $tag = trim($tag); |
| 178 | - echo Url::a(['content/tag', [urlencode($tag)]], $tag, ['class' => 'badge badge-secondary']) . " "; |
|
| 178 | + echo Url::a(['content/tag', [urlencode($tag)]], $tag, ['class' => 'badge badge-secondary'])." "; |
|
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | ?> |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | <h1><?= __('Feedback list') ?></h1> |
| 26 | 26 | <?php |
| 27 | 27 | if (!$records || $records->count() < 1) { |
| 28 | - echo '<p class="alert alert-warning">' . __('Feedback requests is empty now!') . '</p>'; |
|
| 28 | + echo '<p class="alert alert-warning">'.__('Feedback requests is empty now!').'</p>'; |
|
| 29 | 29 | $this->stop(); |
| 30 | 30 | return; |
| 31 | 31 | } |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | foreach ($records as $item) { |
| 46 | 46 | /** @var \Apps\ActiveRecord\FeedbackPost $item*/ |
| 47 | 47 | $table->row([ |
| 48 | - ['text' => $item->id . (!$item->readed ? ' <i class="fa fa-bell alert-info"></i>' : null) . ($item->closed ? ' <i class="fa fa-eye-slash alert-danger"></i>' : null), 'html' => true], |
|
| 48 | + ['text' => $item->id.(!$item->readed ? ' <i class="fa fa-bell alert-info"></i>' : null).($item->closed ? ' <i class="fa fa-eye-slash alert-danger"></i>' : null), 'html' => true], |
|
| 49 | 49 | ['text' => Url::a(['feedback/read', [$item->id]], Text::snippet($item->message, 40)), 'html' => true], |
| 50 | - ['text' => '<span class="badge badge-light">' . $item->answers->count() . '</span>', 'html' => true], |
|
| 50 | + ['text' => '<span class="badge badge-light">'.$item->answers->count().'</span>', 'html' => true], |
|
| 51 | 51 | ['text' => $item->email], |
| 52 | - ['text' => (bool)$item->closed ? '<span class="badge badge-danger">' . __('Closed') . '</span>' : '<span class="label label-success">' . __('Opened') . '</span>', 'html' => true, '!secure' => true], |
|
| 52 | + ['text' => (bool) $item->closed ? '<span class="badge badge-danger">'.__('Closed').'</span>' : '<span class="label label-success">'.__('Opened').'</span>', 'html' => true, '!secure' => true], |
|
| 53 | 53 | ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)], |
| 54 | 54 | ['text' => $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm', 'role' => 'group']) |
| 55 | 55 | ->add('<i class="fa fa-feed"></i>', ['feedback/read', [$item->id]], ['class' => 'btn btn-light', 'html' => true]) |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | <div class="text-right"><strong><?= __('Profile preview') ?></strong></div> |
| 38 | 38 | </div> |
| 39 | 39 | <div class="col-md-9"> |
| 40 | - <a href="<?= \App::$Alias->scriptUrl . '/profile/show/' . $model->_user->id ?>" target="_blank"><?= __('View profile on website') ?></a> |
|
| 40 | + <a href="<?= \App::$Alias->scriptUrl.'/profile/show/'.$model->_user->id ?>" target="_blank"><?= __('View profile on website') ?></a> |
|
| 41 | 41 | </div> |
| 42 | 42 | </div> |
| 43 | 43 | <div class="row mt-3 mb-3"> |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $index = implode('-', $this->_skip); |
| 63 | 63 | // try to get this slow query from cache |
| 64 | - $cache = App::$Cache->getItem('entity.content.search.index.' . $index); |
|
| 64 | + $cache = App::$Cache->getItem('entity.content.search.index.'.$index); |
|
| 65 | 65 | if (!$cache->isHit()) { |
| 66 | 66 | $cache->set($this->makeSearch()); |
| 67 | 67 | $cache->expiresAfter(static::CACHE_TIME); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'id' => $item->id, |
| 96 | 96 | 'title' => $item->getLocaled('title'), |
| 97 | 97 | 'snippet' => Text::snippet($text), |
| 98 | - 'uri' => '/content/read/' . $item->getPath(), |
|
| 98 | + 'uri' => '/content/read/'.$item->getPath(), |
|
| 99 | 99 | 'thumb' => $item->getPosterThumbUri() |
| 100 | 100 | ]; |
| 101 | 101 | } |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | $langMenu->menu([ |
| 52 | 52 | 'text' => Str::upperCase($lang), |
| 53 | 53 | 'tab' => function() use ($form, $lang) { |
| 54 | - return $form->fieldset()->text('title.' . $lang, null, __('Fill the title of the content for current language locale')) . |
|
| 55 | - '<strong>' . __('Content text') . '</strong><br />' . |
|
| 56 | - $form->field()->textarea('text.' . $lang, ['class' => 'form-control wysiwyg', 'rows' => 7]); |
|
| 54 | + return $form->fieldset()->text('title.'.$lang, null, __('Fill the title of the content for current language locale')). |
|
| 55 | + '<strong>'.__('Content text').'</strong><br />'. |
|
| 56 | + $form->field()->textarea('text.'.$lang, ['class' => 'form-control wysiwyg', 'rows' => 7]); |
|
| 57 | 57 | }, |
| 58 | 58 | 'tabActive' => $lang === \App::$Request->getLanguage() |
| 59 | 59 | ]); |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | $langMenu->menu([ |
| 73 | 73 | 'text' => Str::upperCase($lang), |
| 74 | 74 | 'tab' => function() use ($form, $lang) { |
| 75 | - return $form->fieldset()->text('metaTitle.' . $lang, null, __('Set meta title for content page (displayed in browser head). Recommended length: 50-70 chars')). |
|
| 76 | - $form->fieldset()->text('metaKeywords.' . $lang, ['class' => 'tag-selectize'], __('Set meta keywords for this content (for search engine crawlers) separated by comma')). |
|
| 77 | - $form->fieldset()->text('metaTitle.' . $lang, null, __('Set meta description for this content (for search engine crawlers). Recommended length: 200-250 chars')); |
|
| 75 | + return $form->fieldset()->text('metaTitle.'.$lang, null, __('Set meta title for content page (displayed in browser head). Recommended length: 50-70 chars')). |
|
| 76 | + $form->fieldset()->text('metaKeywords.'.$lang, ['class' => 'tag-selectize'], __('Set meta keywords for this content (for search engine crawlers) separated by comma')). |
|
| 77 | + $form->fieldset()->text('metaTitle.'.$lang, null, __('Set meta description for this content (for search engine crawlers). Recommended length: 200-250 chars')); |
|
| 78 | 78 | }, |
| 79 | 79 | 'tabActive' => $lang === \App::$Request->getLanguage() |
| 80 | 80 | ]); |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | <div class="dropzone dropzone-previews" id="ffcms-dropzone"></div> |
| 93 | 93 | </div> |
| 94 | 94 | <div class="col-md-4"> |
| 95 | - ' . $form->fieldset()->select('poster', ['options' => [__('Not selected...')]], __("Select image from gallery as a poster for this content")) . ' |
|
| 95 | + ' . $form->fieldset()->select('poster', ['options' => [__('Not selected...')]], __("Select image from gallery as a poster for this content")).' |
|
| 96 | 96 | </div> |
| 97 | 97 | </div><br/><br/>'; |
| 98 | 98 | }]) |
| 99 | 99 | ->menu(['text' => __('Other'), 'tab' => function() use ($form, $model) { |
| 100 | - return $form->fieldset()->boolean('display', null, __('Can users view this content or only available for administrators?')) . |
|
| 101 | - $form->fieldset()->boolean('important', null, __('Make this material important and stack it on top of all news?')) . |
|
| 102 | - $form->fieldset()->text('createdAt', ['class' => 'form-control datepick'], __('Set the date of creation or leave empty for current date')) . |
|
| 103 | - $form->fieldset()->select('authorId', ['options' => $model->getUserIdName(), 'optionsKey' => true, 'class' => 'selectize-option'], __('Enter author user_id or leave empty to set current user as author')) . |
|
| 104 | - $form->fieldset()->text('source', null, __('Set source URL if this content is copied from another website')) . |
|
| 100 | + return $form->fieldset()->boolean('display', null, __('Can users view this content or only available for administrators?')). |
|
| 101 | + $form->fieldset()->boolean('important', null, __('Make this material important and stack it on top of all news?')). |
|
| 102 | + $form->fieldset()->text('createdAt', ['class' => 'form-control datepick'], __('Set the date of creation or leave empty for current date')). |
|
| 103 | + $form->fieldset()->select('authorId', ['options' => $model->getUserIdName(), 'optionsKey' => true, 'class' => 'selectize-option'], __('Enter author user_id or leave empty to set current user as author')). |
|
| 104 | + $form->fieldset()->text('source', null, __('Set source URL if this content is copied from another website')). |
|
| 105 | 105 | $form->fieldset()->text('addRating', null, __('Add or reduce this content rating. Example: 5 gives +5 to total rating, -5 gives -5 to total')); |
| 106 | 106 | }]); |
| 107 | 107 | |
@@ -128,11 +128,11 @@ discard block |
||
| 128 | 128 | ['text' => $comment->id], |
| 129 | 129 | ['text' => Text::snippet(\App::$Security->strip_tags($comment->message), 100)], |
| 130 | 130 | ['text' => $comment->getAnswerCount()], |
| 131 | - ['text' => Url::a(['user/update', [$comment->user_id]], ($comment->user->profile->nick ?? 'id' . $comment->user->id)), 'html' => true], |
|
| 131 | + ['text' => Url::a(['user/update', [$comment->user_id]], ($comment->user->profile->nick ?? 'id'.$comment->user->id)), 'html' => true], |
|
| 132 | 132 | ['text' => $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm']) |
| 133 | 133 | ->add('<i class="fa fa-pencil"></i>', ['comments/read', [$comment->id]], ['html' => true, 'class' => 'btn btn-primary', 'target' => '_blank']) |
| 134 | 134 | ->add('<i class="fa fa-trash-o"></i>', ['comments/delete', ['comment', $comment->id]], ['html' => true, 'class' => 'btn btn-danger', 'target' => '_blank']) |
| 135 | - ->display(),'properties' => ['class' => 'text-center'], 'html' => true |
|
| 135 | + ->display(), 'properties' => ['class' => 'text-center'], 'html' => true |
|
| 136 | 136 | ] |
| 137 | 137 | ]); |
| 138 | 138 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | var DropzoneFiles = []; |
| 239 | 239 | $('#ffcms-dropzone').dropzone({ |
| 240 | 240 | url: script_url + '/api/content/galleryupload/<?= $model->galleryFreeId ?>?lang=' + script_lang, |
| 241 | - dictDefaultMessage: '<?= __('Drop files here to upload in gallery') . '<br />' . __('(or click here)') ?>', |
|
| 241 | + dictDefaultMessage: '<?= __('Drop files here to upload in gallery').'<br />'.__('(or click here)') ?>', |
|
| 242 | 242 | acceptedFiles: ".jpeg,.jpg,.png,.gif,.webp", |
| 243 | 243 | addRemoveLinks: true, |
| 244 | 244 | removedfile: function (file) { // file remove click, lets try to remove file from server & make visual changes |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | <h1><?= __('Category list') ?></h1> |
| 26 | 26 | <div class="row"> |
| 27 | 27 | <div class="col-md-12"> |
| 28 | - <?= Url::a(['content/categoryupdate'], '<i class="fa fa-plus"></i> ' . __('Add category'), ['class' => 'btn btn-primary', 'html' => true]) ?> |
|
| 28 | + <?= Url::a(['content/categoryupdate'], '<i class="fa fa-plus"></i> '.__('Add category'), ['class' => 'btn btn-primary', 'html' => true]) ?> |
|
| 29 | 29 | </div> |
| 30 | 30 | </div> |
| 31 | 31 | <div class="table-responsive"> |
@@ -56,17 +56,17 @@ discard block |
||
| 56 | 56 | <tr> |
| 57 | 57 | <td> |
| 58 | 58 | <div class="row"> |
| 59 | - <div class="d-none d-md-block col-md-<?= $offset ?> col-xs-<?= $offset+2 ?> " style="border-bottom: 2px solid #8a8a8a;height: 1px;padding-top: 10px;"></div> |
|
| 60 | - <div class="col-md-<?= $set ?> col-xs-<?= $set-2 ?>"> |
|
| 59 | + <div class="d-none d-md-block col-md-<?= $offset ?> col-xs-<?= $offset + 2 ?> " style="border-bottom: 2px solid #8a8a8a;height: 1px;padding-top: 10px;"></div> |
|
| 60 | + <div class="col-md-<?= $set ?> col-xs-<?= $set - 2 ?>"> |
|
| 61 | 61 | <?= $row->getLocaled('title') ?> |
| 62 | 62 | <sup>id: <?= $row->id ?></sup> |
| 63 | - <a href="<?= \App::$Alias->scriptUrl . '/content/list/' . $row->path ?>" target="_blank" class="badge badge-secondary">/<?= $row->path ?></a> |
|
| 63 | + <a href="<?= \App::$Alias->scriptUrl.'/content/list/'.$row->path ?>" target="_blank" class="badge badge-secondary">/<?= $row->path ?></a> |
|
| 64 | 64 | </div> |
| 65 | 65 | </div> |
| 66 | 66 | </td> |
| 67 | 67 | <td class="text-center"> |
| 68 | 68 | <?php $btn = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm', 'dropdown' => ['class' => 'btn-group btn-group-sm'], 'role' => 'group'], 4) |
| 69 | - ->add('<i class="fa fa-eye"></i>', [\App::$Alias->scriptUrl . '/content/list/' . $row->path], ['html' => true, 'target' => '_blank']) |
|
| 69 | + ->add('<i class="fa fa-eye"></i>', [\App::$Alias->scriptUrl.'/content/list/'.$row->path], ['html' => true, 'target' => '_blank']) |
|
| 70 | 70 | ->add('<i class="fa fa-plus"></i>', ['content/categoryupdate', null, ['parent' => $row->id]], ['class' => 'btn btn-success', 'data-toggle' => 'tooltip', 'title' => __('Add subcategory'), 'html' => true]) |
| 71 | 71 | ->add('<i class="fa fa-cog"></i>', ['content/categoryupdate', [$row->id]], ['class' => 'btn btn-primary', 'data-toggle' => 'tooltip', 'title' => __('Category configurations'), 'html' => true]); |
| 72 | 72 | if ($row->id > 1) { |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function make() |
| 72 | 72 | { |
| 73 | - if ((bool)$this->comments) { |
|
| 73 | + if ((bool) $this->comments) { |
|
| 74 | 74 | CommentPost::where('user_id', $this->_user->id)->delete(); |
| 75 | 75 | CommentAnswer::where('user_id', $this->_user->id)->delete(); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if ((bool)$this->content) { |
|
| 78 | + if ((bool) $this->content) { |
|
| 79 | 79 | $contents = Content::where('author_id', $this->_user->id); |
| 80 | 80 | $ids = $contents->pluck('id')->toArray(); |
| 81 | 81 | if ($ids && count($ids) > 0) { |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if ((bool)$this->feedback) { |
|
| 88 | + if ((bool) $this->feedback) { |
|
| 89 | 89 | FeedbackPost::where('user_id', $this->_user->id) |
| 90 | 90 | ->update(['readed' => true, 'closed' => true]); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if ((bool)$this->wall) { |
|
| 93 | + if ((bool) $this->wall) { |
|
| 94 | 94 | WallPost::where('sender_id', $this->_user->id)->delete(); |
| 95 | 95 | WallAnswer::where('user_id', $this->_user->id)->delete(); |
| 96 | 96 | } |
@@ -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; |