private static function getAjaxResponse($model) { $res = new FrameworkResponse(); $res->setStatus(FrameworkResponse::$STATUS__READY); if ($model->getCurrentState() == FrameModUserLoginRegister_Model::$STATE__NO_USER) { $json = array("moduleAction" => "defaultView"); $res->setJson($json); } else { if ($model->getCurrentState() == FrameModUserLoginRegister_Model::$STATE__ADMIN_LOGIN) { $json = array("moduleAction" => "showLoginData", "moduleActionParam" => $model->getLoginUserData()); $res->setJson($json); } else { if ($model->getCurrentState() == FrameModUserLoginRegister_Model::$STATE__INCORRECT_LOGIN) { $json = array("moduleAction" => "showIncorrectLogin", "moduleActionParam" => "Your username or password is incorrect"); $res->setJson($json); } } } return $res; }