You are here

public function ElevateZoomPlusListBuilder::getDefaultOperations in ElevateZoom Plus 7

File

modules/ui/src/Controller/ElevateZoomPlusListBuilder.php, line 42

Class

ElevateZoomPlusListBuilder
Provides a listing of ElevateZoomPlus optionsets.

Namespace

Drupal\elevatezoomplus_ui\Controller

Code

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