use wcf\event\IPsr14Event;
use wcf\system\view\grid\action\DeleteAction;
use wcf\system\view\grid\action\EditAction;
+use wcf\system\view\grid\filter\I18nTextFilter;
+use wcf\system\view\grid\filter\SelectFilter;
use wcf\system\view\grid\renderer\DefaultColumnRenderer;
use wcf\system\view\grid\renderer\NumberColumnRenderer;
use wcf\system\view\grid\renderer\TitleColumnRenderer;
->label('wcf.acp.user.rank.title')
->sortable()
->sortById('rankTitleI18n')
+ ->filter(new I18nTextFilter())
->renderer([
new class extends TitleColumnRenderer {
public function render(mixed $value, mixed $context = null): string
GridViewColumn::for('groupID')
->label('wcf.user.group')
->sortable()
+ ->filter(new SelectFilter($this->getAvailableUserGroups()))
->renderer([
new class extends DefaultColumnRenderer {
public function render(mixed $value, mixed $context = null): string
{
return new UserRankGridViewInitialized($this);
}
+
+ private function getAvailableUserGroups(): array
+ {
+ $groups = [];
+ foreach (UserGroup::getSortedGroupsByType([], [UserGroup::GUESTS, UserGroup::EVERYONE]) as $group) {
+ $groups[$group->groupID] = $group->getName();
+ }
+
+ return $groups;
+ }
}