Same name and namespace in other branches
  1. 4.x src/QuickTabsInstanceListBuilder.php \Drupal\quicktabs\QuickTabsInstanceListBuilder::getDefaultOperations()

Fichier

src/QuickTabsInstanceListBuilder.php, line 36

Classe

QuickTabsInstanceListBuilder
Provides a listing of quicktabs_instances.

Namespace

Drupal\quicktabs

Code

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;
}