@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function actionImport($activeRecord) |
26 | 26 | { |
27 | - $importFile = root . '/Private/Database/Tables/' . ucfirst(strtolower($activeRecord)) . '.php'; |
|
27 | + $importFile = root.'/Private/Database/Tables/'.ucfirst(strtolower($activeRecord)).'.php'; |
|
28 | 28 | if (!File::exist($importFile)) { |
29 | - return 'Database model table not founded: ' . $activeRecord; |
|
29 | + return 'Database model table not founded: '.$activeRecord; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | @include($importFile); |
33 | - return 'Database table import done: ' . $activeRecord; |
|
33 | + return 'Database table import done: '.$activeRecord; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function actionImportAll($connectName = 'default') |
42 | 42 | { |
43 | - $importFile = root . '/Private/Database/install.php'; |
|
43 | + $importFile = root.'/Private/Database/install.php'; |
|
44 | 44 | if (!File::exist($importFile)) { |
45 | - return 'Import file is not exist: ' . $importFile; |
|
45 | + return 'Import file is not exist: '.$importFile; |
|
46 | 46 | } |
47 | 47 | @include($importFile); |
48 | 48 | return 'All database tables was imported!'; |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | throw new NativeException('Password is bad'); |
72 | 72 | } |
73 | 73 | echo "RoleId (1 = onlyread, 2 = user, 3 = moderator, 4 = admin):"; |
74 | - $role = (int)Console::$Input->read(); |
|
75 | - if (!Arr::in($role, [1,2,3,4])) { |
|
74 | + $role = (int) Console::$Input->read(); |
|
75 | + if (!Arr::in($role, [1, 2, 3, 4])) { |
|
76 | 76 | $role = 2; |
77 | 77 | } |
78 | 78 |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ffcms\Core\App as MainApp; |
6 | 6 | use Ffcms\Core\Arch\ActiveModel; |
7 | 7 | use Ffcms\Core\Helper\Type\Arr; |
8 | -use Ffcms\Core\Helper\Type\Str; |
|
9 | 8 | |
10 | 9 | class Role extends ActiveModel |
11 | 10 | { |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | $this->title = __('User list'); |
15 | 15 | |
16 | 16 | if ($id === 'all') { |
17 | - $this->title .= ': ' . __('All'); |
|
17 | + $this->title .= ': '.__('All'); |
|
18 | 18 | } elseif ($id === 'rating') { |
19 | - $this->title .= ': ' . __('Rating'); |
|
19 | + $this->title .= ': '.__('Rating'); |
|
20 | 20 | } elseif ($id === 'city') { |
21 | - $this->title .= ': ' . __('City') . ' ' . \App::$Security->strip_tags($add); |
|
21 | + $this->title .= ': '.__('City').' '.\App::$Security->strip_tags($add); |
|
22 | 22 | } elseif ($id === 'hobby') { |
23 | - $this->title .= ': ' . __('Hobby') . ' ' . \App::$Security->strip_tags($add); |
|
23 | + $this->title .= ': '.__('Hobby').' '.\App::$Security->strip_tags($add); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $this->breadcrumbs = [ |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | <?php |
37 | 37 | if ($records === null || $records->count() < 1) { |
38 | - echo '<div class="alert alert-danger">' . __('Users are not founded!') . '</div>'; |
|
38 | + echo '<div class="alert alert-danger">'.__('Users are not founded!').'</div>'; |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | ?> |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | </div> |
49 | 49 | <div class="col-md-8"> |
50 | 50 | <h3> |
51 | - <?= Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name') . '(id' . $profile->user_id . ')' : $profile->nick) ?> |
|
51 | + <?= Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name').'(id'.$profile->user_id.')' : $profile->nick) ?> |
|
52 | 52 | </h3> |
53 | 53 | <p><?= __('Registered') ?>: <?= Date::convertToDatetime($profile->created_at, Date::FORMAT_TO_DAY) ?></p> |
54 | 54 | <?php if (\App::$User->identity() !== null && $profile->user_id !== \App::$User->identity()->getId()): ?> |
55 | - <?= Url::link(['profile/messages', null, null, ['newdialog' => $profile->user_id]], '<i class="fa fa-pencil-square-o"></i> ' . __('New message'), ['class' => 'btn btn-info']) ?> |
|
55 | + <?= Url::link(['profile/messages', null, null, ['newdialog' => $profile->user_id]], '<i class="fa fa-pencil-square-o"></i> '.__('New message'), ['class' => 'btn btn-info']) ?> |
|
56 | 56 | <?php endif; ?> |
57 | 57 | </div> |
58 | 58 | <div class="col-md-2"> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | date_default_timezone_set(App::$Properties->get('timezone')); |
14 | 14 | |
15 | 15 | return [ |
16 | - 'Database' => function () { |
|
16 | + 'Database' => function() { |
|
17 | 17 | $capsule = new Capsule; |
18 | 18 | if (env_name !== 'Install') { |
19 | 19 | try { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | try { |
35 | 35 | $capsule->connection()->getPdo(); |
36 | 36 | } catch (\Exception $e) { |
37 | - $instUri = \App::$Alias->scriptUrl . '/install'; |
|
37 | + $instUri = \App::$Alias->scriptUrl.'/install'; |
|
38 | 38 | \App::$Response->redirect($instUri, true); |
39 | 39 | } |
40 | 40 | } |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | try { |
47 | 47 | $pdo = \App::$Database->connection()->getPdo(); |
48 | 48 | $handler = new PdoSessionHandler($pdo, [ |
49 | - 'db_table' => App::$Properties->get('database')['prefix'] . 'sessions' |
|
49 | + 'db_table' => App::$Properties->get('database')['prefix'].'sessions' |
|
50 | 50 | ]); |
51 | 51 | } catch (Exception $e) { |
52 | - $handler = new NativeFileSessionHandler(root . '/Private/Sessions'); |
|
52 | + $handler = new NativeFileSessionHandler(root.'/Private/Sessions'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $storage = new NativeSessionStorage([ |
@@ -60,21 +60,21 @@ discard block |
||
60 | 60 | |
61 | 61 | return new Session($storage); |
62 | 62 | }, |
63 | - 'User' => function () { |
|
63 | + 'User' => function() { |
|
64 | 64 | return new Apps\ActiveRecord\User(); |
65 | 65 | }, |
66 | - 'Mailer' => function () { |
|
66 | + 'Mailer' => function() { |
|
67 | 67 | $swiftTransport = Swift_MailTransport::newInstance(); |
68 | 68 | return Swift_Mailer::newInstance($swiftTransport); |
69 | 69 | }, |
70 | - 'Captcha' => function () { |
|
70 | + 'Captcha' => function() { |
|
71 | 71 | return new Extend\Core\Captcha\Gregwar(); |
72 | 72 | }, |
73 | - 'Cache' => function () { |
|
73 | + 'Cache' => function() { |
|
74 | 74 | // initialize cache manager. You can use redis, memcache or anything else. Look at: phpfastcache.com |
75 | 75 | CacheManager::setup([ |
76 | 76 | 'storage' => 'files', |
77 | - 'path' => root . '/Private/Cache' |
|
77 | + 'path' => root.'/Private/Cache' |
|
78 | 78 | ]); |
79 | 79 | return CacheManager::getInstance('files'); |
80 | 80 | }, |
@@ -1,9 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -use Ffcms\Core\Helper\Date; |
|
4 | 3 | use Ffcms\Core\Helper\HTML\Form; |
5 | 4 | use Ffcms\Core\Helper\Simplify; |
6 | -use Ffcms\Core\Helper\Type\Str; |
|
7 | 5 | use Ffcms\Core\Helper\Url; |
8 | 6 | |
9 | 7 | /** @var $model Apps\Model\Front\Profile\FormIgnoreDelete */ |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php return [ |
2 | - 'Alias' => [ |
|
3 | - 'Front' => [ |
|
4 | - '/' => '/content/list/news' |
|
5 | - ] |
|
6 | - ] |
|
2 | + 'Alias' => [ |
|
3 | + 'Front' => [ |
|
4 | + '/' => '/content/list/news' |
|
5 | + ] |
|
6 | + ] |
|
7 | 7 | ]; |
8 | 8 | \ No newline at end of file |
@@ -95,5 +95,5 @@ |
||
95 | 95 | </div> |
96 | 96 | <?php if (count($staticItems) < 1 && count($dynamicItems) < 1): ?> |
97 | 97 | <p class="alert alert-warning"><?= __('Custom routes is not yet found') ?></p> |
98 | -<?php endif ;?> |
|
99 | -<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> ' . __('New route'), ['class' => 'btn btn-primary']) ?> |
|
100 | 98 | \ No newline at end of file |
99 | +<?php endif; ?> |
|
100 | +<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> '.__('New route'), ['class' => 'btn btn-primary']) ?> |
|
101 | 101 | \ No newline at end of file |
@@ -52,16 +52,16 @@ discard block |
||
52 | 52 | $this->data[$lang][] = [ |
53 | 53 | 'uri' => Url::standaloneUrl($uri, $lang), |
54 | 54 | 'lastmod' => Date::convertToDatetime($lastmod, 'c'), |
55 | - 'freq' => (string)$freq, |
|
56 | - 'priority' => (float)$priority |
|
55 | + 'freq' => (string) $freq, |
|
56 | + 'priority' => (float) $priority |
|
57 | 57 | ]; |
58 | 58 | } |
59 | 59 | } else { // only one language, multilanguage is disabled |
60 | 60 | $this->data[App::$Properties->get('singleLanguage')][] = [ |
61 | 61 | 'uri' => Url::standaloneUrl($uri), |
62 | 62 | 'lastmod' => Date::convertToDatetime($lastmod, 'c'), |
63 | - 'freq' => (string)$freq, |
|
64 | - 'priority' => (float)$priority |
|
63 | + 'freq' => (string) $freq, |
|
64 | + 'priority' => (float) $priority |
|
65 | 65 | ]; |
66 | 66 | } |
67 | 67 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'items' => $items |
87 | 87 | ]); |
88 | 88 | |
89 | - File::write(EntityIndexList::INDEX_PATH . '/' . $uniqueName . '.' . $lang . '.xml', $xml); |
|
89 | + File::write(EntityIndexList::INDEX_PATH.'/'.$uniqueName.'.'.$lang.'.xml', $xml); |
|
90 | 90 | } |
91 | 91 | return true; |
92 | 92 | } |
@@ -1,6 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | use Ffcms\Core\Helper\Date; |
3 | -use Ffcms\Core\Helper\Text; |
|
4 | 3 | use Ffcms\Core\Helper\Url; |
5 | 4 | use Apps\Model\Api\Comments\EntityCommentData; |
6 | 5 |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | $records = null; |
53 | 53 | |
54 | 54 | // set current page and offset |
55 | - $page = (int)$this->request->query->get('page', 0); |
|
55 | + $page = (int) $this->request->query->get('page', 0); |
|
56 | 56 | $cfgs = Serialize::decode($this->application->configs); |
57 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
57 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
58 | 58 | if ($userPerPage < 1) { |
59 | 59 | $userPerPage = 1; |
60 | 60 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | switch ($filter_name) { |
64 | 64 | case 'rating': // rating list, order by rating DESC |
65 | 65 | // check if rating is enabled |
66 | - if ((int)$cfgs['rating'] !== 1) { |
|
66 | + if ((int) $cfgs['rating'] !== 1) { |
|
67 | 67 | throw new NotFoundException(); |
68 | 68 | } |
69 | 69 | $records = (new ProfileRecords())->orderBy('rating', 'DESC'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if (Str::likeEmpty($filter_value)) { |
73 | 73 | throw new NotFoundException(); |
74 | 74 | } |
75 | - $records = (new ProfileRecords())->where('hobby', 'like', '%' . $filter_value . '%'); |
|
75 | + $records = (new ProfileRecords())->where('hobby', 'like', '%'.$filter_value.'%'); |
|
76 | 76 | break; |
77 | 77 | case 'city': |
78 | 78 | if (Str::likeEmpty($filter_value)) { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if ($filter_value === null || !Obj::isLikeInt($filter_value)) { |
85 | 85 | throw new NotFoundException(); |
86 | 86 | } |
87 | - $records = (new ProfileRecords())->where('birthday', 'like', $filter_value . '-%'); |
|
87 | + $records = (new ProfileRecords())->where('birthday', 'like', $filter_value.'-%'); |
|
88 | 88 | break; |
89 | 89 | case 'all': |
90 | 90 | $records = (new ProfileRecords())->orderBy('id', 'DESC'); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'pagination' => $pagination, |
108 | 108 | 'id' => $filter_name, |
109 | 109 | 'add' => $filter_value, |
110 | - 'ratingOn' => (int)$cfgs['rating'] |
|
110 | + 'ratingOn' => (int) $cfgs['rating'] |
|
111 | 111 | ]); |
112 | 112 | } |
113 | 113 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public function actionShow($userId) |
124 | 124 | { |
125 | 125 | $cfg = Serialize::decode($this->application->configs); |
126 | - if ((int)$cfg['guestView'] !== 1 && !App::$User->isAuth()) { |
|
126 | + if ((int) $cfg['guestView'] !== 1 && !App::$User->isAuth()) { |
|
127 | 127 | throw new ForbiddenException(__('You must login to view other profile')); |
128 | 128 | } |
129 | 129 | // check if target exists |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | App::$Session->getFlashBag()->add('error', __('This user are in your black list or you are in blacklist!')); |
146 | 146 | } else { |
147 | 147 | // check if message added |
148 | - if ($wallModel->makePost($targetPersone, $viewerPersone, (int)$cfg['delayBetweenPost'])) { |
|
148 | + if ($wallModel->makePost($targetPersone, $viewerPersone, (int) $cfg['delayBetweenPost'])) { |
|
149 | 149 | App::$Session->getFlashBag()->add('success', __('The message was successful posted!')); |
150 | 150 | } else { |
151 | 151 | App::$Session->getFlashBag()->add('warning', __('Posting message was failed! Please, wait few seconds')); |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | |
157 | 157 | $query = $targetPersone->getWall(); // relation hasMany from users to walls |
158 | 158 | // pagination and query params |
159 | - $wallPage = (int)$this->request->query->get('page'); |
|
160 | - $wallItems = (int)$cfg['wallPostOnPage']; |
|
159 | + $wallPage = (int) $this->request->query->get('page'); |
|
160 | + $wallItems = (int) $cfg['wallPostOnPage']; |
|
161 | 161 | $wallOffset = $wallPage * $wallItems; |
162 | 162 | |
163 | 163 | // build pagination |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | 'notify' => App::$Session->getFlashBag()->all(), |
180 | 180 | 'wallRecords' => $wallRecords, |
181 | 181 | 'pagination' => $wallPagination, |
182 | - 'ratingOn' => (int)$cfg['rating'] === 1 |
|
182 | + 'ratingOn' => (int) $cfg['rating'] === 1 |
|
183 | 183 | ]); |
184 | 184 | } |
185 | 185 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $wallModel = new FormWallPostDelete($wallPost); |
252 | 252 | if ($wallModel->send() && $wallModel->validate()) { |
253 | 253 | $wallModel->make(); |
254 | - $this->response->redirect('profile/show/' . $wallPost->target_id); |
|
254 | + $this->response->redirect('profile/show/'.$wallPost->target_id); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | return $this->view->render('wall_delete', [ |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | } |
292 | 292 | |
293 | 293 | // get page index and current user object |
294 | - $page = (int)$this->request->query->get('page', 0); |
|
294 | + $page = (int) $this->request->query->get('page', 0); |
|
295 | 295 | $offset = $page * static::NOTIFY_PER_PAGE; |
296 | 296 | $user = App::$User->identity(); |
297 | 297 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | // set user id from ?id= get param if form not sended |
406 | 406 | if (!$model->send()) { |
407 | - $uid = (int)$this->request->query->get('id'); |
|
407 | + $uid = (int) $this->request->query->get('id'); |
|
408 | 408 | if ($uid > 0) { |
409 | 409 | $model->id = $uid; |
410 | 410 | } |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | // get blocked users |
423 | 423 | $records = Blacklist::where('user_id', '=', $user->getId()); |
424 | 424 | |
425 | - $page = (int)$this->request->query->get('page'); |
|
425 | + $page = (int) $this->request->query->get('page'); |
|
426 | 426 | $offset = $page * self::BLOCK_PER_PAGE; |
427 | 427 | |
428 | 428 | // build pagination |
@@ -527,9 +527,9 @@ discard block |
||
527 | 527 | // check if request is sended |
528 | 528 | if ($model->send() && $model->validate()) { |
529 | 529 | // get records from db |
530 | - $records = ProfileRecords::where('nick', 'like', '%' . $model->query . '%'); |
|
531 | - $page = (int)$this->request->query->get('page'); |
|
532 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
530 | + $records = ProfileRecords::where('nick', 'like', '%'.$model->query.'%'); |
|
531 | + $page = (int) $this->request->query->get('page'); |
|
532 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
533 | 533 | if ($userPerPage < 1) { |
534 | 534 | $userPerPage = 1; |
535 | 535 | } |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | 'model' => $model->filter(), |
552 | 552 | 'records' => $records, |
553 | 553 | 'pagination' => $pagination, |
554 | - 'ratingOn' => (int)$cfgs['rating'] |
|
554 | + 'ratingOn' => (int) $cfgs['rating'] |
|
555 | 555 | ]); |
556 | 556 | } |
557 | 557 | |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | // build sitemap from content items via business model |
576 | 576 | $sitemap = new EntityBuildMap($langs); |
577 | 577 | foreach ($profiles->get() as $user) { |
578 | - $sitemap->add('profile/show/' . $user->user_id, $user->updated_at, 'weekly', 0.2); |
|
578 | + $sitemap->add('profile/show/'.$user->user_id, $user->updated_at, 'weekly', 0.2); |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | $sitemap->save('profile'); |