You are here

public function SlickListBuilder::list_build_row in Slick Carousel 7.3

File

slick_ui/src/Controller/SlickListBuilder.php, line 34

Class

SlickListBuilder
Provides a listing of Slick optionsets.

Namespace

Drupal\slick_ui\Controller

Code

public function list_build_row($entity, &$form_state, $operations) {
  parent::list_build_row($entity, $form_state, $operations);
  $skins = $this->manager
    ->getSkins()['skins'];
  $name = $entity->name;
  $breakpoints = $entity->breakpoints;
  $skin = $entity->skin;
  $skin_name = $skin ? check_plain($skin) : t('None');
  if ($skin) {
    $description = isset($skins[$skin]['description']) && $skins[$skin]['description'] ? filter_xss($skins[$skin]['description']) : '';
    if ($description) {
      $skin_name .= '<br /><em>' . $description . '</em>';
    }
  }
  $breakpoints_row[] = [
    'data' => $breakpoints,
    'class' => [
      'ctools-export-ui-breakpoints',
    ],
  ];
  array_splice($this->rows[$name]['data'], 2, 0, $breakpoints_row);
  $skin_row[] = [
    'data' => $skin_name,
    'class' => [
      'ctools-export-ui-skin',
    ],
    'style' => "white-space: normal; word-wrap: break-word; max-width: 320px;",
  ];
  array_splice($this->rows[$name]['data'], 3, 0, $skin_row);
  $collection_row[] = [
    'data' => $entity->collection ?: t('- All -'),
    'class' => [
      'ctools-export-ui-collection',
    ],
  ];
  array_splice($this->rows[$name]['data'], 4, 0, $collection_row);
}