| @@ 336-356 (lines=21) @@ | ||
| 333 | * @return string |
|
| 334 | * @throws SyntaxException |
|
| 335 | */ |
|
| 336 | public function actionSettings() |
|
| 337 | { |
|
| 338 | // init model with config array data |
|
| 339 | $model = new FormSettings($this->getConfigs()); |
|
| 340 | ||
| 341 | // check if form is send |
|
| 342 | if ($model->send()) { |
|
| 343 | if ($model->validate()) { |
|
| 344 | $this->setConfigs($model->getAllProperties()); |
|
| 345 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
|
| 346 | App::$Response->redirect('content/index'); |
|
| 347 | } else { |
|
| 348 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
| 349 | } |
|
| 350 | } |
|
| 351 | ||
| 352 | // draw response |
|
| 353 | return App::$View->render('settings', [ |
|
| 354 | 'model' => $model->export() |
|
| 355 | ]); |
|
| 356 | } |
|
| 357 | } |
|
| @@ 183-200 (lines=18) @@ | ||
| 180 | * @return string |
|
| 181 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
| 182 | */ |
|
| 183 | public function actionSettings() |
|
| 184 | { |
|
| 185 | $model = new FormSettings($this->getConfigs()); |
|
| 186 | ||
| 187 | if ($model->send()) { |
|
| 188 | if ($model->validate()) { |
|
| 189 | $this->setConfigs($model->getAllProperties()); |
|
| 190 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
|
| 191 | App::$Response->redirect('profile/index'); |
|
| 192 | } else { |
|
| 193 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
| 194 | } |
|
| 195 | } |
|
| 196 | ||
| 197 | return App::$View->render('settings', [ |
|
| 198 | 'model' => $model |
|
| 199 | ]); |
|
| 200 | } |
|
| 201 | ||
| 202 | ||
| 203 | } |
|
| @@ 162-181 (lines=20) @@ | ||
| 159 | * User identity settings |
|
| 160 | * @return string |
|
| 161 | */ |
|
| 162 | public function actionSettings() |
|
| 163 | { |
|
| 164 | // load model and pass property's as argument |
|
| 165 | $model = new FormUserSettings($this->getConfigs()); |
|
| 166 | ||
| 167 | if ($model->send()) { |
|
| 168 | if ($model->validate()) { |
|
| 169 | $this->setConfigs($model->getAllProperties()); |
|
| 170 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
|
| 171 | App::$Response->redirect('user/index'); |
|
| 172 | } else { |
|
| 173 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
| 174 | } |
|
| 175 | } |
|
| 176 | ||
| 177 | // render view |
|
| 178 | return App::$View->render('settings', [ |
|
| 179 | 'model' => $model->export() |
|
| 180 | ]); |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * Send invite to user by email |
|
| @@ 66-86 (lines=21) @@ | ||
| 63 | * @return string |
|
| 64 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
| 65 | */ |
|
| 66 | public function actionSettings() |
|
| 67 | { |
|
| 68 | // initialize settings model |
|
| 69 | $model = new FormSettings($this->getConfigs()); |
|
| 70 | ||
| 71 | // check if form is send |
|
| 72 | if ($model->send()) { |
|
| 73 | if ($model->validate()) { |
|
| 74 | $this->setConfigs($model->getAllProperties()); |
|
| 75 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
|
| 76 | App::$Response->redirect('comments/index'); |
|
| 77 | } else { |
|
| 78 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| 82 | // render view |
|
| 83 | return App::$View->render('settings', [ |
|
| 84 | 'model' => $model |
|
| 85 | ]); |
|
| 86 | } |
|
| 87 | ||
| 88 | ||
| 89 | ||