SocialMentionsConfigOverride.php in Open Social 8.4
Same filename and directory in other branches
- 8.9 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 8 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 8.2 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 8.3 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 8.5 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 8.6 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 8.7 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 8.8 modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 10.3.x modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 10.0.x modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 10.1.x modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
- 10.2.x modules/social_features/social_mentions/src/SocialMentionsConfigOverride.php
Namespace
Drupal\social_mentionsFile
modules/social_features/social_mentions/src/SocialMentionsConfigOverride.phpView source
<?php
namespace Drupal\social_mentions;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
/**
* Class SocialMentionsConfigOverride.
*
* Example configuration override.
*
* @package Drupal\social_mentions
*/
class SocialMentionsConfigOverride implements ConfigFactoryOverrideInterface {
/**
* Returns config overrides.
*/
public function loadOverrides($names) {
$overrides = [];
// Add mentions filter to Basic HTML text format.
$config_name = 'filter.format.basic_html';
if (in_array($config_name, $names)) {
$config = \Drupal::service('config.factory')
->getEditable($config_name);
$dependencies = $config
->get('dependencies.module');
$dependencies[] = 'mentions';
$filters = $config
->get('filters');
$filters['filter_mentions'] = [
'id' => 'filter_mentions',
'provider' => 'mentions',
'status' => TRUE,
'weight' => 40,
'settings' => [
'mentions_filter' => [
'ProfileMention' => 1,
'UserMention' => 1,
],
],
];
$overrides[$config_name] = [
'dependencies' => [
'module' => $dependencies,
],
'filters' => $filters,
];
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialMentionsConfigOverride';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Classes
Name | Description |
---|---|
SocialMentionsConfigOverride | Class SocialMentionsConfigOverride. |