class Permissions in Display Suite 8.4
Same name and namespace in other branches
- 8.2 modules/ds_switch_view_mode/src/Permissions.php \Drupal\ds_switch_view_mode\Permissions
- 8.3 modules/ds_switch_view_mode/src/Permissions.php \Drupal\ds_switch_view_mode\Permissions
Provides dynamic permissions of the ds switch view mode module.
Hierarchy
- class \Drupal\ds_switch_view_mode\Permissions uses StringTranslationTrait
Expanded class hierarchy of Permissions
File
- modules/
ds_switch_view_mode/ src/ Permissions.php, line 10
Namespace
Drupal\ds_switch_view_modeView source
class Permissions {
use StringTranslationTrait;
/**
* Constructs a Permissions object.
*/
public function __construct() {
// Empty constructor to prevent php 4 constructor error.
}
/**
* Returns an array of ds switch view mode permissions.
*/
public function permissions() {
$permissions = [];
foreach (node_type_get_names() as $key => $name) {
$permissions['ds switch ' . $key] = [
'title' => $this
->t('Switch view modes on :type', [
':type' => $name,
]),
];
}
return $permissions;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Permissions:: |
public | function | Returns an array of ds switch view mode permissions. | |
Permissions:: |
public | function | Constructs a Permissions object. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |