You are here

protected function ManageConditions::getOperations in Chaos Tool Suite (ctools) 8.3

1 call to ManageConditions::getOperations()
ManageConditions::renderRows in src/Form/ManageConditions.php

File

src/Form/ManageConditions.php, line 152

Class

ManageConditions

Namespace

Drupal\ctools\Form

Code

protected function getOperations($route_name_base, array $route_parameters = []) {
  $operations['edit'] = [
    'title' => $this
      ->t('Edit'),
    'url' => new Url($route_name_base . '.edit', $route_parameters),
    'weight' => 10,
    'attributes' => [
      'class' => [
        'use-ajax',
      ],
      'data-dialog-type' => 'modal',
      'data-dialog-options' => Json::encode([
        'width' => 700,
      ]),
    ],
  ];
  $route_parameters['id'] = $route_parameters['condition'];
  $operations['delete'] = [
    'title' => $this
      ->t('Delete'),
    'url' => new Url($route_name_base . '.delete', $route_parameters),
    'weight' => 100,
    'attributes' => [
      'class' => [
        'use-ajax',
      ],
      'data-dialog-type' => 'modal',
      'data-dialog-options' => Json::encode([
        'width' => 700,
      ]),
    ],
  ];
  return $operations;
}