| @@ 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 |
|
| @@ 233-255 (lines=23) @@ | ||
| 230 | * @return string |
|
| 231 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
| 232 | */ |
|
| 233 | public function actionSettings() |
|
| 234 | { |
|
| 235 | // initialize model and pass configs |
|
| 236 | $model = new FormSettings($this->getConfigs()); |
|
| 237 | ||
| 238 | // check if form is submited to save data |
|
| 239 | if ($model->send()) { |
|
| 240 | // is validation passed? |
|
| 241 | if ($model->validate()) { |
|
| 242 | // save properties |
|
| 243 | $this->setConfigs($model->getAllProperties()); |
|
| 244 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
|
| 245 | App::$Response->redirect('feedback/index'); |
|
| 246 | } else { |
|
| 247 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
| 248 | } |
|
| 249 | } |
|
| 250 | ||
| 251 | // render view |
|
| 252 | return App::$View->render('settings', [ |
|
| 253 | 'model' => $model |
|
| 254 | ]); |
|
| 255 | } |
|
| 256 | ||
| 257 | } |
|
| @@ 115-135 (lines=21) @@ | ||
| 112 | * @return string |
|
| 113 | * @throws \Ffcms\Core\Exception\SyntaxException |
|
| 114 | */ |
|
| 115 | public function actionSettings() |
|
| 116 | { |
|
| 117 | // initialize settings model |
|
| 118 | $model = new FormSettings($this->getConfigs()); |
|
| 119 | ||
| 120 | // check if form is send |
|
| 121 | if ($model->send()) { |
|
| 122 | if ($model->validate()) { |
|
| 123 | $this->setConfigs($model->getAllProperties()); |
|
| 124 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
|
| 125 | App::$Response->redirect('comments/index'); |
|
| 126 | } else { |
|
| 127 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
| 128 | } |
|
| 129 | } |
|
| 130 | ||
| 131 | // render view |
|
| 132 | return App::$View->render('settings', [ |
|
| 133 | 'model' => $model |
|
| 134 | ]); |
|
| 135 | } |
|
| 136 | ||
| 137 | ||
| 138 | ||