You are here

public function LocaleDefaultConfigStorage::getComponentNames in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/LocaleDefaultConfigStorage.php \Drupal\locale\LocaleDefaultConfigStorage::getComponentNames()

Get all configuration names and folders for a list of modules or themes.

Parameters

string $type: Type of components: 'module' | 'theme' | 'profile'

array $list: Array of theme or module names.

Return value

array Configuration names provided by that component. In case of language module this list is extended with configured languages that have predefined names as well.

File

core/modules/locale/src/LocaleDefaultConfigStorage.php, line 132
Contains \Drupal\locale\LocaleDefaultConfigStorage.

Class

LocaleDefaultConfigStorage
Provides access to default configuration for locale integration.

Namespace

Drupal\locale

Code

public function getComponentNames($type, array $list) {
  $names = array_unique(array_merge(array_keys($this->requiredInstallStorage
    ->getComponentNames($type, $list)), array_keys($this->optionalInstallStorage
    ->getComponentNames($type, $list))));
  if ($type == 'module' && in_array('language', $list)) {
    $languages = $this
      ->predefinedConfiguredLanguages();
    $names = array_unique(array_merge($names, $languages));
  }
  return $names;
}