3 namespace Drupal\embed;
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
9 * Provides a listing of all Embed Button entities.
11 class EmbedButtonListBuilder extends ConfigEntityListBuilder {
16 public function buildHeader() {
18 $header['label'] = $this->t('Embed button');
19 $header['embed_type'] = $this->t('Embed type');
21 'data' => $this->t('Icon'),
22 'class' => [RESPONSIVE_PRIORITY_LOW],
24 return $header + parent::buildHeader();
30 public function buildRow(EntityInterface $entity) {
31 /** @var \Drupal\embed\EmbedButtonInterface $entity */
33 $row['label'] = $entity->label();
34 $row['embed_type'] = $entity->getTypeLabel();
35 if ($icon_url = $entity->getIconUrl()) {
36 $row['icon']['data'] = [
39 '#alt' => $this->t('Icon for the @label button.', ['@label' => $entity->label()]),
43 $row['icon'] = $this->t('None');
46 return $row + parent::buildRow($entity);