Exemplo n.º 1
0
 public function settingsFormSucceeded($form, $values)
 {
     $id = $this->user->id;
     $data = $this->model->getSelection()->get($id);
     if ($data) {
         try {
             unset($values->user_id);
             $this->model->storeSettings($id, $values);
             $this->user->getIdentity()->settings = $values;
             $this->flashMessage("Nastavení bylo uloženo.", "success");
         } catch (Exception $e) {
             $this->flashMessage("Uložení nastavení se nepodařilo.", "danger");
         }
     } else {
         $this->flashMessage("Takový uživatel neexistuje.", "warning");
     }
     $this->redirect("default");
 }