You are here

public function SocialFilePrivateTextEditorConfigOverride::loadOverrides in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  2. 8 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  3. 8.2 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  4. 8.3 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  5. 8.4 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  6. 8.5 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  7. 8.7 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  8. 8.8 modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  9. 10.3.x modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  10. 10.0.x modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  11. 10.1.x modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()
  12. 10.2.x modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php \Drupal\social_file_private\SocialFilePrivateTextEditorConfigOverride::loadOverrides()

Returns config overrides.

Parameters

array $names: A list of configuration names that are being loaded.

Return value

array An array keyed by configuration name of override data. Override data contains a nested array structure of overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

modules/custom/social_file_private/src/SocialFilePrivateTextEditorConfigOverride.php, line 59

Class

SocialFilePrivateTextEditorConfigOverride
Class SocialFilePrivateTextEditorConfigOverride.

Namespace

Drupal\social_file_private

Code

public function loadOverrides($names) {
  $overrides = [];
  if (PrivateStream::basePath()) {
    $config_names = $this
      ->getTextEditorsToProtect();
    foreach ($config_names as $config_name) {
      if (in_array($config_name, $names)) {
        $scheme = $this->configFactory
          ->getEditable($config_name)
          ->get('image_upload.scheme');
        if ($scheme == 'public') {
          $overrides[$config_name]['image_upload']['scheme'] = 'private';
        }
      }
    }
  }
  return $overrides;
}