You are here

public function SettingsForm::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/aggregator/src/Form/SettingsForm.php \Drupal\aggregator\Form\SettingsForm::__construct()

Constructs a \Drupal\aggregator\SettingsForm object.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The factory for configuration objects.

\Drupal\aggregator\Plugin\AggregatorPluginManager $fetcher_manager: The aggregator fetcher plugin manager.

\Drupal\aggregator\Plugin\AggregatorPluginManager $parser_manager: The aggregator parser plugin manager.

\Drupal\aggregator\Plugin\AggregatorPluginManager $processor_manager: The aggregator processor plugin manager.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation manager.

Overrides ConfigFormBase::__construct

File

core/modules/aggregator/src/Form/SettingsForm.php, line 63
Contains \Drupal\aggregator\Form\SettingsForm.

Class

SettingsForm
Configures aggregator settings for this site.

Namespace

Drupal\aggregator\Form

Code

public function __construct(ConfigFactoryInterface $config_factory, AggregatorPluginManager $fetcher_manager, AggregatorPluginManager $parser_manager, AggregatorPluginManager $processor_manager, TranslationInterface $string_translation) {
  parent::__construct($config_factory);
  $this->stringTranslation = $string_translation;
  $this->managers = array(
    'fetcher' => $fetcher_manager,
    'parser' => $parser_manager,
    'processor' => $processor_manager,
  );

  // Get all available fetcher, parser and processor definitions.
  foreach (array(
    'fetcher',
    'parser',
    'processor',
  ) as $type) {
    foreach ($this->managers[$type]
      ->getDefinitions() as $id => $definition) {
      $this->definitions[$type][$id] = SafeMarkup::format('@title <span class="description">@description</span>', array(
        '@title' => $definition['title'],
        '@description' => $definition['description'],
      ));
    }
  }
}