You are here

public function SlickListBuilderBase::getDefaultOperations in Slick Carousel 8.2

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/SlickListBuilderBase.php, line 39

Class

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