+ '#attached' => [
+ 'library' => ['environment_indicator/drupal.environment_indicator'],
+ 'drupalSettings' => [
+ 'environmentIndicator' => [
+ 'name' => $title ? $title : ' ',
+ 'fgColor' => $active_environment->get('fg_color'),
+ 'bgColor' => $active_environment->get('bg_color'),
+ 'addFavicon' => \Drupal::config('environment_indicator.settings')
+ ->get('favicon'),
+ ],
+ ],
+ ]
+ ];
+ if (!_environment_indicator_external_integration_is_enabled('toolbar')) {
+ return $items;
+ }
+ $release_info = \Drupal::state()->get('environment_indicator.current_release');
+ if (strlen($release_info)) {
+ $release_info = '(' . $release_info . ')';
+ }
+ $title = implode(' ', array_filter([$release_info, $title]));
+ if (!strlen($title)) {
+ return $items;
+ }
+ $items['environment_indicator'] += [