/** * {@inheritdoc} */ public function buildForm(array $form, array &$form_state, PageInterface $page = NULL, $page_variant_id = NULL, $layout_region_id = NULL, $block_id = NULL) { $this->page = $page; $this->displayVariant = $this->page->getVariant($page_variant_id); $this->displayVariant->setExecutable($page->getExecutable()); $this->layoutRegion = $this->displayVariant->getLayoutRegion($layout_region_id); $this->block = $this->prepareBlock($block_id); $form['#tree'] = TRUE; $form['settings'] = $this->block->buildConfigurationForm(array(), $form_state); $form['settings']['id'] = array('#type' => 'value', '#value' => $this->block->getPluginId()); // @note: we removed the region widget as it is implicit in URL. if ($this->block instanceof ContextAwarePluginInterface) { $form['context_assignments'] = $this->addContextAssignmentElement($this->block, $this->displayVariant->getContexts()); } $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->submitText(), '#button_type' => 'primary'); if ($this->getRequest()->isXmlHttpRequest()) { $form['actions']['submit']['#ajax'] = array('callback' => array($this, 'submitForm')); } return $form; }