QuickTabsInstanceListBuilder.php in Quick Tabs 8.3
File
src/QuickTabsInstanceListBuilder.php
View source
<?php
namespace Drupal\quicktabs;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
class QuickTabsInstanceListBuilder extends EntityListBuilder {
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['storage'] = $this
->t('Normal');
return $row + parent::buildRow($entity);
}
public function buildHeader() {
$header['label'] = $this
->t('Name');
$header['storage'] = $this
->t('Storage');
return $header + parent::buildHeader();
}
public function getDefaultOperations(EntityInterface $entity) {
$operations = parent::getDefaultOperations($entity);
if ($entity
->hasLinkTemplate('edit')) {
$operations['edit'] = [
'title' => $this
->t('Edit Quick Tab'),
'weight' => 10,
'url' => $entity
->toUrl('edit'),
];
$operations['delete'] = [
'title' => $this
->t('Delete Quick Tab'),
'weight' => 20,
'url' => $entity
->toUrl('delete'),
];
$operations['duplicate'] = [
'title' => $this
->t('Duplicate Quick Tab'),
'weight' => 40,
'url' => $entity
->toUrl('duplicate'),
];
}
return $operations;
}
}