@@ -3,9 +3,8 @@ |
||
| 3 | 3 | namespace Apps\Model\Front\Content; |
| 4 | 4 | |
| 5 | 5 | |
| 6 | -use Apps\ActiveRecord\Content; |
|
| 7 | -use Apps\ActiveRecord\ContentCategory; |
|
| 8 | 6 | use Apps\ActiveRecord\Content as ContentRecord; |
| 7 | +use Apps\ActiveRecord\ContentCategory; |
|
| 9 | 8 | use Apps\ActiveRecord\User; |
| 10 | 9 | use Ffcms\Core\App; |
| 11 | 10 | use Ffcms\Core\Arch\Model; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $this->_path = $path; |
| 55 | 55 | $this->_configs = $configs; |
| 56 | - $this->_page = (int)$offset; |
|
| 56 | + $this->_page = (int) $offset; |
|
| 57 | 57 | parent::__construct(); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function before() |
| 66 | 66 | { |
| 67 | 67 | // find one or more categories where we must looking for content items |
| 68 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
| 68 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
| 69 | 69 | $this->findCategories(); |
| 70 | 70 | } else { |
| 71 | 71 | $this->findCategory(); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | private function findCategories() |
| 103 | 103 | { |
| 104 | 104 | // get all categories for current path and child of it |
| 105 | - $query = ContentCategory::where('path', 'like', $this->_path . '%'); |
|
| 105 | + $query = ContentCategory::where('path', 'like', $this->_path.'%'); |
|
| 106 | 106 | if ($query->count() < 1) { |
| 107 | 107 | throw new NotFoundException(__('Category is not founded')); |
| 108 | 108 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // calculate selection offset |
| 138 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
| 138 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
| 139 | 139 | if ($itemPerPage < 1) { |
| 140 | 140 | $itemPerPage = 1; |
| 141 | 141 | } |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | { |
| 162 | 162 | // prepare rss url link for current category if enabled |
| 163 | 163 | $rssUrl = false; |
| 164 | - if ((int)$this->_configs['rss'] === 1) { |
|
| 165 | - $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path; |
|
| 164 | + if ((int) $this->_configs['rss'] === 1) { |
|
| 165 | + $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path; |
|
| 166 | 166 | $rssUrl = rtrim($rssUrl, '/'); |
| 167 | 167 | } |
| 168 | 168 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | ]; |
| 177 | 177 | |
| 178 | 178 | // check if this category is hidden |
| 179 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
| 179 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
| 180 | 180 | throw new ForbiddenException(__('This category is not available to view')); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | // check if current user can rate item |
| 223 | 223 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
| 224 | 224 | $canRate = true; |
| 225 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
| 225 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
| 226 | 226 | $canRate = false; |
| 227 | 227 | } |
| 228 | 228 | if (!App::$User->isAuth()) { |
@@ -239,11 +239,11 @@ discard block |
||
| 239 | 239 | 'poster' => $row->getPosterUri(), |
| 240 | 240 | 'thumb' => $row->getPosterThumbUri(), |
| 241 | 241 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
| 242 | - 'views' => (int)$row->views, |
|
| 243 | - 'rating' => (int)$row->rating, |
|
| 242 | + 'views' => (int) $row->views, |
|
| 243 | + 'rating' => (int) $row->rating, |
|
| 244 | 244 | 'canRate' => $canRate, |
| 245 | 245 | 'category' => $this->categories[$row->category_id], |
| 246 | - 'uri' => '/content/read/' . $itemPath, |
|
| 246 | + 'uri' => '/content/read/'.$itemPath, |
|
| 247 | 247 | 'tags' => $tags |
| 248 | 248 | ]; |
| 249 | 249 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | /** |
| 26 | 26 | * EntityContentSearch constructor. Pass search terms (query string) to model and used items to skip it by id. |
| 27 | 27 | * @param $terms |
| 28 | - * @param int|array $skipIds |
|
| 28 | + * @param integer $skipIds |
|
| 29 | 29 | */ |
| 30 | 30 | public function __construct($terms, $skipIds = 0) |
| 31 | 31 | { |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | $this->items[] = [ |
| 78 | 78 | 'title' => $item->getLocaled('title'), |
| 79 | 79 | 'snippet' => Text::snippet($text), |
| 80 | - 'uri' => '/content/read/' . $item->getPath(), |
|
| 80 | + 'uri' => '/content/read/'.$item->getPath(), |
|
| 81 | 81 | 'thumb' => $item->getPosterThumbUri() |
| 82 | 82 | ]; |
| 83 | 83 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php return [ |
| 2 | - 'Alias' => [ |
|
| 3 | - 'Front' => [ |
|
| 4 | - '/about' => '/content/read/page/about-page' |
|
| 5 | - ] |
|
| 6 | - ], |
|
| 7 | - 'Callback' => [ |
|
| 8 | - 'Front' => [ |
|
| 9 | - 'Demo' => '\Apps\Controller\Front\Main' |
|
| 10 | - ] |
|
| 11 | - ] |
|
| 2 | + 'Alias' => [ |
|
| 3 | + 'Front' => [ |
|
| 4 | + '/about' => '/content/read/page/about-page' |
|
| 5 | + ] |
|
| 6 | + ], |
|
| 7 | + 'Callback' => [ |
|
| 8 | + 'Front' => [ |
|
| 9 | + 'Demo' => '\Apps\Controller\Front\Main' |
|
| 10 | + ] |
|
| 11 | + ] |
|
| 12 | 12 | ]; |
| 13 | 13 | \ No newline at end of file |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Labels for form |
|
| 46 | - */ |
|
| 45 | + * Labels for form |
|
| 46 | + */ |
|
| 47 | 47 | public function labels() |
| 48 | 48 | { |
| 49 | 49 | return [ |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * Validation rules for comments settings |
|
| 61 | - */ |
|
| 60 | + * Validation rules for comments settings |
|
| 61 | + */ |
|
| 62 | 62 | public function rules() |
| 63 | 63 | { |
| 64 | 64 | return [ |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function check() |
| 57 | 57 | { |
| 58 | 58 | // check if user is auth'd or guest name is defined |
| 59 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 59 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 60 | 60 | throw new JsonException(__('Guest name is not defined')); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // check if message length is correct |
| 69 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
| 69 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
| 70 | 70 | throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [ |
| 71 | 71 | 'cur' => Str::length($this->message), |
| 72 | 72 | 'min' => $this->_configs['minLength'], |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function check() |
| 57 | 57 | { |
| 58 | 58 | // check if user is auth'd or guest name is defined |
| 59 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 59 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 60 | 60 | throw new JsonException(__('Guest name is not defined')); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // check if message length is correct |
| 69 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
| 69 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
| 70 | 70 | throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [ |
| 71 | 71 | 'cur' => Str::length($this->message), |
| 72 | 72 | 'min' => $this->_configs['minLength'], |
@@ -1,8 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Ffcms\Core\Helper\Date; |
|
| 4 | 3 | use Ffcms\Core\Helper\HTML\Form; |
| 5 | -use Ffcms\Core\Helper\HTML\Table; |
|
| 6 | 4 | use Ffcms\Core\Helper\Url; |
| 7 | 5 | |
| 8 | 6 | /** @var \Apps\Model\Admin\Feedback\FormUpdate $model */ |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * Labels to display edit form |
|
| 38 | - */ |
|
| 37 | + * Labels to display edit form |
|
| 38 | + */ |
|
| 39 | 39 | public function labels() |
| 40 | 40 | { |
| 41 | 41 | return [ |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Rules to validate changes |
|
| 50 | - */ |
|
| 49 | + * Rules to validate changes |
|
| 50 | + */ |
|
| 51 | 51 | public function rules() |
| 52 | 52 | { |
| 53 | 53 | return [ |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Labels for display form |
|
| 51 | - */ |
|
| 50 | + * Labels for display form |
|
| 51 | + */ |
|
| 52 | 52 | public function labels() |
| 53 | 53 | { |
| 54 | 54 | return [ |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * Form validation rules |
|
| 63 | - */ |
|
| 62 | + * Form validation rules |
|
| 63 | + */ |
|
| 64 | 64 | public function rules() |
| 65 | 65 | { |
| 66 | 66 | return [ |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function __construct($recordPost, $userId = 0) |
| 30 | 30 | { |
| 31 | 31 | $this->_post = $recordPost; |
| 32 | - $this->_userId = (int)$userId; |
|
| 32 | + $this->_userId = (int) $userId; |
|
| 33 | 33 | parent::__construct(); |
| 34 | 34 | } |
| 35 | 35 | |