/**
  * {@inheritdoc}
  */
 public function defaultConfiguration()
 {
     return parent::defaultConfiguration() + ['page_title' => ''];
 }
 /**
  * {@inheritdoc}
  */
 public function setConfiguration(array $configuration)
 {
     if (empty($configuration['uuid'])) {
         $configuration['uuid'] = $this->uuidGenerator()->generate();
     }
     // Make sure blocks are mapped to valid regions, and if not, map them to the
     // first available region. This is a work-around the fact that we're not
     // totally in control of the block placement UI from page_manager.
     // @todo Replace after https://www.drupal.org/node/2550879
     if (!empty($configuration['layout']) && !empty($configuration['blocks'])) {
         $layout_definition = $this->layoutManager->getDefinition($configuration['layout']);
         $valid_regions = $layout_definition['regions'];
         $first_region = array_keys($valid_regions)[0];
         foreach ($configuration['blocks'] as &$block) {
             if (!isset($valid_regions[$block['region']])) {
                 $block['region'] = $first_region;
             }
         }
     }
     return parent::setConfiguration($configuration);
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function defaultConfiguration()
 {
     return parent::defaultConfiguration() + ['layout' => '', 'layout_settings' => [], 'page_title' => ''];
 }