Skip to content

Commit

Permalink
Merge pull request #1547 from lekoala/2.0-1
Browse files Browse the repository at this point in the history
Make security admin more easily extensible
  • Loading branch information
GuySartorelli authored Aug 14, 2023
2 parents 5b09805 + 6ef5b9b commit 44fe804
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions code/SecurityAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,16 @@ protected function getGridFieldConfig(): GridFieldConfig
}
/** @var GridFieldImportButton $importButton */
$importButton = $config->getComponentByType(GridFieldImportButton::class);
$modalTitle = match ($this->modelClass) {
Member::class => _t(__CLASS__ . '.IMPORTUSERS', 'Import users'),
Group::class => _t(__CLASS__ . '.IMPORTGROUPS', 'Import groups'),
};
$importButton->setModalTitle($modalTitle);
if ($importButton) {
$modalTitle = match ($this->modelClass) {
Member::class => _t(__CLASS__ . '.IMPORTUSERS', 'Import users'),
Group::class => _t(__CLASS__ . '.IMPORTGROUPS', 'Import groups'),
default => null,
};
if ($modalTitle !== null) {
$importButton->setModalTitle($modalTitle);
}
}
return $config;
}

Expand Down

0 comments on commit 44fe804

Please sign in to comment.