From: Matthias Schmidt Date: Wed, 9 Oct 2013 15:05:37 +0000 (+0200) Subject: Fixes name of edited group in group dropdown menu X-Git-Tag: 2.0.0_Beta_11~34^2~3^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=62ef44d1259c8bdf6bf1bc49e460f97c0978df44;p=GitHub%2FWoltLab%2FWCF.git Fixes name of edited group in group dropdown menu --- diff --git a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl index 9a27edbfdd..a771e38ea3 100644 --- a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl @@ -32,7 +32,7 @@ diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php index c58e84af54..b2b9cf8fbb 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php @@ -131,9 +131,14 @@ class UserGroupEditForm extends UserGroupAddForm { if (I18nHandler::getInstance()->isPlainValue('groupName')) { I18nHandler::getInstance()->remove($this->groupName); $this->groupName = I18nHandler::getInstance()->getValue('groupName'); + + UserGroup::getGroupByID($this->groupID)->setName($this->groupName); } else { I18nHandler::getInstance()->save('groupName', $this->groupName, 'wcf.acp.group', 1); + + $groupNames = I18nHandler::getInstance()->getValues('groupName'); + UserGroup::getGroupByID($this->groupID)->setName($groupNames[WCF::getLanguage()->languageID]); } $this->groupDescription = 'wcf.acp.group.groupDescription'.$this->group->groupID; if (I18nHandler::getInstance()->isPlainValue('groupDescription')) { diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php index ed50757344..bf99256946 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php @@ -248,6 +248,18 @@ class UserGroup extends DatabaseObject { return WCF::getLanguage()->get($this->groupName); } + /** + * Sets the name of this user group. + * + * This method is only needed to set the current name of it has been changed + * in the same request. + * + * @param string $name + */ + public function setName($name) { + $this->data['groupName'] = $name; + } + /** * Returns true if current user may delete this group. *