X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FBlock%2FBlockBase.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FBlock%2FBlockBase.php;h=bebdf09bd41041d863d41addd77e08484ac122de;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=a5f7fa9ed9d6997fafb7558fd7807082ead42846;hpb=9424afc6c1f518c301bf87a23c047d1873435d05;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Block/BlockBase.php b/web/core/lib/Drupal/Core/Block/BlockBase.php index a5f7fa9ed..bebdf09bd 100644 --- a/web/core/lib/Drupal/Core/Block/BlockBase.php +++ b/web/core/lib/Drupal/Core/Block/BlockBase.php @@ -11,6 +11,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Plugin\PluginWithFormsInterface; use Drupal\Core\Plugin\PluginWithFormsTrait; +use Drupal\Core\Render\PreviewFallbackInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Component\Transliteration\TransliterationInterface; @@ -23,7 +24,7 @@ use Drupal\Component\Transliteration\TransliterationInterface; * * @ingroup block_api */ -abstract class BlockBase extends ContextAwarePluginBase implements BlockPluginInterface, PluginWithFormsInterface { +abstract class BlockBase extends ContextAwarePluginBase implements BlockPluginInterface, PluginWithFormsInterface, PreviewFallbackInterface { use ContextAwarePluginAssignmentTrait; use MessengerTrait; @@ -252,6 +253,13 @@ abstract class BlockBase extends ContextAwarePluginBase implements BlockPluginIn return $transliterated; } + /** + * {@inheritdoc} + */ + public function getPreviewFallbackString() { + return $this->t('Placeholder for the "@block" block', ['@block' => $this->label()]); + } + /** * Wraps the transliteration service. *