function ManageConditions::getOperations

Same name in other branches
  1. 4.0.x src/Form/ManageConditions.php \Drupal\ctools\Form\ManageConditions::getOperations()
1 call to ManageConditions::getOperations()
ManageConditions::renderRows in src/Form/ManageConditions.php

File

src/Form/ManageConditions.php, line 162

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