You are here

public function BackgroundImageManager::getDefaultSettings in Background Image 8

Same name and namespace in other branches
  1. 2.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::getDefaultSettings()
  2. 2.0.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::getDefaultSettings()

Retrieves the default background image settings.

Return value

array

Overrides BackgroundImageManagerInterface::getDefaultSettings

File

src/BackgroundImageManager.php, line 369

Class

BackgroundImageManager

Namespace

Drupal\background_image

Code

public function getDefaultSettings() {

  // Even though this is in the install config, it has the potential of
  // becoming removed. Due to the way BackgroundImageSettings works, the keys
  // must exist for values to be typecast properly.
  return NestedArray::mergeDeep([
    'blur' => [
      'type' => 2,
      'radius' => 50,
      'speed' => 1,
    ],
    'dark' => FALSE,
    'full_viewport' => FALSE,
    'preload' => [
      'background_color' => '#ffffff',
    ],
    'text' => [
      'format' => 'full_html',
      'value' => '',
    ],
  ], $this->config
    ->get('defaults') ?: []);
}