You are here

function _views_views_config_data_add in Configuration Views 8

Same name and namespace in other branches
  1. 2.0.x config_views.views.inc \_views_views_config_data_add()

Adjust config data based on type.

Parameters

array $views_config_data: Views config data structure.

array $definition: The current definition.

string $prefix: A prefix.

1 call to _views_views_config_data_add()
_views_views_config_process_schema in ./config_views.views.inc
Process all config definitions.

File

./config_views.views.inc, line 164
Provide views data for dblog.module.

Code

function _views_views_config_data_add(array &$views_config_data, array $definition, $prefix) {

  // Some places label makes no sense than prefix.
  $title = $definition['label'];
  if (strtolower($title) == 'text') {
    $title = ucfirst($prefix);
  }
  $views_config_data[$prefix] = [
    'title' => $title,
    'help' => $prefix,
    'sort' => [
      'id' => 'standard',
    ],
  ];
  switch ($definition['type']) {
    case 'boolean':
      $views_config_data[$prefix]['field']['id'] = 'standard';
      $views_config_data[$prefix]['filter']['id'] = 'config_entity_boolean';
      $views_config_data[$prefix]['argument']['id'] = 'standard';
      break;
    case 'integer':
      $views_config_data[$prefix]['field']['id'] = 'numeric';
      $views_config_data[$prefix]['filter']['id'] = 'numeric';
      $views_config_data[$prefix]['argument']['id'] = 'numeric';
      break;
    default:
      $views_config_data[$prefix]['field']['id'] = 'standard';
      $views_config_data[$prefix]['filter']['id'] = 'config_entity_string';
      $views_config_data[$prefix]['argument']['id'] = 'standard';
      break;
  }
}