@@ 74-95 (lines=22) @@ | ||
71 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
72 | * @throws \Ffcms\Core\Exception\NativeException |
|
73 | */ |
|
74 | public function actionSettings() |
|
75 | { |
|
76 | // init settings model and process post send |
|
77 | $model = new FormSettings(true); |
|
78 | if ($model->send()) { |
|
79 | if ($model->validate()) { |
|
80 | if ($model->makeSave()) { |
|
81 | // show message about successful save and take system some time ;) |
|
82 | return $this->view->render('settings_save'); |
|
83 | } else { |
|
84 | App::$Session->getFlashBag()->add('error', __('Configuration file is not writable! Check /Private/Config/ dir and files')); |
|
85 | } |
|
86 | } else { |
|
87 | App::$Session->getFlashBag()->add('error', __('Validation of form data is failed!')); |
|
88 | } |
|
89 | } |
|
90 | ||
91 | // render output view |
|
92 | return $this->view->render('settings', [ |
|
93 | 'model' => $model->filter() |
|
94 | ]); |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * Manage files via elFinder |
@@ 216-237 (lines=22) @@ | ||
213 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
214 | * @throws \Ffcms\Core\Exception\NativeException |
|
215 | */ |
|
216 | public function actionInvite() |
|
217 | { |
|
218 | // init model |
|
219 | $model = new FormInviteSend(); |
|
220 | ||
221 | if ($model->send()) { |
|
222 | if ($model->validate()) { |
|
223 | if ($model->make()) { |
|
224 | App::$Session->getFlashBag()->add('success', __('Invite was successful send!')); |
|
225 | } else { |
|
226 | App::$Session->getFlashBag()->add('error', __('Mail server connection is failed!')); |
|
227 | } |
|
228 | } else { |
|
229 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
230 | } |
|
231 | } |
|
232 | ||
233 | // render view |
|
234 | return $this->view->render('invite', [ |
|
235 | 'model' => $model->filter() |
|
236 | ]); |
|
237 | } |
|
238 | } |