SocialProfileOrgTagConfigOverride.php in Open Social 8.6
Same filename and directory in other branches
- 8.9 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 8.4 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 8.5 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 8.7 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 8.8 modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 10.3.x modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 10.0.x modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 10.1.x modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
- 10.2.x modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.php
Namespace
Drupal\social_profile_organization_tagFile
modules/social_features/social_profile/modules/social_profile_organization_tag/src/SocialProfileOrgTagConfigOverride.phpView source
<?php
namespace Drupal\social_profile_organization_tag;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
use Drupal\Core\Config\StorageInterface;
/**
* Class SocialProfileOrgTagConfigOverride.
*
* @package Drupal\social_profile_organization_tag
*/
class SocialProfileOrgTagConfigOverride implements ConfigFactoryOverrideInterface {
/**
* Load overrides.
*/
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_organization_tag' => [
'children' => [
'field_profile_organization_tag',
],
'parent_name' => '',
'weight' => 99,
'label' => t('Organization tag')
->render(),
'format_type' => 'fieldset',
'format_settings' => [
'label' => t('Organization tag')
->render(),
'required_fields' => FALSE,
'id' => 'organization_tag',
'classes' => 'scrollspy',
],
],
],
],
'content' => $content,
];
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialProfileOrgTagConfigOverride';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Classes
Name | Description |
---|---|
SocialProfileOrgTagConfigOverride | Class SocialProfileOrgTagConfigOverride. |