Skip to content
Snippets Groups Projects

Update LayoutLayoutBuilderPermissions.php

1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
@@ -6,6 +6,7 @@ use Drupal\Core\Layout\LayoutPluginManagerInterface;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
use Drupal\layout_builder_perms\LayoutBuilderPermissionPluginDeriverBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Defines per content type LayoutBuilderPermission plugins.
@@ -53,8 +54,11 @@ class LayoutLayoutBuilderPermissions extends LayoutBuilderPermissionPluginDerive
$this->derivatives[$plugin_id] = $base_plugin_definition;
$this->derivatives[$plugin_id]['permission'] =
$action . ' ' . $component . 's in ' . $layout_id . ' layouts';
$layout_name = $layout_name instanceof TranslatableMarkup
? $layout_name->getUntranslatedString()
: $layout_name;
$this->derivatives[$plugin_id]['label'] =
ucfirst($action) . ' ' . $component . 's in ' . $layout_name->getUntranslatedString() . ' layouts';
ucfirst($action) . ' ' . $component . 's in ' . $layout_name . ' layouts';
$this->derivatives[$plugin_id]['description'] = '';
$this->derivatives[$plugin_id]['operation'] = $operation;
$this->derivatives[$plugin_id]['action'] = $action;
Loading