function ManageContext::renderRows

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

Render the Rows.

Parameters

array $cached_values: The cached context values.

Return value

array The rendered rows.

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

File

src/Form/ManageContext.php, line 261

Class

ManageContext
Manage Context Form.

Namespace

Drupal\ctools\Form

Code

protected function renderRows(array $cached_values) {
    $contexts = [];
    foreach ($this->getContexts($cached_values) as $row => $context) {
        [
            $route_name,
            $route_parameters,
        ] = $this->getContextOperationsRouteInfo($cached_values, $this->machine_name, $row);
        $build = [
            '#type' => 'operations',
            '#links' => $this->getOperations($cached_values, $row, $route_name, $route_parameters),
        ];
        $contexts[$row] = [
            $row,
            $context->getContextDefinition()
                ->getLabel(),
            $context->getContextDefinition()
                ->getDataType(),
            'operations' => [
                'data' => $build,
            ],
        ];
    }
    return $contexts;
}