@@ -67,17 +67,23 @@ |
||
67 | 67 | <?php if ($properties['author'] === true): ?> |
68 | 68 | <?php if ($model->authorId !== null && $model->authorId > 0): ?> |
69 | 69 | <span><i class="fa fa-user"></i><?= Url::link(['profile/show', $model->authorId], $model->authorName, ['itemprop' => 'author']) ?></span> |
70 | - <?php else: ?> |
|
70 | + <?php else { |
|
71 | + : ?> |
|
71 | 72 | <span><i class="fa fa-user"></i><s><?= $model->authorName ?></s></span> |
72 | - <?php endif; ?> |
|
73 | + <?php endif; |
|
74 | +} |
|
75 | +?> |
|
73 | 76 | <?php endif; ?> |
74 | 77 | <?php if ($properties['views'] === true): ?> |
75 | 78 | <span><i class="fa fa-eye"></i><?= $model->views ?></span> |
76 | 79 | <?php endif ?> |
77 | 80 | </div> |
78 | - <?php else: ?> |
|
81 | + <?php else { |
|
82 | + : ?> |
|
79 | 83 | <hr /> |
80 | - <?php endif; ?> |
|
84 | + <?php endif; |
|
85 | +} |
|
86 | +?> |
|
81 | 87 | <?php if ($trash): ?> |
82 | 88 | <p class="alert alert-danger"><i class="fa fa-trash-o"></i> <?= __('This content is placed in trash') ?></p> |
83 | 89 | <?php endif; ?> |
@@ -159,12 +159,12 @@ |
||
159 | 159 | <div class="col-md-12"> |
160 | 160 | <div class="pull-left"> |
161 | 161 | <?php if ($properties['rating']) { |
162 | - echo \App::$View->render('content/_rate', [ |
|
163 | - 'id' => $model->id, |
|
164 | - 'rating' => $model->rating, |
|
165 | - 'canRate' => $model->canRate |
|
166 | - ]); |
|
167 | - } ?> |
|
162 | + echo \App::$View->render('content/_rate', [ |
|
163 | + 'id' => $model->id, |
|
164 | + 'rating' => $model->rating, |
|
165 | + 'canRate' => $model->canRate |
|
166 | + ]); |
|
167 | + } ?> |
|
168 | 168 | <?= \App::$View->render('content/_rateJs') ?> |
169 | 169 | </div> |
170 | 170 | <div class="pull-right"> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | // don't use breadcrumbs on injected pathway rule |
26 | -if (!\App::$Request->isPathInjected() && (bool)$model->getCategory()->getProperty('showCategory')) { |
|
26 | +if (!\App::$Request->isPathInjected() && (bool) $model->getCategory()->getProperty('showCategory')) { |
|
27 | 27 | $breadcrumbs = [ |
28 | 28 | Url::to('/') => __('Home') |
29 | 29 | ]; |
@@ -35,22 +35,22 @@ discard block |
||
35 | 35 | $breadcrumbs[Url::to('content/list', $cat['path'], null, [], false)] = $cat['name']; |
36 | 36 | } |
37 | 37 | } |
38 | - $breadcrumbs[] = __('Content') . ': ' . Str::sub($this->title, 0, 40); |
|
38 | + $breadcrumbs[] = __('Content').': '.Str::sub($this->title, 0, 40); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->breadcrumbs = $breadcrumbs; |
42 | 42 | } |
43 | 43 | |
44 | 44 | $properties = [ |
45 | - 'date' => (bool)$model->getCategory()->getProperty('showDate'), |
|
46 | - 'author' => (bool)$model->getCategory()->getProperty('showAuthor'), |
|
47 | - 'views' => (bool)$model->getCategory()->getProperty('showViews'), |
|
48 | - 'category' => (bool)$model->getCategory()->getProperty('showCategory'), |
|
49 | - 'rating' => (bool)$model->getCategory()->getProperty('showRating'), |
|
50 | - 'tags' => (bool)$model->getCategory()->getProperty('showTags') |
|
45 | + 'date' => (bool) $model->getCategory()->getProperty('showDate'), |
|
46 | + 'author' => (bool) $model->getCategory()->getProperty('showAuthor'), |
|
47 | + 'views' => (bool) $model->getCategory()->getProperty('showViews'), |
|
48 | + 'category' => (bool) $model->getCategory()->getProperty('showCategory'), |
|
49 | + 'rating' => (bool) $model->getCategory()->getProperty('showRating'), |
|
50 | + 'tags' => (bool) $model->getCategory()->getProperty('showTags') |
|
51 | 51 | ]; |
52 | -$showComments = (bool)$model->getCategory()->getProperty('showComments'); |
|
53 | -$showPoster = (bool)$model->getCategory()->getProperty('showPoster'); |
|
52 | +$showComments = (bool) $model->getCategory()->getProperty('showComments'); |
|
53 | +$showPoster = (bool) $model->getCategory()->getProperty('showPoster'); |
|
54 | 54 | |
55 | 55 | ?> |
56 | 56 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | <span class="spaced"><i class="fa fa-eye"></i> <?= $model->views ?></span> |
76 | 76 | <?php endif ?> |
77 | 77 | <?php if (\App::$User->isAuth() && \App::$User->identity()->getRole()->can('Admin/Content/Update')): ?> |
78 | - <span class="pull-right"><a href="<?= \App::$Alias->scriptUrl . '/admin/content/update/' . $model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
78 | + <span class="pull-right"><a href="<?= \App::$Alias->scriptUrl.'/admin/content/update/'.$model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
79 | 79 | <?php endif; ?> |
80 | 80 | </div> |
81 | 81 | <?php else: ?> |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | <div id="content-text"> |
88 | 88 | <?php if ($showPoster === true && $model->posterFull !== null && $model->posterThumb !== null): ?> |
89 | 89 | <a href="#showPoster" data-toggle="modal" data-target="#showPoster"> |
90 | - <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase(\App::$Security->strip_tags($model->title)) ?>" src="<?= \App::$Alias->scriptUrl . $model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
90 | + <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase(\App::$Security->strip_tags($model->title)) ?>" src="<?= \App::$Alias->scriptUrl.$model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
91 | 91 | </a> |
92 | 92 | |
93 | 93 | <!-- Modal poster pop-up --> |
@@ -99,19 +99,19 @@ discard block |
||
99 | 99 | <h4 class="modal-title" id="myModalLabel"><?= __('View poster') ?></h4> |
100 | 100 | </div> |
101 | 101 | <div class="modal-body"> |
102 | - <img class="img-responsive" src="<?= \App::$Alias->scriptUrl . $model->posterFull ?>" alt="<?= __('Poster image') ?>" style="margin: 0 auto;" /> |
|
102 | + <img class="img-responsive" src="<?= \App::$Alias->scriptUrl.$model->posterFull ?>" alt="<?= __('Poster image') ?>" style="margin: 0 auto;" /> |
|
103 | 103 | </div> |
104 | 104 | </div> |
105 | 105 | </div> |
106 | 106 | </div> |
107 | - <?php endif ;?> |
|
107 | + <?php endif; ?> |
|
108 | 108 | <?= $model->text ?> |
109 | 109 | </div> |
110 | 110 | <?php if ($model->galleryItems !== null && Obj::isArray($model->galleryItems)): ?> |
111 | 111 | <div class="row"> |
112 | 112 | <?php foreach ($model->galleryItems as $thumbPic => $fullPic): ?> |
113 | 113 | <div class="col-md-2 well"> |
114 | - <a href="#showGallery" class="modalGallery" content="<?= \App::$Alias->scriptUrl . $fullPic ?>"><img src="<?= \App::$Alias->scriptUrl . $thumbPic ?>" class="img-responsive image-item" /></a> |
|
114 | + <a href="#showGallery" class="modalGallery" content="<?= \App::$Alias->scriptUrl.$fullPic ?>"><img src="<?= \App::$Alias->scriptUrl.$thumbPic ?>" class="img-responsive image-item" /></a> |
|
115 | 115 | </div> |
116 | 116 | <?php endforeach; ?> |
117 | 117 | </div> |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | <h4 class="modal-title" id="showModalLabel"><?= __('View picture') ?></h4> |
124 | 124 | </div> |
125 | 125 | <div class="modal-body" id="modal-gallery-body"> |
126 | - <img class="img-responsive" src="<?= \App::$Alias->scriptUrl . $model->posterFull ?>" alt="<?= __('Gallery picture') ?>" style="margin: 0 auto;" /> |
|
126 | + <img class="img-responsive" src="<?= \App::$Alias->scriptUrl.$model->posterFull ?>" alt="<?= __('Gallery picture') ?>" style="margin: 0 auto;" /> |
|
127 | 127 | </div> |
128 | 128 | </div> |
129 | 129 | </div> |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | </div> |
145 | 145 | <div id="similar<?= $idx ?>" class="panel-collapse collapse"> |
146 | 146 | <div class="panel-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 hidden-xs"></i> '; |
176 | 176 | foreach ($model->metaKeywords as $tag) { |
177 | 177 | $tag = \App::$Security->strip_tags(trim($tag)); |
178 | - echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . " "; |
|
178 | + echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default'])." "; |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | ?> |
@@ -123,7 +123,7 @@ |
||
123 | 123 | /** |
124 | 124 | * Get current extension active record |
125 | 125 | * @param string|null $type |
126 | - * @return mixed |
|
126 | + * @return AppRecord |
|
127 | 127 | */ |
128 | 128 | public function getTypeItem($type = null) |
129 | 129 | { |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | $user = App::$User->identity(); |
87 | 87 | // user is not authed ? |
88 | 88 | if ($user === null || !App::$User->isAuth()) { |
89 | - $redirectUrl = App::$Alias->scriptUrl . '/user/login'; |
|
89 | + $redirectUrl = App::$Alias->scriptUrl.'/user/login'; |
|
90 | 90 | App::$Response->redirect($redirectUrl, true); |
91 | 91 | exit(); |
92 | 92 | } |
93 | 93 | |
94 | - $permission = env_name . '/' . App::$Request->getController() . '/' . App::$Request->getAction(); |
|
94 | + $permission = env_name.'/'.App::$Request->getController().'/'.App::$Request->getAction(); |
|
95 | 95 | |
96 | 96 | // doesn't have permission? get the f*ck out |
97 | 97 | if (!$user->getRole()->can($permission)) { |
98 | 98 | App::$Session->invalidate(); |
99 | 99 | |
100 | - $redirectUrl = App::$Alias->scriptUrl . '/user/login'; |
|
100 | + $redirectUrl = App::$Alias->scriptUrl.'/user/login'; |
|
101 | 101 | App::$Response->redirect($redirectUrl, true); |
102 | 102 | exit(); |
103 | 103 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function getConfigs() |
146 | 146 | { |
147 | - return $this->type === 'widget' ? (array)Serialize::decode($this->widget->configs) : (array)Serialize::decode($this->application->configs); |
|
147 | + return $this->type === 'widget' ? (array) Serialize::decode($this->widget->configs) : (array) Serialize::decode($this->application->configs); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -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 |
@@ -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 |
@@ -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 { |
@@ -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 | ]); ?> |
@@ -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; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $this->_path = $path; |
61 | 61 | $this->_configs = $configs; |
62 | - $this->_page = (int)$offset; |
|
62 | + $this->_page = (int) $offset; |
|
63 | 63 | $this->_sort = $sort; |
64 | 64 | parent::__construct(); |
65 | 65 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function before() |
73 | 73 | { |
74 | 74 | // find one or more categories where we must looking for content items |
75 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
75 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
76 | 76 | $this->findCategories(); |
77 | 77 | } else { |
78 | 78 | $this->findCategory(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setItemLimit($limit) |
93 | 93 | { |
94 | - $this->_customItemLimit = (int)$limit; |
|
94 | + $this->_customItemLimit = (int) $limit; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | private function findCategories() |
120 | 120 | { |
121 | 121 | // get all categories for current path and child of it |
122 | - $query = ContentCategory::where('path', 'like', $this->_path . '%'); |
|
122 | + $query = ContentCategory::where('path', 'like', $this->_path.'%'); |
|
123 | 123 | if ($query->count() < 1) { |
124 | 124 | throw new NotFoundException(__('Category is not founded')); |
125 | 125 | } |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | // calculate selection offset |
155 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
155 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
156 | 156 | // check if custom itemlimit defined over model api |
157 | 157 | if ($this->_customItemLimit !== false) { |
158 | - $itemPerPage = (int)$this->_customItemLimit; |
|
158 | + $itemPerPage = (int) $this->_customItemLimit; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $offset = $this->_page * $itemPerPage; |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | $catConfigs = Serialize::decode($this->_currentCategory->configs); |
198 | 198 | // prepare rss url link for current category if enabled |
199 | 199 | $rssUrl = false; |
200 | - if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) { |
|
201 | - $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path; |
|
200 | + if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) { |
|
201 | + $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path; |
|
202 | 202 | $rssUrl = rtrim($rssUrl, '/'); |
203 | 203 | } |
204 | 204 | |
205 | 205 | // prepare sorting urls |
206 | 206 | $catSortParams = []; |
207 | 207 | if (App::$Request->query->get('page') !== null) { |
208 | - $catSortParams['page'] = (int)App::$Request->query->get('page'); |
|
208 | + $catSortParams['page'] = (int) App::$Request->query->get('page'); |
|
209 | 209 | } |
210 | 210 | $catSortUrls = [ |
211 | 211 | 'views' => Url::to('content/list', $this->_currentCategory->path, null, Arr::merge($catSortParams, ['sort' => 'views']), false), |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | ]; |
225 | 225 | |
226 | 226 | // check if this category is hidden |
227 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
227 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
228 | 228 | throw new ForbiddenException(__('This category is not available to view')); |
229 | 229 | } |
230 | 230 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | // check if current user can rate item |
280 | 280 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
281 | 281 | $canRate = true; |
282 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
282 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
283 | 283 | $canRate = false; |
284 | 284 | } |
285 | 285 | if (!App::$User->isAuth()) { |
@@ -299,11 +299,11 @@ discard block |
||
299 | 299 | 'poster' => $row->getPosterUri(), |
300 | 300 | 'thumb' => $row->getPosterThumbUri(), |
301 | 301 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
302 | - 'views' => (int)$row->views, |
|
303 | - 'rating' => (int)$row->rating, |
|
302 | + 'views' => (int) $row->views, |
|
303 | + 'rating' => (int) $row->rating, |
|
304 | 304 | 'canRate' => $canRate, |
305 | 305 | 'category' => $this->categories[$row->category_id], |
306 | - 'uri' => '/content/read/' . $itemPath, |
|
306 | + 'uri' => '/content/read/'.$itemPath, |
|
307 | 307 | 'tags' => $tags |
308 | 308 | ]; |
309 | 309 | } |
@@ -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,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 */ |