aa58a3b2ed5383fa61df7a63b39b1e3e50b6d920
[yaffs-website] / web / core / modules / layout_builder / src / Form / RemoveSectionForm.php
1 <?php
2
3 namespace Drupal\layout_builder\Form;
4
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\layout_builder\SectionStorageInterface;
7
8 /**
9  * Provides a form to confirm the removal of a section.
10  *
11  * @internal
12  */
13 class RemoveSectionForm extends LayoutRebuildConfirmFormBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getFormId() {
19     return 'layout_builder_remove_section';
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   public function getQuestion() {
26     return $this->t('Are you sure you want to remove this section?');
27   }
28
29   /**
30    * {@inheritdoc}
31    */
32   public function getConfirmText() {
33     return $this->t('Remove');
34   }
35
36   /**
37    * {@inheritdoc}
38    */
39   protected function handleSectionStorage(SectionStorageInterface $section_storage, FormStateInterface $form_state) {
40     $section_storage->removeSection($this->delta);
41   }
42
43 }