@@ -59,7 +59,7 @@ |
||
| 59 | 59 | * Get single row by defined type and sys_name with query caching |
| 60 | 60 | * @param string $type |
| 61 | 61 | * @param string $sys_name |
| 62 | - * @return mixed|null |
|
| 62 | + * @return App |
|
| 63 | 63 | * @throws SyntaxException |
| 64 | 64 | */ |
| 65 | 65 | public static function getItem($type, $sys_name) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | $scriptVersion = $this->getScriptVersion(); |
| 150 | 150 | |
| 151 | - return $scriptVersion === (float)$this->version; |
|
| 151 | + return $scriptVersion === (float) $this->version; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -157,16 +157,16 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function getScriptVersion() |
| 159 | 159 | { |
| 160 | - $class = 'Apps\Controller\Admin\\' . $this->sys_name; |
|
| 160 | + $class = 'Apps\Controller\Admin\\'.$this->sys_name; |
|
| 161 | 161 | if (!class_exists($class)) { |
| 162 | 162 | return false; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (!defined($class . '::VERSION')) { |
|
| 165 | + if (!defined($class.'::VERSION')) { |
|
| 166 | 166 | return false; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - return (float)constant($class . '::VERSION'); |
|
| 169 | + return (float) constant($class.'::VERSION'); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | } |
| 173 | 173 | \ No newline at end of file |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Apps\ActiveRecord\App as AppRecord; |
| 6 | 6 | use Ffcms\Core\Arch\Model; |
| 7 | 7 | use Ffcms\Core\Exception\ForbiddenException; |
| 8 | -use Ffcms\Core\Exception\NativeException; |
|
| 9 | 8 | use Ffcms\Core\Exception\NotFoundException; |
| 10 | 9 | use Ffcms\Core\Helper\Date; |
| 11 | 10 | |
@@ -28,8 +28,8 @@ |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * Magic method before |
|
| 32 | - */ |
|
| 31 | + * Magic method before |
|
| 32 | + */ |
|
| 33 | 33 | public function before() |
| 34 | 34 | { |
| 35 | 35 | // get full name of update object |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function before() |
| 34 | 34 | { |
| 35 | 35 | // get full name of update object |
| 36 | - $class = 'Apps\Controller\Admin\\' . $this->_record->sys_name; |
|
| 36 | + $class = 'Apps\Controller\Admin\\'.$this->_record->sys_name; |
|
| 37 | 37 | if (class_exists($class)) { |
| 38 | 38 | $this->_callback = $class; |
| 39 | 39 | } else { |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $status = $object->disabled; |
| 14 | 14 | |
| 15 | - $object->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 15 | + $object->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
| 16 | 16 | $object->save(); |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | [['text' => __('Name')], ['text' => $widget->getLocaleName()]], |
| 32 | 32 | [['text' => __('System name')], ['text' => $widget->sys_name]], |
| 33 | 33 | [['text' => __('Last update')], ['text' => Date::convertToDatetime($widget->updated_at, DATE::FORMAT_TO_SECONDS)]], |
| 34 | - [['text' => __('Status')], ['text' => ((int)$widget->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' => ((int)$widget->disabled === 0) ? 'alert-success' : 'alert-danger']] |
|
| 34 | + [['text' => __('Status')], ['text' => ((int) $widget->disabled === 0) ? 'On' : 'Off'], 'property' => ['class' => ((int) $widget->disabled === 0) ? 'alert-success' : 'alert-danger']] |
|
| 35 | 35 | ] |
| 36 | 36 | ] |
| 37 | 37 | ]); ?> |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $search = \Apps\ActiveRecord\App::getItem('app', $controller); |
| 72 | 72 | |
| 73 | 73 | // check what we got |
| 74 | - if ($search === null || (int)$search->id < 1) { |
|
| 74 | + if ($search === null || (int) $search->id < 1) { |
|
| 75 | 75 | throw new ForbiddenException('App is not founded'); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $search = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'app')->first(); |
| 98 | 98 | |
| 99 | - if ($search === null || (int)$search->id < 1) { |
|
| 99 | + if ($search === null || (int) $search->id < 1) { |
|
| 100 | 100 | throw new ForbiddenException('App is not founded'); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -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 |
@@ -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; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $this->_path = $path; |
| 58 | 58 | $this->_configs = $configs; |
| 59 | - $this->_page = (int)$offset; |
|
| 59 | + $this->_page = (int) $offset; |
|
| 60 | 60 | $this->_sort = $sort; |
| 61 | 61 | parent::__construct(); |
| 62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | public function before() |
| 70 | 70 | { |
| 71 | 71 | // find one or more categories where we must looking for content items |
| 72 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
| 72 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
| 73 | 73 | $this->findCategories(); |
| 74 | 74 | } else { |
| 75 | 75 | $this->findCategory(); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | private function findCategories() |
| 108 | 108 | { |
| 109 | 109 | // get all categories for current path and child of it |
| 110 | - $query = ContentCategory::where('path', 'like', $this->_path . '%'); |
|
| 110 | + $query = ContentCategory::where('path', 'like', $this->_path.'%'); |
|
| 111 | 111 | if ($query->count() < 1) { |
| 112 | 112 | throw new NotFoundException(__('Category is not founded')); |
| 113 | 113 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // calculate selection offset |
| 143 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
| 143 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
| 144 | 144 | if ($itemPerPage < 1) { |
| 145 | 145 | $itemPerPage = 1; |
| 146 | 146 | } |
@@ -178,15 +178,15 @@ discard block |
||
| 178 | 178 | $catConfigs = Serialize::decode($this->_currentCategory->configs); |
| 179 | 179 | // prepare rss url link for current category if enabled |
| 180 | 180 | $rssUrl = false; |
| 181 | - if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) { |
|
| 182 | - $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path; |
|
| 181 | + if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) { |
|
| 182 | + $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path; |
|
| 183 | 183 | $rssUrl = rtrim($rssUrl, '/'); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | // prepare sorting urls |
| 187 | 187 | $catSortParams = []; |
| 188 | 188 | if (App::$Request->query->get('page') !== null) { |
| 189 | - $catSortParams['page'] = (int)App::$Request->query->get('page'); |
|
| 189 | + $catSortParams['page'] = (int) App::$Request->query->get('page'); |
|
| 190 | 190 | } |
| 191 | 191 | $catSortUrls = [ |
| 192 | 192 | 'views' => Url::to('content/list', $this->_currentCategory->path, null, Arr::merge($catSortParams, ['sort' => 'views']), false), |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | ]; |
| 206 | 206 | |
| 207 | 207 | // check if this category is hidden |
| 208 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
| 208 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
| 209 | 209 | throw new ForbiddenException(__('This category is not available to view')); |
| 210 | 210 | } |
| 211 | 211 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | // check if current user can rate item |
| 261 | 261 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
| 262 | 262 | $canRate = true; |
| 263 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
| 263 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
| 264 | 264 | $canRate = false; |
| 265 | 265 | } |
| 266 | 266 | if (!App::$User->isAuth()) { |
@@ -279,11 +279,11 @@ discard block |
||
| 279 | 279 | 'poster' => $row->getPosterUri(), |
| 280 | 280 | 'thumb' => $row->getPosterThumbUri(), |
| 281 | 281 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
| 282 | - 'views' => (int)$row->views, |
|
| 283 | - 'rating' => (int)$row->rating, |
|
| 282 | + 'views' => (int) $row->views, |
|
| 283 | + 'rating' => (int) $row->rating, |
|
| 284 | 284 | 'canRate' => $canRate, |
| 285 | 285 | 'category' => $this->categories[$row->category_id], |
| 286 | - 'uri' => '/content/read/' . $itemPath, |
|
| 286 | + 'uri' => '/content/read/'.$itemPath, |
|
| 287 | 287 | 'tags' => $tags |
| 288 | 288 | ]; |
| 289 | 289 | } |
@@ -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 | } |
@@ -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 [ |