Beispiel #1
0
 public function actionLogout()
 {
     $redirect = '/';
     if (isset($_GET['redirect'])) {
         $redirect = $_GET['redirect'];
     }
     $this->logout();
     Notif::info(static::MSG_LOGOUT_VALID);
     \Staq\Util::httpRedirectUri($redirect);
 }
Beispiel #2
0
 protected function genericActionEdit($type, $model)
 {
     if (isset($_POST['model'])) {
         foreach ($_POST['model'] as $name => $value) {
             $model->set($name, $value);
         }
         $this->saveHandler($model);
         if ($model->save()) {
             Notif::success('Model saved.');
         } else {
             Notif::error('Model not saved.');
         }
         $this->redirectPreview($type, $model);
     }
     $view = $this->createView('edit', $type);
     $view['model'] = $model;
     return $view;
 }
Beispiel #3
0
 protected function addVariables()
 {
     $this['UINotification'] = \Stack\Util\UINotification::pull();
 }