| Total Complexity | 6 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class DefaultConfigLayout extends LayoutDefault implements PluginFormInterface { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * {@inheritdoc} |
||
| 13 | */ |
||
| 14 | public function defaultConfiguration() { |
||
| 18 | ]; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function build(array $regions) { |
||
| 22 | $build = parent::build($regions); |
||
| 23 | if (!empty($this->configuration['class'])) { |
||
| 24 | $build['#attributes']['class'][] = $this->configuration['class']; |
||
| 25 | } |
||
| 26 | return $build; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * {@inheritdoc} |
||
| 31 | */ |
||
| 32 | public function buildConfigurationForm(array $form, FormStateInterface $form_state) { |
||
| 33 | $form['class'] = [ |
||
| 34 | '#type' => 'textfield', |
||
| 35 | '#title' => $this->t('Extra Classes'), |
||
| 36 | '#default_value' => $this->configuration['class'], |
||
| 37 | ]; |
||
| 38 | $form['full_width'] = [ |
||
| 39 | '#type' => 'checkbox', |
||
| 40 | '#title' => $this->t('Full width'), |
||
| 41 | '#default_value' => $this->configuration['full_width'], |
||
| 42 | ]; |
||
| 43 | return $form; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc} |
||
| 54 | */ |
||
| 55 | public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { |
||
| 58 | } |
||
| 59 | |||
| 60 | } |
||
| 61 |