You are here

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

Parameters

array $cached_values:

string $row:

string $route_name_base:

array $route_parameters:

Return value

mixed

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

File

src/Form/ManageContext.php, line 252

Class

ManageContext

Namespace

Drupal\ctools\Form

Code

protected function getOperations($cached_values, $row, $route_name_base, array $route_parameters = []) {
  $operations = [];
  if ($this
    ->isEditableContext($cached_values, $row)) {
    $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,
        ]),
      ],
    ];
    $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;
}