@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php return [ |
| 2 | - 'Alias' => [ |
|
| 3 | - 'Front' => [ |
|
| 4 | - '/about' => '/content/read/page/about-page' |
|
| 5 | - ] |
|
| 6 | - ], |
|
| 7 | - 'Callback' => [ |
|
| 8 | - 'Front' => [ |
|
| 9 | - 'Demo' => '\Apps\Controller\Front\Main' |
|
| 10 | - ] |
|
| 11 | - ] |
|
| 2 | + 'Alias' => [ |
|
| 3 | + 'Front' => [ |
|
| 4 | + '/about' => '/content/read/page/about-page' |
|
| 5 | + ] |
|
| 6 | + ], |
|
| 7 | + 'Callback' => [ |
|
| 8 | + 'Front' => [ |
|
| 9 | + 'Demo' => '\Apps\Controller\Front\Main' |
|
| 10 | + ] |
|
| 11 | + ] |
|
| 12 | 12 | ]; |
| 13 | 13 | \ No newline at end of file |
@@ -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 [ |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | </li> |
| 55 | 55 | </ul> |
| 56 | 56 | |
| 57 | -<?php if ((int)$configs['guestAdd'] === 1 || \App::$User->isAuth()): ?> |
|
| 57 | +<?php if ((int) $configs['guestAdd'] === 1 || \App::$User->isAuth()): ?> |
|
| 58 | 58 | <!-- comment form --> |
| 59 | 59 | <form name="comment-add-form" action="" method="post" style="padding-top: 15px;" class="form-horizontal"> |
| 60 | 60 | <input type="hidden" name="replay-to" value="0" /> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function check() |
| 57 | 57 | { |
| 58 | 58 | // check if user is auth'd or guest name is defined |
| 59 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 59 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 60 | 60 | throw new JsonException(__('Guest name is not defined')); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // check if message length is correct |
| 69 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
| 69 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
| 70 | 70 | throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [ |
| 71 | 71 | 'cur' => Str::length($this->message), |
| 72 | 72 | 'min' => $this->_configs['minLength'], |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function check() |
| 57 | 57 | { |
| 58 | 58 | // check if user is auth'd or guest name is defined |
| 59 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 59 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 60 | 60 | throw new JsonException(__('Guest name is not defined')); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // check if message length is correct |
| 69 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
| 69 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
| 70 | 70 | throw new JsonException(__('Message length is incorrect. Current: %cur% , min - %min%, max - %max%', [ |
| 71 | 71 | 'cur' => Str::length($this->message), |
| 72 | 72 | 'min' => $this->_configs['minLength'], |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | foreach ($records as $item) { |
| 32 | 32 | $message = Text::cut(\App::$Security->strip_tags($item->message), 0, 75); |
| 33 | 33 | $userArr = []; |
| 34 | - if ((int)$item->user_id > 0 && \App::$User->isExist($item->user_id)) { |
|
| 34 | + if ((int) $item->user_id > 0 && \App::$User->isExist($item->user_id)) { |
|
| 35 | 35 | $userName = \App::$User->identity($item->user_id)->getProfile()->getNickname(); |
| 36 | 36 | $userArr = ['text' => Url::link(['user/update', $item->user_id], $userName), 'html' => true]; |
| 37 | 37 | } |
@@ -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 */ |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function actionIndex() |
| 33 | 33 | { |
| 34 | 34 | // set current page and offset |
| 35 | - $page = (int)App::$Request->query->get('page'); |
|
| 35 | + $page = (int) App::$Request->query->get('page'); |
|
| 36 | 36 | $offset = $page * self::ITEM_PER_PAGE; |
| 37 | 37 | |
| 38 | 38 | // get feedback posts AR table |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // initialize model with answer add if thread is not closed |
| 75 | 75 | $model = null; |
| 76 | - if ((int)$record->closed !== 1) { |
|
| 76 | + if ((int) $record->closed !== 1) { |
|
| 77 | 77 | $model = new FormAnswerAdd($record, App::$User->identity()->getId()); |
| 78 | 78 | if ($model->send()) { |
| 79 | 79 | if ($model->validate()) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | case 'answer': |
| 105 | 105 | $record = FeedbackAnswer::find($id); |
| 106 | 106 | if ($record !== null && $record !== false) { |
| 107 | - $postId = (int)$record->getFeedbackPost()->id; |
|
| 107 | + $postId = (int) $record->getFeedbackPost()->id; |
|
| 108 | 108 | } |
| 109 | 109 | break; |
| 110 | 110 | } |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | // get configs |
| 42 | 42 | $configs = $this->getConfigs(); |
| 43 | - if (!App::$User->isAuth() && (int)$configs['guestAdd'] !== 1) { |
|
| 43 | + if (!App::$User->isAuth() && (int) $configs['guestAdd'] !== 1) { |
|
| 44 | 44 | throw new ForbiddenException(__('Feedback available only for authorized users')); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // initialize model |
| 48 | - $model = new FormFeedbackAdd((int)$configs['useCaptcha'] === 1); |
|
| 48 | + $model = new FormFeedbackAdd((int) $configs['useCaptcha'] === 1); |
|
| 49 | 49 | if ($model->send()) { |
| 50 | 50 | if ($model->validate()) { |
| 51 | 51 | // if validation is passed save data to db and get row |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // render output view |
| 62 | 62 | return App::$View->render('create', [ |
| 63 | 63 | 'model' => $model->export(), |
| 64 | - 'useCaptcha' => (int)$configs['useCaptcha'] === 1 |
|
| 64 | + 'useCaptcha' => (int) $configs['useCaptcha'] === 1 |
|
| 65 | 65 | ]); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $userId = App::$User->isAuth() ? App::$User->identity()->getId() : 0; |
| 93 | 93 | $model = null; |
| 94 | 94 | // check if feedback post is not closed for answers |
| 95 | - if ((int)$recordPost->closed === 0) { |
|
| 95 | + if ((int) $recordPost->closed === 0) { |
|
| 96 | 96 | // init new answer add model |
| 97 | 97 | $model = new FormAnswerAdd($recordPost, $userId); |
| 98 | 98 | // if answer is sender lets try to make it model |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | // check if action is submited |
| 128 | 128 | if (App::$Request->request->get('closeRequest', false)) { |
| 129 | 129 | // if created by authorized user |
| 130 | - if ((int)$record->user_id !== 0) { |
|
| 130 | + if ((int) $record->user_id !== 0) { |
|
| 131 | 131 | $user = App::$User->identity(); |
| 132 | 132 | // button is pressed not by request creator |
| 133 | - if ($user === null || $user->getId() !== (int)$record->user_id) { |
|
| 133 | + if ($user === null || $user->getId() !== (int) $record->user_id) { |
|
| 134 | 134 | throw new ForbiddenException(__('This feedback request was created by another user')); |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | public function actionList() |
| 157 | 157 | { |
| 158 | 158 | // set current page and offset |
| 159 | - $page = (int)App::$Request->query->get('page'); |
|
| 159 | + $page = (int) App::$Request->query->get('page'); |
|
| 160 | 160 | $offset = $page * self::ITEM_PER_PAGE; |
| 161 | 161 | |
| 162 | 162 | // check if user is authorized or throw exception |