You are here

public static function DrupalConfigHelper::buildAllPluginsForm in Backup and Migrate 5.0.x

Build the configuration form for all plugins in a manager.

Parameters

\Drupal\backup_migrate\Core\Plugin\PluginManagerInterface $plugins: The PluginManager containing all of the plugins to be configured.

string $operation: 'backup', 'restore', or 'initialize' depending on the operation being configured for.

array $parents: The form parents array.

Return value

array

4 calls to DrupalConfigHelper::buildAllPluginsForm()
BackupMigrateAdvancedBackupForm::buildForm in src/Form/BackupMigrateAdvancedBackupForm.php
Form constructor.
BackupMigrateRestoreForm::buildForm in src/Form/BackupMigrateRestoreForm.php
Form constructor.
BackupRestoreForm::buildForm in src/Form/BackupRestoreForm.php
SettingsProfileForm::form in src/Form/SettingsProfileForm.php
Gets the actual form array to be built.

File

src/Drupal/Config/DrupalConfigHelper.php, line 33

Class

DrupalConfigHelper
@package Drupal\backup_migrate\Drupal\Config

Namespace

Drupal\backup_migrate\Drupal\Config

Code

public static function buildAllPluginsForm(PluginManagerInterface $plugins, $operation, array $parents = []) {
  $form = [];
  foreach ($plugins
    ->getAll() as $plugin_key => $plugin) {
    $schema = $plugin
      ->configSchema([
      'operation' => $operation,
    ]);
    $config = $plugin
      ->config();
    DrupalConfigHelper::addFieldsFromSchema($form, $schema, $config, array_merge($parents, [
      $plugin_key,
    ]));
  }
  return $form;
}