function ManageConditions::renderRows

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

Parameters

$cached_values:

Return value

array

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

File

src/Form/ManageConditions.php, line 138

Class

ManageConditions

Namespace

Drupal\ctools\Form

Code

public function renderRows($cached_values) {
    $configured_conditions = [];
    foreach ($this->getConditions($cached_values) as $row => $condition) {
        
        /** @var \Drupal\Core\Condition\ConditionInterface $instance */
        $instance = $this->manager
            ->createInstance($condition['id'], $condition);
        [
            $route_name,
            $route_parameters,
        ] = $this->getOperationsRouteInfo($cached_values, $cached_values['id'], $row);
        $build = [
            '#type' => 'operations',
            '#links' => $this->getOperations($route_name, $route_parameters),
        ];
        $configured_conditions[] = [
            $instance->getPluginId(),
            $instance->summary(),
            'operations' => [
                'data' => $build,
            ],
        ];
    }
    return $configured_conditions;
}