public function WebformOptionsListBuilder::getDefaultOperations in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformOptionsListBuilder.php \Drupal\webform\WebformOptionsListBuilder::getDefaultOperations()
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
- src/
WebformOptionsListBuilder.php, line 165
Class
- WebformOptionsListBuilder
- Defines a class to build a listing of webform options entities.
Namespace
Drupal\webformCode
public function getDefaultOperations(EntityInterface $entity, $type = 'edit') {
$operations = parent::getDefaultOperations($entity);
if ($entity
->access('duplicate')) {
$operations['duplicate'] = [
'title' => $this
->t('Duplicate'),
'weight' => 23,
'url' => Url::fromRoute('entity.webform_options.duplicate_form', [
'webform_options' => $entity
->id(),
]),
];
}
if (isset($operations['delete'])) {
$operations['delete']['attributes'] = WebformDialogHelper::getModalDialogAttributes(WebformDialogHelper::DIALOG_NARROW);
}
return $operations;
}