projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website]
/
web
/
modules
/
contrib
/
paragraphs
/
src
/
Controller
/
ParagraphsTypeListBuilder.php
diff --git
a/web/modules/contrib/paragraphs/src/Controller/ParagraphsTypeListBuilder.php
b/web/modules/contrib/paragraphs/src/Controller/ParagraphsTypeListBuilder.php
index 9b4a985fb415aa209465de5ee50b3616f28f091b..48fd9c092da6192fb1925176fbe4c764341e5861 100644
(file)
--- a/
web/modules/contrib/paragraphs/src/Controller/ParagraphsTypeListBuilder.php
+++ b/
web/modules/contrib/paragraphs/src/Controller/ParagraphsTypeListBuilder.php
@@
-14,8
+14,13
@@
class ParagraphsTypeListBuilder extends ConfigEntityListBuilder {
* {@inheritdoc}
*/
public function buildHeader() {
* {@inheritdoc}
*/
public function buildHeader() {
- $header['label'] = $this->t('Paragraphs types');
+ $header['icon_file'] = [
+ 'data' => $this->t('Icon'),
+ ];
+ $header['label'] = $this->t('Label');
$header['id'] = $this->t('Machine name');
$header['id'] = $this->t('Machine name');
+ $header['description'] = $this->t('Description');
+
return $header + parent::buildHeader();
}
return $header + parent::buildHeader();
}
@@
-23,8
+28,19
@@
class ParagraphsTypeListBuilder extends ConfigEntityListBuilder {
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
+ $row['icon_file'] = [];
+ if ($icon_url = $entity->getIconUrl()) {
+ $row['icon_file']['class'][] = 'paragraphs-type-icon';
+ $row['icon_file']['data'] = [
+ '#theme' => 'image',
+ '#uri' => $icon_url,
+ '#width' => 32,
+ '#height' => 32,
+ ];
+ }
$row['label'] = $entity->label();
$row['id'] = $entity->id();
$row['label'] = $entity->label();
$row['id'] = $entity->id();
+ $row['description']['data'] = ['#markup' => $entity->getDescription()];
// You probably want a few more properties here...
return $row + parent::buildRow($entity);
}
// You probably want a few more properties here...
return $row + parent::buildRow($entity);
}
@@
-43,4
+59,13
@@
class ParagraphsTypeListBuilder extends ConfigEntityListBuilder {
return $operations;
}
return $operations;
}
+ /**
+ * {@inheritdoc}
+ */
+ public function render() {
+ $build = parent::render();
+ $build['#attached']['library'][] = 'paragraphs/drupal.paragraphs.list_builder';
+ return $build;
+ }
+
}
}