| @@ 211-232 (lines=22) @@ | ||
| 208 | * @return string |
|
| 209 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
| 210 | */ |
|
| 211 | public function actionInvite() |
|
| 212 | { |
|
| 213 | // init model |
|
| 214 | $model = new FormInviteSend(); |
|
| 215 | ||
| 216 | if ($model->send()) { |
|
| 217 | if ($model->validate()) { |
|
| 218 | if ($model->make()) { |
|
| 219 | App::$Session->getFlashBag()->add('success', __('Invite was successful send!')); |
|
| 220 | } else { |
|
| 221 | App::$Session->getFlashBag()->add('error', __('Mail server connection is failed!')); |
|
| 222 | } |
|
| 223 | } else { |
|
| 224 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
| 225 | } |
|
| 226 | } |
|
| 227 | ||
| 228 | // render view |
|
| 229 | return $this->view->render('invite', [ |
|
| 230 | 'model' => $model |
|
| 231 | ]); |
|
| 232 | } |
|
| 233 | } |
|
| 234 | ||
| @@ 25-46 (lines=22) @@ | ||
| 22 | * @return string |
|
| 23 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
| 24 | */ |
|
| 25 | public function settings() |
|
| 26 | { |
|
| 27 | // init settings model and process post send |
|
| 28 | $model = new FormSettings(true); |
|
| 29 | if ($model->send()) { |
|
| 30 | if ($model->validate()) { |
|
| 31 | if ($model->makeSave()) { |
|
| 32 | // show message about successful save and take system some time ;) |
|
| 33 | return $this->view->render('settings_save'); |
|
| 34 | } else { |
|
| 35 | App::$Session->getFlashBag()->add('error', __('Configuration file is not writable! Check /Private/Config/ dir and files')); |
|
| 36 | } |
|
| 37 | } else { |
|
| 38 | App::$Session->getFlashBag()->add('error', __('Validation of form data is failed!')); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| 42 | // render output view |
|
| 43 | return $this->view->render('settings', [ |
|
| 44 | 'model' => $model |
|
| 45 | ]); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||