You are here

public function FilterMarkdown::getConfiguration in Markdown 8.2

Gets this plugin's configuration.

Return value

array An array of this plugin's configuration.

Overrides FilterBase::getConfiguration

1 call to FilterMarkdown::getConfiguration()
FilterMarkdown::processSubform in src/Plugin/Filter/FilterMarkdown.php
Process callback for constructing markdown settings for this filter.

File

src/Plugin/Filter/FilterMarkdown.php, line 112

Class

FilterMarkdown
Provides a filter for Markdown.

Namespace

Drupal\markdown\Plugin\Filter

Code

public function getConfiguration() {

  // Immediately return the default configuration if filter isn't enabled.
  if (!$this->status) {
    $configuration['id'] = $this
      ->getPluginId();
    $configuration += $this
      ->defaultConfiguration();
    return $configuration;
  }
  $configuration = parent::getConfiguration();

  // Ensure any filter format set is added to the configuration. This is
  // needed in the event the filters configuration is cached in the database.
  // @see filter_formats()
  // @see markdown_filter_format_load()
  $filterFormat = $this
    ->getFilterFormat();
  $configuration['filterFormat'] = $filterFormat ? $filterFormat
    ->id() : NULL;
  return $configuration;
}