BUEditorButtonListBuilder.php in BUEditor 8.2
File
src/BUEditorButtonListBuilder.php
View source
<?php
namespace Drupal\bueditor;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class BUEditorButtonListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['id'] = [
'data' => $this
->t('ID'),
'class' => 'button-id',
];
$header['label'] = [
'data' => $this
->t('Name'),
'class' => 'button-label',
];
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $bueditor_button) {
$row['id'] = $bueditor_button
->id();
$row['label'] = $bueditor_button
->label();
return $row + parent::buildRow($bueditor_button);
}
public function getDefaultOperations(EntityInterface $bueditor_button) {
$operations = parent::getDefaultOperations($bueditor_button);
$operations['duplicate'] = [
'title' => $this
->t('Duplicate'),
'weight' => 15,
'url' => $bueditor_button
->toUrl('duplicate-form'),
];
return $operations;
}
}