ImceProfileListBuilder.php in IMCE 8
File
src/ImceProfileListBuilder.php
View source
<?php
namespace Drupal\imce;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class ImceProfileListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Name');
$header['description'] = $this
->t('Description');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $imce_profile) {
$row['label'] = $imce_profile
->label();
$row['description'] = $imce_profile
->get('description');
return $row + parent::buildRow($imce_profile);
}
public function getDefaultOperations(EntityInterface $imce_profile) {
$operations = parent::getDefaultOperations($imce_profile);
$operations['duplicate'] = [
'title' => $this
->t('Duplicate'),
'weight' => 15,
'url' => $imce_profile
->toUrl('duplicate-form'),
];
return $operations;
}
}