| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 | ]); |
||
| 48 |