Skip to content
Snippets Groups Projects
Select Git revision
  • b51b62df2d382b2ca327db976a1473779ce9bc07
  • 11.x default protected
  • 11.2.x protected
  • 10.6.x protected
  • 10.5.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

Settings.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    BlockBase.php 18.45 KiB
    <?php
    
    /**
     * @file
     * Contains \Drupal\Core\Block\BlockBase.
     */
    
    namespace Drupal\Core\Block;
    
    use Drupal\block\BlockInterface;
    use Drupal\block\Event\BlockConditionContextEvent;
    use Drupal\block\Event\BlockEvents;
    use Drupal\Component\Plugin\ContextAwarePluginInterface;
    use Drupal\Core\Condition\ConditionAccessResolverTrait;
    use Drupal\Core\Condition\ConditionPluginBag;
    use Drupal\Core\Form\FormState;
    use Drupal\Core\Form\FormStateInterface;
    use Drupal\Core\Plugin\ContextAwarePluginBase;
    use Drupal\Component\Utility\Unicode;
    use Drupal\Component\Utility\NestedArray;
    use Drupal\Core\Language\LanguageInterface;
    use Drupal\Core\Cache\Cache;
    use Drupal\Core\Session\AccountInterface;
    use Drupal\Component\Transliteration\TransliterationInterface;
    
    /**
     * Defines a base block implementation that most blocks plugins will extend.
     *
     * This abstract class provides the generic block configuration form, default
     * block settings, and handling for general user-defined block visibility
     * settings.
     *
     * @ingroup block_api
     */
    abstract class BlockBase extends ContextAwarePluginBase implements BlockPluginInterface {
    
      use ConditionAccessResolverTrait;
    
      /**
       * The condition plugin bag.
       *
       * @var \Drupal\Core\Condition\ConditionPluginBag
       */
      protected $conditionBag;
    
      /**
       * The condition plugin manager.
       *
       * @var \Drupal\Core\Executable\ExecutableManagerInterface
       */
      protected $conditionPluginManager;
    
      /**
       * The transliteration service.
       *
       * @var \Drupal\Component\Transliteration\TransliterationInterface
       */
      protected $transliteration;
    
      /**
       * {@inheritdoc}
       */
      public function label() {
        if (!empty($this->configuration['label'])) {
          return $this->configuration['label'];
        }
    
        $definition = $this->getPluginDefinition();
        // Cast the admin label to a string since it is an object.
        // @see \Drupal\Core\StringTranslation\TranslationWrapper