You are here

public function ModulesInstalled::getValue in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()
  2. 8.5 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()
  3. 8.6 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()
  4. 8.7 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()
  5. 10.3.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()
  6. 10.0.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()
  7. 10.1.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()
  8. 10.2.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\ModulesInstalled::getValue()

Get the value.

Return value

array $json array.

Overrides ShareUsageDataPluginBase::getValue

File

modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php, line 25

Class

ModulesInstalled
Provides a 'ModulesInstalled' share usage data plugin.

Namespace

Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin

Code

public function getValue() {
  $value = [];
  $modules = \Drupal::service('extension.list.module')
    ->reset()
    ->getList();
  $modules = $this
    ->getExtensionsInfo($modules);
  $theme_data = \Drupal::service('theme_handler')
    ->rebuildThemeData();
  $themes = $this
    ->getExtensionsInfo($theme_data);
  $profiles = \Drupal::service('extension.list.profile')
    ->reset()
    ->getList();
  $profiles = $this
    ->getExtensionsInfo($profiles);
  $value['modules'] = $modules;
  $value['profiles'] = $profiles;
  $value['themes'] = [
    'themes' => $themes,
    'default' => \Drupal::service('theme_handler')
      ->getDefault(),
  ];
  return $value;
}