Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / media_entity / src / MediaBundleListBuilder.php
1 <?php
2
3 namespace Drupal\media_entity;
4
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityHandlerInterface;
7 use Drupal\Core\Entity\EntityInterface;
8 use Drupal\Component\Utility\Xss;
9 use Drupal\Core\Url;
10
11 /**
12  * Provides a listing of media bundles.
13  */
14 class MediaBundleListBuilder extends ConfigEntityListBuilder implements EntityHandlerInterface {
15
16   /**
17    * {@inheritdoc}
18    */
19   public function buildHeader() {
20     $header['title'] = $this->t('Name');
21     $header['description'] = [
22       'data' => $this->t('Description'),
23       'class' => [RESPONSIVE_PRIORITY_MEDIUM],
24     ];
25     return $header + parent::buildHeader();
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function buildRow(EntityInterface $entity) {
32     $row['title'] = [
33       'data' => $entity->label(),
34       'class' => ['menu-label'],
35     ];
36     $row['description'] = Xss::filterAdmin($entity->getDescription());
37     return $row + parent::buildRow($entity);
38   }
39
40   /**
41    * {@inheritdoc}
42    */
43   public function render() {
44     $build = parent::render();
45     $build['#empty'] = $this->t('No media bundle available. <a href="@link">Add media bundle</a>.', [
46       '@link' => Url::fromRoute('entity.media_bundle.add_form')->toString(),
47     ]);
48     return $build;
49   }
50
51 }