You are here

public static function GridStackManager::mapConfigSchemaInfoAlter in GridStack 8

Maps config schema.

1 call to GridStackManager::mapConfigSchemaInfoAlter()
GridStackManager::configSchemaInfoAlter in src/GridStackManager.php
Implements hook_config_schema_info_alter().

File

src/GridStackManager.php, line 621

Class

GridStackManager
Implements GridStackManagerInterface.

Namespace

Drupal\gridstack

Code

public static function mapConfigSchemaInfoAlter(array &$mappings, $source = '') {
  $common = [
    'attributes',
    'extras',
    'skin',
    'wrapper',
    'wrapper_classes',
  ];

  // @todo: Remove unwanted debris.
  if ($source == 'panelizer') {
    $common = array_merge($common, [
      'classes',
    ]);
  }
  foreach ($common as $key) {
    $mappings['mapping'][$key]['type'] = 'string';
    $mappings['mapping'][$key]['label'] = ucwords($key);
  }
  $mappings['mapping']['regions']['type'] = 'sequence';
  $mappings['mapping']['regions']['label'] = 'Regions';
  $mappings['mapping']['regions']['sequence'][0]['type'] = 'mapping';
  $mappings['mapping']['regions']['sequence'][0]['label'] = 'Region';
  foreach ($common as $key) {
    $mappings['mapping']['regions']['sequence'][0]['mapping'][$key]['type'] = 'string';
    $mappings['mapping']['regions']['sequence'][0]['mapping'][$key]['label'] = ucwords($key);
  }
}