You are here

abstract class LayoutBuilderRestrictionBase in Layout Builder Restrictions 8.2

Base class for Layout builder restriction plugin plugins.

Hierarchy

Expanded class hierarchy of LayoutBuilderRestrictionBase

2 files declare their use of LayoutBuilderRestrictionBase
EntityViewModeRestriction.php in src/Plugin/LayoutBuilderRestriction/EntityViewModeRestriction.php
EntityViewModeRestrictionByRegion.php in modules/layout_builder_restrictions_by_region/src/Plugin/LayoutBuilderRestriction/EntityViewModeRestrictionByRegion.php

File

src/Plugin/LayoutBuilderRestrictionBase.php, line 13

Namespace

Drupal\layout_builder_restrictions\Plugin
View source
abstract class LayoutBuilderRestrictionBase extends PluginBase implements LayoutBuilderRestrictionInterface, ContainerFactoryPluginInterface {
  use PluginHelperTrait;

  /**
   * Alter the block definitions.
   */
  public function alterBlockDefinitions(array $definitions, array $context) {
    return $definitions;
  }

  /**
   * Alter the section definitions.
   */
  public function alterSectionDefinitions(array $definitions, array $context) {
    return $definitions;
  }

  /**
   * {@inheritdoc}
   */
  public function blockAllowedinContext(SectionStorageInterface $section_storage, $delta_from, $delta_to, $region_to, $block_uuid, $preceding_block_uuid = NULL) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function inlineBlocksAllowedinContext(SectionStorageInterface $section_storage, $delta, $region) {
    return $this
      ->getInlineBlockPlugins();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
LayoutBuilderContextTrait::$contextRepository protected property The context repository.
LayoutBuilderContextTrait::contextRepository protected function Gets the context repository service.
LayoutBuilderContextTrait::getAvailableContexts protected function Provides all available contexts, both global and section_storage-specific.
LayoutBuilderRestrictionBase::alterBlockDefinitions public function Alter the block definitions. Overrides LayoutBuilderRestrictionInterface::alterBlockDefinitions 2
LayoutBuilderRestrictionBase::alterSectionDefinitions public function Alter the section definitions. Overrides LayoutBuilderRestrictionInterface::alterSectionDefinitions 2
LayoutBuilderRestrictionBase::blockAllowedinContext public function Determine whether the block being moved is allowed to the destination. Overrides LayoutBuilderRestrictionInterface::blockAllowedinContext 2
LayoutBuilderRestrictionBase::inlineBlocksAllowedinContext public function Returns an array of allowed inline blocks in a given context. Overrides LayoutBuilderRestrictionInterface::inlineBlocksAllowedinContext 2
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 92
PluginHelperTrait::blockManager private function Gets the block manager.
PluginHelperTrait::categoryIsRestricted public function Helper function to check the default block category whitelist.
PluginHelperTrait::contextHandler private function Gets the context handler.
PluginHelperTrait::entityTypeBundleInfo private function Gets the entity bundle interface.
PluginHelperTrait::getBlockDefinitions protected function Gets block definitions appropriate for an entity display.
PluginHelperTrait::getDefinitionsByUntranslatedCategory protected function Generate a categorized list of blocks, based on the untranslated category.
PluginHelperTrait::getGroupedDefinitions public function Method to categorize blocks in a multilingual-friendly way.
PluginHelperTrait::getInlineBlockPlugins public function Gets a list of all plugins available as Inline Blocks.
PluginHelperTrait::getLayoutDefinitions protected function Gets layout definitions.
PluginHelperTrait::getSortedDefinitions protected function Sort block categories alphabetically.
PluginHelperTrait::getUntranslatedCategory public function Helper function to return an untranslated block Category.
PluginHelperTrait::getValuefromSectionStorage public function A helper function to return values derivable from section storage.
PluginHelperTrait::layoutManager private function Gets the layout plugin manager.
PluginHelperTrait::sectionStorageManager private function Gets the section storage manager.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.