You are here

public function FacetListBuilder::buildFacetSourceRow in Facets 8

Builds an array of facet sources for display in the overview.

1 call to FacetListBuilder::buildFacetSourceRow()
FacetListBuilder::buildForm in src/FacetListBuilder.php
Form constructor.

File

src/FacetListBuilder.php, line 183

Class

FacetListBuilder
Builds a listing of facet entities.

Namespace

Drupal\facets

Code

public function buildFacetSourceRow(array $facet_source = []) {
  return [
    'type' => [
      '#theme_wrappers' => [
        'container' => [
          '#attributes' => [
            'class' => 'facets-type',
          ],
        ],
      ],
      '#type' => 'markup',
      '#markup' => 'Facet source',
    ],
    'title' => [
      '#theme_wrappers' => [
        'container' => [
          '#attributes' => [
            'class' => 'facets-title',
          ],
        ],
      ],
      '#type' => 'markup',
      '#markup' => $facet_source['id'],
      '#wrapper_attributes' => [
        'colspan' => 3,
      ],
    ],
    'operations' => [
      'data' => Link::createFromRoute($this
        ->t('Configure'), 'entity.facets_facet_source.edit_form', [
        'facets_facet_source' => $facet_source['id'],
      ])
        ->toRenderable(),
    ],
    '#attributes' => [
      'class' => [
        'facet-source',
        'facet-source-' . $facet_source['id'],
      ],
      'no_striping' => TRUE,
    ],
  ];
}