@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | { |
56 | 56 | $path = $this->request->getPathWithoutControllerAction(); |
57 | 57 | $configs = $this->getConfigs(); |
58 | - $page = (int)$this->request->query->get('page', 0); |
|
59 | - $sort = (string)$this->request->query->get('sort', 'newest'); |
|
60 | - $itemCount = (int)$configs['itemPerCategory']; |
|
58 | + $page = (int) $this->request->query->get('page', 0); |
|
59 | + $sort = (string) $this->request->query->get('sort', 'newest'); |
|
60 | + $itemCount = (int) $configs['itemPerCategory']; |
|
61 | 61 | |
62 | 62 | // build special model with content list and category list information |
63 | 63 | $model = new EntityCategoryList($path, $configs, $page, $sort); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $model = new EntityContentRead($categoryRecord, $contentRecord->first()); |
138 | 138 | $search = null; |
139 | 139 | // check if similar search is enabled for item category |
140 | - if ((int)$model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) { |
|
140 | + if ((int) $model->getCategory()->getProperty('showSimilar') === 1 && $trash === false) { |
|
141 | 141 | $search = new EntityContentSearch($model->title, $model->id); |
142 | 142 | } |
143 | 143 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | // get equal rows order by creation date |
177 | - $records = ContentEntity::where('meta_keywords', 'like', '%' . $tagName . '%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE); |
|
177 | + $records = ContentEntity::where('meta_keywords', 'like', '%'.$tagName.'%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE); |
|
178 | 178 | // check if result is not empty |
179 | 179 | if ($records->count() < 1) { |
180 | 180 | throw new NotFoundException(__('Nothing founded')); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $this->layout = null; |
209 | 209 | |
210 | 210 | // check if rss display allowed for this category |
211 | - if ((int)$model->category['configs']['showRss'] !== 1) { |
|
211 | + if ((int) $model->category['configs']['showRss'] !== 1) { |
|
212 | 212 | throw new ForbiddenException(__('Rss feed is disabled for this category')); |
213 | 213 | } |
214 | 214 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | // set channel data |
220 | 220 | $channel->title($model->category['title']) |
221 | 221 | ->description($model->category['description']) |
222 | - ->url(App::$Alias->baseUrl . '/content/list/' . $model->category['path']) |
|
222 | + ->url(App::$Alias->baseUrl.'/content/list/'.$model->category['path']) |
|
223 | 223 | ->appendTo($feed); |
224 | 224 | |
225 | 225 | // add content data |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | // add title, short text, url |
230 | 230 | $item->title($row['title']) |
231 | 231 | ->description($row['text']) |
232 | - ->url(App::$Alias->baseUrl . $row['uri']); |
|
232 | + ->url(App::$Alias->baseUrl.$row['uri']); |
|
233 | 233 | // add poster |
234 | 234 | if ($row['thumb'] !== null) { |
235 | - $item->enclosure(App::$Alias->scriptUrl . $row['thumb'], $row['thumbSize'], 'image/jpeg'); |
|
235 | + $item->enclosure(App::$Alias->scriptUrl.$row['thumb'], $row['thumbSize'], 'image/jpeg'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | // append response to channel |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | |
268 | 268 | // check if user add enabled |
269 | 269 | $configs = $this->getConfigs(); |
270 | - if (!(bool)$configs['userAdd']) { |
|
270 | + if (!(bool) $configs['userAdd']) { |
|
271 | 271 | throw new NotFoundException(__('User add is disabled')); |
272 | 272 | } |
273 | 273 | |
274 | 274 | // prepare query |
275 | - $page = (int)$this->request->query->get('page', 0); |
|
275 | + $page = (int) $this->request->query->get('page', 0); |
|
276 | 276 | $offset = $page * 10; |
277 | 277 | $query = ContentRecord::where('author_id', '=', App::$User->identity()->getId()); |
278 | 278 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | // check if user add enabled |
314 | 314 | $configs = $this->getConfigs(); |
315 | - if (!(bool)$configs['userAdd']) { |
|
315 | + if (!(bool) $configs['userAdd']) { |
|
316 | 316 | throw new NotFoundException(__('User add is disabled')); |
317 | 317 | } |
318 | 318 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $new = $record->id === null; |
322 | 322 | |
323 | 323 | // reject edit published items and items from other authors |
324 | - if (($new === false && (int)$record->author_id !== App::$User->identity()->getId()) || (int)$record->display === 1) { |
|
324 | + if (($new === false && (int) $record->author_id !== App::$User->identity()->getId()) || (int) $record->display === 1) { |
|
325 | 325 | throw new ForbiddenException(__('You have no permissions to edit this content')); |
326 | 326 | } |
327 | 327 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $category = $content->getCategory(); |
371 | 371 | $uri = '/content/read/'; |
372 | 372 | if (!Str::likeEmpty($category->path)) { |
373 | - $uri .= $category->path . '/'; |
|
373 | + $uri .= $category->path.'/'; |
|
374 | 374 | } |
375 | 375 | $uri .= $content->path; |
376 | 376 | $sitemap->add($uri, $content->created_at, 'weekly', 0.7); |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | // add categories |
379 | 379 | $categories = ContentCategory::getAll(); |
380 | 380 | foreach ($categories as $item) { |
381 | - if ((bool)$item->getProperty('showCategory')) { |
|
382 | - $uri = '/content/list/' . $item->path; |
|
381 | + if ((bool) $item->getProperty('showCategory')) { |
|
382 | + $uri = '/content/list/'.$item->path; |
|
383 | 383 | $sitemap->add($uri, date('c'), 'daily', 0.9); |
384 | 384 | } |
385 | 385 | } |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | foreach (\App::$Properties->get('languages') as $lang) { |
43 | 43 | $generalItems[] = [ |
44 | 44 | 'type' => 'tab', |
45 | - 'text' => __('Lang') . ': ' . Str::upperCase($lang), |
|
46 | - 'content' => $form->field('title.' . $lang, 'text', ['class' => 'form-control'], __('Please, enter the title of your material for current language locale'), 'content/form/tab_content_update') . |
|
47 | - $form->field('text.' . $lang, 'textarea', ['class' => 'form-control wysiwyg', 'rows' => 7, 'html' => true], null, 'content/form/tab_content_update'), |
|
45 | + 'text' => __('Lang').': '.Str::upperCase($lang), |
|
46 | + 'content' => $form->field('title.'.$lang, 'text', ['class' => 'form-control'], __('Please, enter the title of your material for current language locale'), 'content/form/tab_content_update'). |
|
47 | + $form->field('text.'.$lang, 'textarea', ['class' => 'form-control wysiwyg', 'rows' => 7, 'html' => true], null, 'content/form/tab_content_update'), |
|
48 | 48 | 'html' => true, |
49 | 49 | 'active' => $lang === \App::$Request->getLanguage(), |
50 | 50 | '!secure' => true |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | |
53 | 53 | $propertiesItems[] = [ |
54 | 54 | 'type' => 'tab', |
55 | - 'text' => __('Lang') . ': ' . Str::upperCase($lang), |
|
56 | - 'content' => $form->field('metaTitle.' . $lang, 'text', ['class' => 'form-control'], __('Enter meta param title for page title. Recoomended: 50-70 characters')) . |
|
57 | - $form->field('metaKeywords.' . $lang, 'text', ['class' => 'form-control'], __('Enter meta param keywords for this content, separated by comma. Example: home, door, dog')) . |
|
58 | - $form->field('metaDescription.' . $lang, 'text', ['class' => 'form-control'], __('Enter meta param description for this content. Recommended is 100-150 characters')), |
|
55 | + 'text' => __('Lang').': '.Str::upperCase($lang), |
|
56 | + 'content' => $form->field('metaTitle.'.$lang, 'text', ['class' => 'form-control'], __('Enter meta param title for page title. Recoomended: 50-70 characters')). |
|
57 | + $form->field('metaKeywords.'.$lang, 'text', ['class' => 'form-control'], __('Enter meta param keywords for this content, separated by comma. Example: home, door, dog')). |
|
58 | + $form->field('metaDescription.'.$lang, 'text', ['class' => 'form-control'], __('Enter meta param description for this content. Recommended is 100-150 characters')), |
|
59 | 59 | 'html' => true, |
60 | 60 | '!secure' => true, |
61 | 61 | 'active' => $lang === \App::$Request->getLanguage() |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | <div class="dropzone dropzone-previews" id="ffcms-dropzone"></div> |
91 | 91 | </div> |
92 | 92 | <div class="col-md-4"> |
93 | - ' . $form->field('poster', 'select', ['options' => [__('Not selected...')], 'class' => 'form-control'], __('Select image from gallery as a poster for this content')) . ' |
|
93 | + ' . $form->field('poster', 'select', ['options' => [__('Not selected...')], 'class' => 'form-control'], __('Select image from gallery as a poster for this content')).' |
|
94 | 94 | </div> |
95 | 95 | </div><br/><br/>'; |
96 | 96 | ?> |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | ['type' => 'tab', 'text' => __('Gallery'), 'content' => $galleryTab, 'html' => true, '!secure' => true], |
104 | 104 | ['type' => 'tab', 'text' => __('Other'), 'content' => $otherTab, 'html' => true, '!secure' => true] |
105 | 105 | ] |
106 | -]);?> |
|
106 | +]); ?> |
|
107 | 107 | |
108 | 108 | <?= $form->field('galleryFreeId', 'hidden') ?> |
109 | 109 | <?= $form->submitButton(__('Save'), ['class' => 'btn btn-primary']) ?> |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | |
113 | 113 | <?php |
114 | 114 | // load max length display plugin |
115 | -\App::$Alias->setCustomLibrary('js', \App::$Alias->currentViewUrl . '/assets/js/plugins/maxlength.js'); |
|
115 | +\App::$Alias->setCustomLibrary('js', \App::$Alias->currentViewUrl.'/assets/js/plugins/maxlength.js'); |
|
116 | 116 | // load datapicker plugin |
117 | -\App::$Alias->setCustomLibrary('css', \App::$Alias->currentViewUrl . '/assets/css/plugins/datapick/datapick.css'); |
|
118 | -\App::$Alias->setCustomLibrary('js', \App::$Alias->currentViewUrl . '/assets/js/plugins/datapick.js'); |
|
117 | +\App::$Alias->setCustomLibrary('css', \App::$Alias->currentViewUrl.'/assets/css/plugins/datapick/datapick.css'); |
|
118 | +\App::$Alias->setCustomLibrary('js', \App::$Alias->currentViewUrl.'/assets/js/plugins/datapick.js'); |
|
119 | 119 | // load jquery-upload plugin |
120 | -\App::$Alias->setCustomLibrary('css', \App::$Alias->scriptUrl . '/vendor/bower/dropzone/dist/min/dropzone.min.css'); |
|
121 | -\App::$Alias->setCustomLibrary('css', \App::$Alias->scriptUrl . '/vendor/bower/dropzone/dist/min/basic.min.css'); |
|
122 | -\App::$Alias->setCustomLibrary('js', \App::$Alias->scriptUrl . '/vendor/bower/dropzone/dist/min/dropzone.min.js'); |
|
120 | +\App::$Alias->setCustomLibrary('css', \App::$Alias->scriptUrl.'/vendor/bower/dropzone/dist/min/dropzone.min.css'); |
|
121 | +\App::$Alias->setCustomLibrary('css', \App::$Alias->scriptUrl.'/vendor/bower/dropzone/dist/min/basic.min.css'); |
|
122 | +\App::$Alias->setCustomLibrary('js', \App::$Alias->scriptUrl.'/vendor/bower/dropzone/dist/min/dropzone.min.js'); |
|
123 | 123 | ?> |
124 | 124 | |
125 | 125 | <script> |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | var DropzoneFiles = []; |
217 | 217 | $('#ffcms-dropzone').dropzone({ |
218 | 218 | url: script_url+'/api/content/galleryupload/<?= $model->galleryFreeId ?>?lang='+script_lang, |
219 | - dictDefaultMessage: '<?= __('Drop files here to upload in gallery') . '<br />' . __('(or click here)') ?>', |
|
219 | + dictDefaultMessage: '<?= __('Drop files here to upload in gallery').'<br />'.__('(or click here)') ?>', |
|
220 | 220 | acceptedFiles: ".jpeg,.jpg,.png,.gif,.webp", |
221 | 221 | addRemoveLinks: true, |
222 | 222 | removedfile: function (file) { // file remove click, lets try to remove file from server & make visual changes |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public static function all($columns = ['*']) |
28 | 28 | { |
29 | - $cacheName = 'activerecords.role.all.' . implode('.', $columns); |
|
29 | + $cacheName = 'activerecords.role.all.'.implode('.', $columns); |
|
30 | 30 | $records = MemoryObject::instance()->get($cacheName); |
31 | 31 | if ($records === null) { |
32 | 32 | $records = parent::all($columns); |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public static function get($role_id) |
45 | 45 | { |
46 | - $role = MainApp::$Memory->get('user.role.cache.' . $role_id); |
|
46 | + $role = MainApp::$Memory->get('user.role.cache.'.$role_id); |
|
47 | 47 | |
48 | 48 | // not founded in cache |
49 | 49 | if ($role === null) { |
50 | 50 | $role = self::find($role_id); |
51 | - MainApp::$Memory->set('user.role.cache.' . $role_id, $role); |
|
51 | + MainApp::$Memory->set('user.role.cache.'.$role_id, $role); |
|
52 | 52 | } |
53 | 53 | return $role; |
54 | 54 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public static function all($columns = ['*']) |
30 | 30 | { |
31 | - $cacheName = 'activerecord.profilefield.all.' . implode('.', $columns); |
|
31 | + $cacheName = 'activerecord.profilefield.all.'.implode('.', $columns); |
|
32 | 32 | $records = MemoryObject::instance()->get($cacheName); |
33 | 33 | if ($records === null) { |
34 | 34 | $records = parent::all($columns); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function actionIndex() |
44 | 44 | { |
45 | 45 | // set current page and offset |
46 | - $page = (int)$this->request->query->get('page'); |
|
46 | + $page = (int) $this->request->query->get('page'); |
|
47 | 47 | $offset = $page * self::ITEM_PER_PAGE; |
48 | 48 | |
49 | 49 | $query = null; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } elseif ($type === 'moderate') { // only items on moderate |
55 | 55 | $query = ContentEntity::where('display', '=', 0); |
56 | 56 | } elseif (Obj::isLikeInt($type)) { // sounds like category id ;) |
57 | - $query = ContentEntity::where('category_id', '=', (int)$type); |
|
57 | + $query = ContentEntity::where('category_id', '=', (int) $type); |
|
58 | 58 | } else { |
59 | 59 | $query = new ContentEntity(); |
60 | 60 | $type = 'all'; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | public function actionCategoryupdate($id = null) |
269 | 269 | { |
270 | 270 | // get owner id for new rows |
271 | - $parentId = (int)$this->request->query->get('parent'); |
|
271 | + $parentId = (int) $this->request->query->get('parent'); |
|
272 | 272 | |
273 | 273 | // get relation and pass to model |
274 | 274 | $record = ContentCategory::findOrNew($id); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $search = \Apps\ActiveRecord\App::getItem('widget', $controller); |
88 | 88 | |
89 | 89 | // check what we got |
90 | - if ($search === null || (int)$search->id < 1) { |
|
90 | + if ($search === null || (int) $search->id < 1) { |
|
91 | 91 | throw new NotFoundException('Widget is not founded'); |
92 | 92 | } |
93 | 93 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $record = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'widget')->first(); |
122 | 122 | |
123 | 123 | // check if widget admin controller exists |
124 | - if ($record === null || (int)$record->id < 1) { |
|
124 | + if ($record === null || (int) $record->id < 1) { |
|
125 | 125 | throw new ForbiddenException('Widget is not founded'); |
126 | 126 | } |
127 | 127 |
@@ -37,9 +37,9 @@ |
||
37 | 37 | $record->save(); |
38 | 38 | |
39 | 39 | // add user notification |
40 | - if ((int)$this->_post->user_id > 0 && $this->_userId !== (int)$this->_post->user_id) { |
|
41 | - $notify = new EntityAddNotification((int)$this->_post->user_id); |
|
42 | - $uri = '/feedback/read/' . $this->_post->id . '/' . $this->_post->hash . '#feedback-answer-' . $record->id; |
|
40 | + if ((int) $this->_post->user_id > 0 && $this->_userId !== (int) $this->_post->user_id) { |
|
41 | + $notify = new EntityAddNotification((int) $this->_post->user_id); |
|
42 | + $uri = '/feedback/read/'.$this->_post->id.'/'.$this->_post->hash.'#feedback-answer-'.$record->id; |
|
43 | 43 | |
44 | 44 | $notify->add($uri, EntityAddNotification::MSG_ADD_FEEDBACKANSWER, [ |
45 | 45 | 'snippet' => Text::snippet($this->message, 50), |
@@ -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 | } |
37 | 37 | \ No newline at end of file |
@@ -26,8 +26,8 @@ |
||
26 | 26 | */ |
27 | 27 | public function before() |
28 | 28 | { |
29 | - $this->count = (int)$this->_configs['count']; |
|
30 | - $this->cache = (int)$this->_configs['cache']; |
|
29 | + $this->count = (int) $this->_configs['count']; |
|
30 | + $this->cache = (int) $this->_configs['cache']; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |