@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | ]; |
| 113 | 113 | |
| 114 | 114 | // general category |
| 115 | - if ($this->_new === false && (int)$this->_record->id === 1) { |
|
| 115 | + if ($this->_new === false && (int) $this->_record->id === 1) { |
|
| 116 | 116 | $rules[] = ['path', 'used']; |
| 117 | 117 | } else { |
| 118 | 118 | $rules[] = ['path', 'required']; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/']; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $rules[] = ['title.' . App::$Request->getLanguage(), 'required']; |
|
| 124 | + $rules[] = ['title.'.App::$Request->getLanguage(), 'required']; |
|
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | return $rules; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | $this->_record->title = $this->title; |
| 136 | 136 | $this->_record->description = $this->description; |
| 137 | - $savePath = trim($this->_pathNested . '/' . $this->path, '/'); |
|
| 137 | + $savePath = trim($this->_pathNested.'/'.$this->path, '/'); |
|
| 138 | 138 | $this->_record->path = $savePath; |
| 139 | 139 | $this->_record->configs = $this->configs; |
| 140 | 140 | $this->_record->save(); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | // build path with owner category |
| 170 | 170 | $this->_pathNested = $owner->path; |
| 171 | 171 | if (Str::length($this->_pathNested) > 0) { |
| 172 | - $path = $this->_pathNested . '/' . $path; |
|
| 172 | + $path = $this->_pathNested.'/'.$path; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | // make select for check |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // get all depended category ids |
| 83 | - $cats = ContentCategory::where('path', 'like', $this->_record->path . '%')->get(['id'])->toArray(); |
|
| 83 | + $cats = ContentCategory::where('path', 'like', $this->_record->path.'%')->get(['id'])->toArray(); |
|
| 84 | 84 | $allCategoryIds = Arr::pluck('id', $cats); |
| 85 | 85 | |
| 86 | 86 | // update category_id in content |
@@ -30,8 +30,8 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function before() |
| 32 | 32 | { |
| 33 | - $this->count = (int)$this->_configs['count']; |
|
| 34 | - $this->cache = (int)$this->_configs['cache']; |
|
| 33 | + $this->count = (int) $this->_configs['count']; |
|
| 34 | + $this->cache = (int) $this->_configs['cache']; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $status = $this->_record->disabled; |
| 32 | 32 | |
| 33 | - $this->_record->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 33 | + $this->_record->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 34 | 34 | $this->_record->save(); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -31,9 +31,9 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function before() |
| 33 | 33 | { |
| 34 | - $this->snippet = (int)$this->_configs['snippet']; |
|
| 35 | - $this->count = (int)$this->_configs['count']; |
|
| 36 | - $this->cache = (int)$this->_configs['cache']; |
|
| 34 | + $this->snippet = (int) $this->_configs['snippet']; |
|
| 35 | + $this->count = (int) $this->_configs['count']; |
|
| 36 | + $this->cache = (int) $this->_configs['cache']; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -69,10 +69,10 @@ |
||
| 69 | 69 | ->orWhere('sender_id', '=', $uid) |
| 70 | 70 | ->delete(); |
| 71 | 71 | // delete avatars |
| 72 | - File::remove('/upload/user/avatar/big/' . $uid . '.jpg'); |
|
| 73 | - File::remove('/upload/user/avatar/medium/' . $uid . '.jpg'); |
|
| 74 | - File::remove('/upload/user/avatar/small/' . $uid . '.jpg'); |
|
| 75 | - File::remove('/upload/user/avatar/original/' . $uid . '.jpg'); |
|
| 72 | + File::remove('/upload/user/avatar/big/'.$uid.'.jpg'); |
|
| 73 | + File::remove('/upload/user/avatar/medium/'.$uid.'.jpg'); |
|
| 74 | + File::remove('/upload/user/avatar/small/'.$uid.'.jpg'); |
|
| 75 | + File::remove('/upload/user/avatar/original/'.$uid.'.jpg'); |
|
| 76 | 76 | // delete user profile and auth data |
| 77 | 77 | $user->profile()->delete(); |
| 78 | 78 | // delete user provider data |
@@ -36,8 +36,8 @@ |
||
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | $this->categories = $this->_configs['categories']; |
| 39 | - $this->count = (int)$this->_configs['count']; |
|
| 40 | - $this->cache = (int)$this->_configs['cache']; |
|
| 39 | + $this->count = (int) $this->_configs['count']; |
|
| 40 | + $this->cache = (int) $this->_configs['cache']; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | ?> |
| 5 | 5 | |
| 6 | -<?php if ((bool)$configs['guestAdd'] && (bool)$configs['guestModerate'] && !\App::$User->isAuth()): ?> |
|
| 6 | +<?php if ((bool) $configs['guestAdd'] && (bool) $configs['guestModerate'] && !\App::$User->isAuth()): ?> |
|
| 7 | 7 | <p class="alert alert-warning"><?= __('All guest comments will be moderated before display') ?></p> |
| 8 | 8 | <?php endif; ?> |
| 9 | 9 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | </a> |
| 36 | 36 | </i> |
| 37 | 37 | </div> |
| 38 | - <div id="comment-text" class="comment-text"><?= __('Loading') . ' ...' ?></div> |
|
| 38 | + <div id="comment-text" class="comment-text"><?= __('Loading').' ...' ?></div> |
|
| 39 | 39 | </div> |
| 40 | 40 | <div id="comment-answers-0" class="hidden"></div> |
| 41 | 41 | <div class="row hidden" id="add-replay-to"> |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | <span id="answer-date">00.00.00 00-00-00</span> |
| 59 | 59 | <span id="answer-user-name"><?= __('Unknown') ?></span>: |
| 60 | 60 | </div> |
| 61 | - <div id="answer-text" class="comment-text"><?= __('Loading') . ' ...' ?></div> |
|
| 61 | + <div id="answer-text" class="comment-text"><?= __('Loading').' ...' ?></div> |
|
| 62 | 62 | </div> |
| 63 | 63 | </li> |
| 64 | 64 | </ul> |
| 65 | 65 | |
| 66 | -<?php if ((int)$configs['guestAdd'] === 1 || \App::$User->isAuth()): ?> |
|
| 66 | +<?php if ((int) $configs['guestAdd'] === 1 || \App::$User->isAuth()): ?> |
|
| 67 | 67 | <!-- comment form --> |
| 68 | 68 | <form name="comment-add-form" action="" method="post" style="padding-top: 15px;" class="form-horizontal"> |
| 69 | 69 | <input type="hidden" name="replay-to" value="0" /> |
@@ -77,7 +77,8 @@ discard block |
||
| 77 | 77 | </div> |
| 78 | 78 | <?php if (\App::$Captcha->isFull()): ?> |
| 79 | 79 | <div class="col-md-offset-3 col-md-9"><?= \App::$Captcha->get() ?></div> |
| 80 | - <?php else: ?> |
|
| 80 | + <?php else { |
|
| 81 | + : ?> |
|
| 81 | 82 | <div class="form-group"> |
| 82 | 83 | <label for="guest-captcha" class="col-sm-3 control-label"><?= __('Captcha') ?>:</label> |
| 83 | 84 | <div class="col-sm-9"> |
@@ -85,7 +86,9 @@ discard block |
||
| 85 | 86 | <input id="guest-captcha" type="text" name="captcha" class="form-control" required> |
| 86 | 87 | </div> |
| 87 | 88 | </div> |
| 88 | - <?php endif; ?> |
|
| 89 | + <?php endif; |
|
| 90 | +} |
|
| 91 | +?> |
|
| 89 | 92 | <?php endif; ?> |
| 90 | 93 | <textarea class="form-control wysi-comments" name="message"></textarea> |
| 91 | 94 | </form> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | <ul class="list-inline list-info"> |
| 17 | 17 | <li><i class="glyphicon glyphicon-calendar"></i> <?= Date::humanize($comment['date']) ?></li> |
| 18 | 18 | <li><i class="glyphicon glyphicon-user"></i> |
| 19 | - <?php if ((int)$comment['user']['id'] > 0): ?> |
|
| 19 | + <?php if ((int) $comment['user']['id'] > 0): ?> |
|
| 20 | 20 | <?= Url::link(['profile/show', $comment['user']['id']], $comment['user']['name']) ?> |
| 21 | 21 | <?php else: ?> |
| 22 | 22 | <?= $comment['user']['name'] ?> |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | <img class="media-object img-responsive" src="<?= $comment['user']['avatar']?>" style="width: 64px; height: 64px;" alt="Picture of user <?= $comment['user']['name'] ?>"> |
| 30 | 30 | </span> |
| 31 | 31 | <div class="media-body"> |
| 32 | - <a href="<?= \App::$Alias->baseUrl . $comment['pathway'] . '#comment-list' ?>"> |
|
| 33 | - <?= Text::cut(\App::$Security->strip_tags($comment['text']), 0, $snippet) . '...' ?> |
|
| 32 | + <a href="<?= \App::$Alias->baseUrl.$comment['pathway'].'#comment-list' ?>"> |
|
| 33 | + <?= Text::cut(\App::$Security->strip_tags($comment['text']), 0, $snippet).'...' ?> |
|
| 34 | 34 | </a> |
| 35 | 35 | </div> |
| 36 | 36 | </li> |
@@ -18,9 +18,12 @@ |
||
| 18 | 18 | <li><i class="glyphicon glyphicon-user"></i> |
| 19 | 19 | <?php if ((int)$comment['user']['id'] > 0): ?> |
| 20 | 20 | <?= Url::link(['profile/show', $comment['user']['id']], $comment['user']['name']) ?> |
| 21 | - <?php else: ?> |
|
| 21 | + <?php else { |
|
| 22 | + : ?> |
|
| 22 | 23 | <?= $comment['user']['name'] ?> |
| 23 | - <?php endif; ?> |
|
| 24 | + <?php endif; |
|
| 25 | +} |
|
| 26 | +?> |
|
| 24 | 27 | </li> |
| 25 | 28 | </ul> |
| 26 | 29 | </li> |