You are here

public function DomainConfigUIController::inspectConfig in Domain Access 8

Controller for inspecting configuration.

Parameters

string $config_name: The domain config object being inspected.

1 string reference to 'DomainConfigUIController::inspectConfig'
domain_config_ui.routing.yml in domain_config_ui/domain_config_ui.routing.yml
domain_config_ui/domain_config_ui.routing.yml

File

domain_config_ui/src/Controller/DomainConfigUIController.php, line 140

Class

DomainConfigUIController
Controller routines for AJAX callbacks for domain actions.

Namespace

Drupal\domain_config_ui\Controller

Code

public function inspectConfig($config_name = NULL) {
  if (empty($config_name)) {
    $url = Url::fromRoute('domain_config_ui.list');
    return new RedirectResponse($url
      ->toString());
  }
  $elements = $this
    ->deriveElements($config_name);
  $config = \Drupal::configFactory()
    ->get($config_name)
    ->getRawData();
  if ($elements['language'] == $this
    ->t('all')
    ->render()) {
    $language = $this
      ->t('all languages');
  }
  else {
    $language = $this
      ->t('the @language language.', [
      '@language' => $elements['language'],
    ]);
  }
  $page['help'] = [
    '#type' => 'item',
    '#title' => Html::escape($config_name),
    '#markup' => $this
      ->t('This configuration is for the %domain domain and
        applies to %language.', [
      '%domain' => $elements['domain'],
      '%language' => $language,
    ]),
    '#prefix' => '<p>',
    '#suffix' => '</p>',
  ];
  $page['text'] = [
    '#markup' => $this
      ->printArray($config),
  ];
  return $page;
}