You are here

public function PrintLinks::defaultConfiguration in Entity Print 8.2

Overrides BlockPluginTrait::defaultConfiguration

File

src/Plugin/Block/PrintLinks.php, line 65

Class

PrintLinks
Provides a block with a link to print entities.

Namespace

Drupal\entity_print\Plugin\Block

Code

public function defaultConfiguration() {
  $configuration = parent::defaultConfiguration();
  $configuration['label_display'] = '0';
  foreach ($this->exportTypeManager
    ->getDefinitions() as $plugin_id => $definition) {
    $configuration[$plugin_id . '_enabled'] = FALSE;
    $configuration[$plugin_id . '_link_text'] = $this
      ->t('View @label', [
      '@label' => $definition['label'],
    ]);
  }

  // Enable the PDF link by default.
  $configuration['pdf_enabled'] = TRUE;
  return $configuration;
}