diff --git a/core/modules/block_place/src/Plugin/DisplayVariant/PlaceBlockPageVariant.php b/core/modules/block_place/src/Plugin/DisplayVariant/PlaceBlockPageVariant.php index 58631cf..88e1daf 100644 --- a/core/modules/block_place/src/Plugin/DisplayVariant/PlaceBlockPageVariant.php +++ b/core/modules/block_place/src/Plugin/DisplayVariant/PlaceBlockPageVariant.php @@ -9,7 +9,7 @@ use Drupal\Core\Render\Element; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Theme\ThemeManagerInterface; -use Drupal\Core\Url; +use Drupal\Core\Link; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -96,29 +96,26 @@ public function build() { if (!isset($visible_regions[$region])) { continue; } - $links['place_block_add_link'] = [ - 'title' => $this->t('Place block'), - 'url' => Url::fromRoute('block.admin_library', ['theme' => $theme_name]), - 'query' => [ - 'region' => $region, - 'destination' => $this->routeMatch->getRouteObject()->getPath(), - ], - 'attributes' => [ - 'class' => ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ]; $operations['block_description'] = [ '#type' => 'inline_template', - '#template' => '
{{ region_name }}
', - '#context' => array('region_name' => $visible_regions[$region]), - ]; - $operations['operations'] = [ - '#type' => 'operations', - '#links' => $links, + '#template' => '
{{ region_name }} {{ link }}
', + '#context' => array( + 'region_name' => $visible_regions[$region], + 'link' => Link::createFromRoute($this->t('Place block'), 'block.admin_library', ['theme' => $theme_name], [ + 'query' => [ + 'region' => $region, + 'destination' => $this->routeMatch->getRouteObject()->getPath(), + ], + 'attributes' => [ + 'class' => ['use-ajax', 'button', 'button--small'], + 'data-dialog-type' => 'modal', + 'data-dialog-options' => Json::encode([ + 'width' => 700, + ]), + ], + ] + )->toString() + ), ]; $build[$region] = ['block_place_operations' => $operations] + $build[$region]; }