@@ -2,6 +2,6 @@ |
||
2 | 2 | use Ffcms\Core\Helper\Url; |
3 | 3 | |
4 | 4 | if (isset($controller)): ?> |
5 | -<a href="<?= Url::to($controller . '/index') ?>"><i class="fa fa-cogs"></i></a> |
|
5 | +<a href="<?= Url::to($controller.'/index') ?>"><i class="fa fa-cogs"></i></a> |
|
6 | 6 | <a href="<?= Url::to('widget/turn', $controller) ?>"><i class="fa fa-power-off"></i></a> |
7 | 7 | <?php endif; ?> |
8 | 8 | \ 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 | /** |
@@ -35,9 +35,9 @@ |
||
35 | 35 | $classHash = $this->createStringClassSnapshotHash(); |
36 | 36 | |
37 | 37 | $records = null; |
38 | - if ((int)$this->cache > 0) { |
|
39 | - if (App::$Cache->get('widget.newcomment.' . $classHash) !== null) { |
|
40 | - $records = App::$Cache->get('widget.newcomment.' . $classHash); |
|
38 | + if ((int) $this->cache > 0) { |
|
39 | + if (App::$Cache->get('widget.newcomment.'.$classHash) !== null) { |
|
40 | + $records = App::$Cache->get('widget.newcomment.'.$classHash); |
|
41 | 41 | } else { |
42 | 42 | $records = $this->makeQuery(); |
43 | 43 | } |
@@ -27,9 +27,9 @@ |
||
27 | 27 | */ |
28 | 28 | public function before() |
29 | 29 | { |
30 | - $this->snippet = (int)$this->_configs['snippet']; |
|
31 | - $this->count = (int)$this->_configs['count']; |
|
32 | - $this->cache = (int)$this->_configs['cache']; |
|
30 | + $this->snippet = (int) $this->_configs['snippet']; |
|
31 | + $this->count = (int) $this->_configs['count']; |
|
32 | + $this->cache = (int) $this->_configs['cache']; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -35,15 +35,15 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | // convert id to real integer |
38 | - $user_id = (int)$user_id; |
|
38 | + $user_id = (int) $user_id; |
|
39 | 39 | |
40 | 40 | if (!Obj::isInt($user_id) || $user_id < 1) { |
41 | 41 | return null; |
42 | 42 | } |
43 | 43 | |
44 | 44 | // check in memory cache object |
45 | - if (MainApp::$Memory->get('user.object.cache.' . $user_id) !== null) { |
|
46 | - return MainApp::$Memory->get('user.object.cache.' . $user_id); |
|
45 | + if (MainApp::$Memory->get('user.object.cache.'.$user_id) !== null) { |
|
46 | + return MainApp::$Memory->get('user.object.cache.'.$user_id); |
|
47 | 47 | } |
48 | 48 | // not founded in memory? lets make query |
49 | 49 | $user = self::find($user_id); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // store cache and return object |
56 | - MainApp::$Memory->set('user.object.cache.' . $user->id, $user); |
|
56 | + MainApp::$Memory->set('user.object.cache.'.$user->id, $user); |
|
57 | 57 | return $user; |
58 | 58 | } |
59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function getId() |
65 | 65 | { |
66 | - return (int)$this->id; |
|
66 | + return (int) $this->id; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public static function isAuth() |
85 | 85 | { |
86 | 86 | // get data from session |
87 | - $sessionUserId = (int)MainApp::$Session->get('ff_user_id', 0); |
|
87 | + $sessionUserId = (int) MainApp::$Session->get('ff_user_id', 0); |
|
88 | 88 | |
89 | 89 | // check if session contains user id data |
90 | 90 | if ($sessionUserId < 1) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | return false; |
104 | 104 | } |
105 | 105 | |
106 | - return ((int)$identity->id > 0 && (int)$identity->id === $sessionUserId); |
|
106 | + return ((int) $identity->id > 0 && (int) $identity->id === $sessionUserId); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | // convert id to real integer |
121 | - $id = (int)$id; |
|
121 | + $id = (int) $id; |
|
122 | 122 | |
123 | - $find = MainApp::$Memory->get('user.counter.cache.' . $id); |
|
123 | + $find = MainApp::$Memory->get('user.counter.cache.'.$id); |
|
124 | 124 | if ($find === null) { |
125 | 125 | $find = self::where('id', '=', $id)->count(); |
126 | - MainApp::$Memory->set('user.counter.cache.' . $id, $find); |
|
126 | + MainApp::$Memory->set('user.counter.cache.'.$id, $find); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | return $find === 1; |
@@ -5,28 +5,28 @@ |
||
5 | 5 | } |
6 | 6 | |
7 | 7 | // require all tables |
8 | -require_once(root . '/Private/Database/Tables/App.php'); |
|
9 | -require_once(root . '/Private/Database/Tables/Blacklist.php'); |
|
10 | -require_once(root . '/Private/Database/Tables/CommentAnswer.php'); |
|
11 | -require_once(root . '/Private/Database/Tables/CommentPost.php'); |
|
12 | -require_once(root . '/Private/Database/Tables/Content.php'); |
|
13 | -require_once(root . '/Private/Database/Tables/ContentCategory.php'); |
|
14 | -require_once(root . '/Private/Database/Tables/ContentRating.php'); |
|
15 | -require_once(root . '/Private/Database/Tables/ContentTag.php'); |
|
16 | -require_once(root . '/Private/Database/Tables/FeedbackAnswer.php'); |
|
17 | -require_once(root . '/Private/Database/Tables/FeedbackPost.php'); |
|
18 | -require_once(root . '/Private/Database/Tables/Invite.php'); |
|
19 | -require_once(root . '/Private/Database/Tables/Message.php'); |
|
20 | -require_once(root . '/Private/Database/Tables/Profile.php'); |
|
21 | -require_once(root . '/Private/Database/Tables/ProfileField.php'); |
|
22 | -require_once(root . '/Private/Database/Tables/ProfileRating.php'); |
|
23 | -require_once(root . '/Private/Database/Tables/Role.php'); |
|
24 | -require_once(root . '/Private/Database/Tables/Session.php'); |
|
25 | -require_once(root . '/Private/Database/Tables/User.php'); |
|
26 | -require_once(root . '/Private/Database/Tables/UserLog.php'); |
|
27 | -require_once(root . '/Private/Database/Tables/UserRecovery.php'); |
|
28 | -require_once(root . '/Private/Database/Tables/WallPost.php'); |
|
29 | -require_once(root . '/Private/Database/Tables/WallAnswer.php'); |
|
8 | +require_once(root.'/Private/Database/Tables/App.php'); |
|
9 | +require_once(root.'/Private/Database/Tables/Blacklist.php'); |
|
10 | +require_once(root.'/Private/Database/Tables/CommentAnswer.php'); |
|
11 | +require_once(root.'/Private/Database/Tables/CommentPost.php'); |
|
12 | +require_once(root.'/Private/Database/Tables/Content.php'); |
|
13 | +require_once(root.'/Private/Database/Tables/ContentCategory.php'); |
|
14 | +require_once(root.'/Private/Database/Tables/ContentRating.php'); |
|
15 | +require_once(root.'/Private/Database/Tables/ContentTag.php'); |
|
16 | +require_once(root.'/Private/Database/Tables/FeedbackAnswer.php'); |
|
17 | +require_once(root.'/Private/Database/Tables/FeedbackPost.php'); |
|
18 | +require_once(root.'/Private/Database/Tables/Invite.php'); |
|
19 | +require_once(root.'/Private/Database/Tables/Message.php'); |
|
20 | +require_once(root.'/Private/Database/Tables/Profile.php'); |
|
21 | +require_once(root.'/Private/Database/Tables/ProfileField.php'); |
|
22 | +require_once(root.'/Private/Database/Tables/ProfileRating.php'); |
|
23 | +require_once(root.'/Private/Database/Tables/Role.php'); |
|
24 | +require_once(root.'/Private/Database/Tables/Session.php'); |
|
25 | +require_once(root.'/Private/Database/Tables/User.php'); |
|
26 | +require_once(root.'/Private/Database/Tables/UserLog.php'); |
|
27 | +require_once(root.'/Private/Database/Tables/UserRecovery.php'); |
|
28 | +require_once(root.'/Private/Database/Tables/WallPost.php'); |
|
29 | +require_once(root.'/Private/Database/Tables/WallAnswer.php'); |
|
30 | 30 | |
31 | 31 | // insert demo content |
32 | -require_once (root . '/Private/Database/Other/DemoContent.php'); |
|
33 | 32 | \ No newline at end of file |
33 | +require_once (root.'/Private/Database/Other/DemoContent.php'); |
|
34 | 34 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | <ul class="list-inline list-info"> |
23 | 23 | <li><i class="fa fa-calendar"></i> <?= $data['date'] ?></li> |
24 | 24 | <li><i class="fa fa-user"></i> |
25 | - <?php if ((int)$data['user']['id'] > 0): ?> |
|
25 | + <?php if ((int) $data['user']['id'] > 0): ?> |
|
26 | 26 | <?= Url::link(['profile/show', $data['user']['id']], $data['user']['name']) ?> |
27 | 27 | <?php else: ?> |
28 | 28 | <?= $data['user']['name'] ?> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | <img class="media-object img-responsive" src="<?= $data['user']['avatar']?>" style="width: 64px; height: 64px;" alt="Picture of user <?= $data['user']['name'] ?>"> |
36 | 36 | </span> |
37 | 37 | <div class="media-body"> |
38 | - <a href="<?= \App::$Alias->baseUrl . $data['pathway'] . '#comment-list' ?>"><?= $data['text'] ?></a> |
|
38 | + <a href="<?= \App::$Alias->baseUrl.$data['pathway'].'#comment-list' ?>"><?= $data['text'] ?></a> |
|
39 | 39 | </div> |
40 | 40 | </li> |
41 | 41 | </ul> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <h1><?= __('Feedback list') ?></h1> |
24 | 24 | <hr /> |
25 | 25 | <?php if ($records === null || $records->count() < 1) { |
26 | - echo '<p class="alert alert-warning">' . __('Feedback requests is empty now!') . '</p>'; |
|
26 | + echo '<p class="alert alert-warning">'.__('Feedback requests is empty now!').'</p>'; |
|
27 | 27 | return; |
28 | 28 | } |
29 | 29 | |
@@ -31,17 +31,16 @@ discard block |
||
31 | 31 | foreach ($records as $item) { |
32 | 32 | /** @var \Apps\ActiveRecord\FeedbackPost $item*/ |
33 | 33 | $items[] = [ |
34 | - ['text' => $item->id . ((int)$item->readed !== 1 ? ' <i class="fa fa-bell alert-info"></i>' : null), 'html' => true], |
|
34 | + ['text' => $item->id.((int) $item->readed !== 1 ? ' <i class="fa fa-bell alert-info"></i>' : null), 'html' => true], |
|
35 | 35 | ['text' => Url::link(['feedback/read', $item->id], Text::snippet($item->message, 40, false)), 'html' => true], |
36 | 36 | ['text' => $item->getAnswers()->count()], |
37 | 37 | ['text' => $item->email], |
38 | 38 | ['text' => |
39 | - (int)$item->closed === 1 ? |
|
40 | - '<span class="label label-danger">' . __('Closed') . '</span>' : |
|
41 | - '<span class="label label-success">' . __('Opened') . '</span>', |
|
39 | + (int) $item->closed === 1 ? |
|
40 | + '<span class="label label-danger">'.__('Closed').'</span>' : '<span class="label label-success">'.__('Opened').'</span>', |
|
42 | 41 | 'html' => true, '!secure' => true], |
43 | 42 | ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)], |
44 | - ['text' => Url::link(['feedback/read', $item->id], '<i class="fa fa-list fa-lg"></i> ') . |
|
43 | + ['text' => Url::link(['feedback/read', $item->id], '<i class="fa fa-list fa-lg"></i> '). |
|
45 | 44 | Url::link(['feedback/delete', 'post', $item->id], '<i class="fa fa-trash-o fa-lg"></i>'), |
46 | 45 | 'html' => true, 'property' => ['class' => 'text-center']] |
47 | 46 | ]; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $author = Url::link(['user/update', $record->user_id], $author); |
29 | 29 | } |
30 | 30 | ?> |
31 | - <?= $author . ', ' . Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?> |
|
31 | + <?= $author.', '.Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?> |
|
32 | 32 | <div class="pull-right"> |
33 | 33 | <?= Url::link(['comments/edit', 'comment', $record->id], __('Edit'), ['class' => 'label label-primary']) ?> |
34 | 34 | <?= Url::link(['comments/delete', 'comment', $record->id], __('Delete'), ['class' => 'label label-danger']) ?> |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | <?php |
56 | 56 | $answerAuthor = Simplify::parseUserLink($answer->user_id, $answer->guest_name, 'user/update'); |
57 | 57 | ?> |
58 | - <?= $answerAuthor . ', ' . Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?> |
|
58 | + <?= $answerAuthor.', '.Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?> |
|
59 | 59 | <div class="pull-right"> |
60 | 60 | <?= Url::link(['comments/edit', 'answer', $answer->id], __('Edit'), ['class' => 'label label-primary']) ?> |
61 | 61 | <?= Url::link(['comments/delete', 'answer', $answer->id], __('Delete'), ['class' => 'label label-danger']) ?> |