You are here

public function SlickListBuilder::getDefaultOperations in Slick Carousel 8

Gets this list's default operations.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.

Return value

array The array structure is identical to the return value of self::getOperations().

Overrides ConfigEntityListBuilder::getDefaultOperations

File

slick_ui/src/Controller/SlickListBuilder.php, line 101

Class

SlickListBuilder
Provides a listing of Slick optionsets.

Namespace

Drupal\slick_ui\Controller

Code

public function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  if (isset($operations['edit'])) {
    $operations['edit']['title'] = $this
      ->t('Configure');
  }
  $operations['duplicate'] = [
    'title' => $this
      ->t('Duplicate'),
    'weight' => 15,
    'url' => $entity
      ->toUrl('duplicate-form'),
  ];
  if ($entity
    ->id() == 'default') {
    unset($operations['delete'], $operations['edit']);
  }
  return $operations;
}