@@ -57,7 +57,7 @@ |
||
57 | 57 | <?php |
58 | 58 | $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post', 'action' => '']); |
59 | 59 | echo $form->start(); |
60 | - echo $form->submitButton(__('Delete'), ['class' => 'btn btn-danger']) . " "; |
|
60 | + echo $form->submitButton(__('Delete'), ['class' => 'btn btn-danger'])." "; |
|
61 | 61 | echo Url::link(['user/index'], __('Cancel'), ['class' => 'btn btn-default']); |
62 | 62 | echo $form->finish(); |
63 | 63 | ?> |
64 | 64 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public function actionIndex() |
34 | 34 | { |
35 | 35 | // set current page and offset |
36 | - $page = (int)$this->request->query->get('page'); |
|
36 | + $page = (int) $this->request->query->get('page'); |
|
37 | 37 | $offset = $page * self::ITEM_PER_PAGE; |
38 | 38 | |
39 | 39 | // get feedback posts AR table |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | // initialize model with answer add if thread is not closed |
77 | 77 | $model = null; |
78 | - if ((int)$record->closed !== 1) { |
|
78 | + if ((int) $record->closed !== 1) { |
|
79 | 79 | $model = new FormAnswerAdd($record, App::$User->identity()->getId()); |
80 | 80 | if ($model->send()) { |
81 | 81 | if ($model->validate()) { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | case 'answer': |
116 | 116 | $record = FeedbackAnswer::find($id); |
117 | 117 | if ($record !== null && $record !== false) { |
118 | - $postId = (int)$record->getFeedbackPost()->id; |
|
118 | + $postId = (int) $record->getFeedbackPost()->id; |
|
119 | 119 | } |
120 | 120 | break; |
121 | 121 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($model->validate()) { |
132 | 132 | $model->make(); |
133 | 133 | App::$Session->getFlashBag()->add('success', __('Feedback item are successful changed')); |
134 | - $this->response->redirect('feedback/read/' . $postId); |
|
134 | + $this->response->redirect('feedback/read/'.$postId); |
|
135 | 135 | } else { |
136 | 136 | App::$Session->getFlashBag()->add('danger', __('Updating is failed')); |
137 | 137 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | App::$Session->getFlashBag()->add('success', __('Feedback request is changed!')); |
182 | 182 | |
183 | 183 | // redirect to feedback post read |
184 | - $this->response->redirect('feedback/read/' . $id); |
|
184 | + $this->response->redirect('feedback/read/'.$id); |
|
185 | 185 | return null; |
186 | 186 | } |
187 | 187 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | // its a answer, lets remove it and redirect back in post |
227 | 227 | $postId = $record->feedback_id; |
228 | 228 | $record->delete(); |
229 | - $this->response->redirect('feedback/read/' . $postId); |
|
229 | + $this->response->redirect('feedback/read/'.$postId); |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 |
@@ -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); |
@@ -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), |
@@ -43,7 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | // remove gallery files if exists |
45 | 45 | foreach ($this->_records->get() as $record) { |
46 | - $galleryPath = '/upload/gallery/' . (int)$record->id; |
|
46 | + $galleryPath = '/upload/gallery/'.(int) $record->id; |
|
47 | 47 | if (Directory::exist($galleryPath)) { |
48 | 48 | Directory::remove($galleryPath); |
49 | 49 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | { |
71 | 71 | $password = App::$Security->password_hash($this->password); |
72 | 72 | |
73 | - $search = App::$User->where('password', '=', $password)->where(function ($query) { |
|
73 | + $search = App::$User->where('password', '=', $password)->where(function($query) { |
|
74 | 74 | $query->where('login', '=', $this->login) |
75 | 75 | ->orWhere('email', '=', $this->login); |
76 | 76 | }); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | // labels for custom fields |
73 | 73 | foreach (ProfileField::all() as $custom) { |
74 | - $labels['custom_data.' . $custom->id] = $custom->getLocaled('name'); |
|
74 | + $labels['custom_data.'.$custom->id] = $custom->getLocaled('name'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $labels; |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | // custom profile fields |
98 | 98 | foreach (ProfileField::all() as $custom) { |
99 | 99 | $rules[] = [ |
100 | - 'custom_data.' . $custom->id, |
|
100 | + 'custom_data.'.$custom->id, |
|
101 | 101 | 'used' |
102 | 102 | ]; |
103 | 103 | $rules[] = [ |
104 | - 'custom_data.' . $custom->id, |
|
105 | - (int)$custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
104 | + 'custom_data.'.$custom->id, |
|
105 | + (int) $custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
106 | 106 | $custom->reg_exp |
107 | 107 | ]; |
108 | 108 | } |