3 namespace Drupal\layout_builder\Form;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\layout_builder\SectionStorageInterface;
9 * Provides a form to confirm the removal of a block.
13 class RemoveBlockForm extends LayoutRebuildConfirmFormBase {
23 * The UUID of the block being removed.
32 public function getQuestion() {
33 return $this->t('Are you sure you want to remove this block?');
39 public function getConfirmText() {
40 return $this->t('Remove');
46 public function getFormId() {
47 return 'layout_builder_remove_block';
53 public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
54 $this->region = $region;
56 return parent::buildForm($form, $form_state, $section_storage, $delta);
62 protected function handleSectionStorage(SectionStorageInterface $section_storage, FormStateInterface $form_state) {
63 $section_storage->getSection($this->delta)->removeComponent($this->uuid);