public function HiddenLanguagePermissions::permissions in Hidden Language 8
Same name and namespace in other branches
- 2.x src/HiddenLanguagePermissions.php \Drupal\hidden_language\HiddenLanguagePermissions::permissions()
Returns an array of filter permissions.
Return value
array
1 string reference to 'HiddenLanguagePermissions::permissions'
File
- src/
HiddenLanguagePermissions.php, line 28
Class
- HiddenLanguagePermissions
- Provides dynamic permissions of the filter module.
Namespace
Drupal\hidden_languageCode
public function permissions() {
$permissions = [];
$languages = \Drupal::languageManager()
->getLanguages();
foreach ($languages as $langcode => $language) {
$permissions["access hidden language {$langcode}"] = [
'title' => $this
->t('Access hidden language @language', [
'@language' => $language
->getName(),
]),
'description' => $this
->t('Access @language language when it is hidden.', [
'@language' => $language
->getName(),
]),
];
}
return $permissions;
}