File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
wcfsetup/install/files/lib Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public function createForm()
6666 TextFormField::create ('rankTitle ' )
6767 ->label ('wcf.acp.user.rank.title ' )
6868 ->i18n ()
69- ->languageItemPattern ('wcf.user.rank.userRank\d + ' )
69+ ->languageItemPattern ('wcf.user.rank.\w + ' )
7070 ->required (),
7171 BadgeColorFormField::create ('cssClassName ' )
7272 ->label ('wcf.acp.user.rank.cssClassName ' )
Original file line number Diff line number Diff line change 33namespace wcf \data \user \rank ;
44
55use wcf \data \AbstractDatabaseObjectAction ;
6+ use wcf \data \TI18nDatabaseObjectAction ;
67use wcf \system \exception \InvalidObjectArgument ;
78use wcf \system \file \upload \UploadFile ;
89
1819 */
1920class UserRankAction extends AbstractDatabaseObjectAction
2021{
22+ use TI18nDatabaseObjectAction;
23+
2124 /**
2225 * @inheritDoc
2326 */
@@ -36,6 +39,8 @@ public function create()
3639 /** @var UserRank $rank */
3740 $ rank = parent ::create ();
3841
42+ $ this ->saveI18nValue ($ rank );
43+
3944 if (isset ($ this ->parameters ['rankImageFile ' ]) && !empty ($ this ->parameters ['rankImageFile ' ])) {
4045 $ rankImageFile = \reset ($ this ->parameters ['rankImageFile ' ]);
4146
@@ -119,5 +124,32 @@ public function update()
119124 }
120125
121126 parent ::update ();
127+
128+ foreach ($ this ->objects as $ object ) {
129+ $ this ->saveI18nValue ($ object ->getDecoratedObject ());
130+ }
131+ }
132+
133+ #[\Override]
134+ public function delete ()
135+ {
136+ parent ::delete ();
137+
138+ $ this ->deleteI18nValues ();
139+ }
140+
141+ public function getI18nSaveTypes (): array
142+ {
143+ return ['rankTitle ' => 'wcf.user.rank.userRank\d+ ' ];
144+ }
145+
146+ public function getLanguageCategory (): string
147+ {
148+ return 'wcf.user.rank ' ;
149+ }
150+
151+ public function getPackageID (): int
152+ {
153+ return PACKAGE_ID ;
122154 }
123155}
You can’t perform that action at this time.
0 commit comments