/** * set user language */ function setUserLanguageObject() { $this->lng->loadLanguageModule("meta"); require_once './Services/User/classes/class.ilObjUser.php'; if (!isset($_POST["id"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } if (count($_POST["id"]) != 1) { $this->ilias->raiseError($this->lng->txt("choose_only_one_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE); } $obj_id = $_POST["id"][0]; $newUserLangObj = new ilObjLanguage($obj_id); if ($newUserLangObj->isUserLanguage()) { $this->ilias->raiseError($this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . " " . $this->lng->txt("is_already_your") . " " . $this->lng->txt("user_language") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE); } if ($newUserLangObj->isInstalled() == false) { $this->ilias->raiseError($this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . " " . $this->lng->txt("language_not_installed") . "<br/>" . $this->lng->txt("action_aborted"), $this->ilias->error_obj->MESSAGE); } $curUser = new ilObjUser($_SESSION["AccountId"]); $curUser->setLanguage($newUserLangObj->getKey()); $curUser->update(); //$this->setUserLanguage($new_lang_key); $this->data = $this->lng->txt("user_language") . " " . $this->lng->txt("changed_to") . " " . $this->lng->txt("meta_l_" . $newUserLangObj->getKey()) . "."; $this->out(); }