You are here

public function SocialProfileOrgTagConfigOverride::loadOverrides in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  2. 8.4 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  3. 8.5 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  4. 8.6 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  5. 8.7 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  6. 8.8 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  7. 10.0.x modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  8. 10.1.x modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()
  9. 10.2.x modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php \Drupal\social_profile_organization_tag\SocialProfileOrgTagConfigOverride::loadOverrides()

Load overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php, line 19

Class

SocialProfileOrgTagConfigOverride
Class SocialProfileOrgTagConfigOverride.

Namespace

Drupal\social_profile_organization_tag

Code

public function loadOverrides($names) {
  $overrides = [];
  $config_factory = \Drupal::service('config.factory');

  // Override profile form display.
  $config_name = 'core.entity_form_display.profile.profile.default';
  if (in_array($config_name, $names)) {
    $config = $config_factory
      ->getEditable($config_name);
    $children = $config
      ->get('third_party_settings.field_group.group_profile_self_intro.children');
    $children[] = 'field_profile_organization_tag';
    $content = $config
      ->get('content');
    $content['field_profile_organization_tag'] = [
      'type' => 'entity_reference_autocomplete',
      'weight' => 10,
      'region' => 'content',
      'settings' => [
        'match_operator' => 'CONTAINS',
        'size' => 60,
        'placeholder' => '',
      ],
      'third_party_settings' => [],
    ];
    $overrides[$config_name] = [
      'third_party_settings' => [
        'field_group' => [
          'group_tags' => [
            'children' => [
              'field_profile_organization_tag',
            ],
            'parent_name' => '',
            'weight' => 99,
            'label' => t('Tags')
              ->render(),
            'format_type' => 'fieldset',
            'format_settings' => [
              'label' => t('Tags')
                ->render(),
              'required_fields' => FALSE,
              'id' => 'group_tags',
              'classes' => 'scrollspy',
            ],
          ],
        ],
      ],
      'content' => $content,
    ];
  }
  return $overrides;
}