You are here

public function DomainElementManager::listDisallowed in Domain Access 8

Lists the disallowed domains in the user interface.

Parameters

array $disallowed: An array of domain ids.

Return value

string A string suitable for display.

1 call to DomainElementManager::listDisallowed()
DomainElementManager::setFormOptions in domain/src/DomainElementManager.php
Resets form options and stores hidden values that the user cannot change.

File

domain/src/DomainElementManager.php, line 208

Class

DomainElementManager
Generic base class for handling hidden field options.

Namespace

Drupal\domain

Code

public function listDisallowed(array $disallowed) {
  $domains = $this->domainStorage
    ->loadMultiple($disallowed);
  $string = $this
    ->t('The following domains are currently assigned and cannot be changed:');
  foreach ($domains as $domain) {
    $items[] = $domain
      ->label();
  }
  $build = [
    '#theme' => 'item_list',
    '#items' => $items,
  ];
  $string .= render($build);
  return '<div class="disallowed">' . $string . '</div>';
}