Commit c247391a authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3275185 by RenatoG: Add a settings item with a toogle to allow replacing the id

parent e13a0664
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -242,10 +242,22 @@ class BlockClassSettingsForm extends ConfigFormBase {
      ],
    ];

    $form['global_settings']['id'] = [
      '#type' => 'details',
      '#title' => $this->t('ID'),
      '#open' => TRUE,
    ];

    $form['global_settings']['id']['enable_id_replacement'] = [
      '#title' => $this->t("Enable id replacement"),
      '#type' => 'checkbox',
      '#default_value' => $config->get('enable_id_replacement'),
    ];

    $form['global_settings']['block_class_list'] = [
      '#type' => 'details',
      '#title' => $this->t('Block Class List'),
      '#open' => TRUE,
      '#open' => FALSE,
    ];

    $items_per_page = 50;
@@ -366,6 +378,8 @@ class BlockClassSettingsForm extends ConfigFormBase {

    $enable_attributes = $form_state->getValue('enable_attributes');

    $enable_id_replacement = $form_state->getValue('enable_id_replacement');

    $items_per_page = $form_state->getValue('items_per_page');

    $filter_html_clean_css_identifier = $form_state->getValue('filter_html_clean_css_identifier');
@@ -377,6 +391,7 @@ class BlockClassSettingsForm extends ConfigFormBase {
    $config->set('qty_classes_per_block', $qty_classes_per_block);
    $config->set('maxlength_block_class_field', $maxlength_block_class_field);
    $config->set('enable_attributes', $enable_attributes);
    $config->set('enable_id_replacement', $enable_id_replacement);
    $config->set('maxlength_attributes', $maxlength_attributes);
    $config->set('items_per_page', $items_per_page);
    $config->set('filter_html_clean_css_identifier', $filter_html_clean_css_identifier);