Skip to content

Commit

Permalink
DIGITAL-28: Update to do/dont table with new module
Browse files Browse the repository at this point in the history
  • Loading branch information
clmedders committed Oct 28, 2024
1 parent ab5fac5 commit 01526eb
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\embedded_content\EmbeddedContentInterface;
use Drupal\embedded_content\EmbeddedContentPluginBase;
use Drupal\multivalue_form_element\Element\MultiValue;

/**
* Plugin iframes.
Expand All @@ -27,6 +28,7 @@ public function defaultConfiguration() {
return [
'heading' => NULL,
'text' => NULL,
'checklist' => NULL,
];
}

Expand All @@ -38,6 +40,7 @@ public function build(): array {
'#theme' => 'ec_shortcodes_do_dont_table',
'#heading' => $this->configuration['text'],
'#text' => $this->configuration['text'],
'#checklist' => $this->configuration['checklist'],
];
}

Expand All @@ -57,6 +60,23 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
'#default_value' => $this->configuration['text'],
'#required' => TRUE,
];
$form['checklist'] = [
'#type' => 'multivalue',
'#title' => $this->t("Do/Don't Table"),
'#add_more_label' => $this->t('Add Row'),
'#cardinality' => MultiValue::CARDINALITY_UNLIMITED,
'#default_value' => $this->configuration['checklist'],
'checkbox' => [
'#type' => 'textarea',
'#title' => $this->t('Do'),
'#description' => $this->t('This will add text for the Do Colum'),
],
'sublist' => [
'#type' => 'textarea',
'#title' => $this->t("Don't"),
'#description' => $this->t("This will add text for the Don't Colum"),
],
];
return $form;
}

Expand Down

0 comments on commit 01526eb

Please sign in to comment.