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

Issue #3270227 by RenatoG: Implement the bulk operation on add attributes...

Issue #3270227 by RenatoG: Implement the bulk operation on add attributes recognize the settings for field type and maxlengh of settings page
parent 674e4c82
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -152,10 +152,27 @@ class BlockClassBulkOperationsForm extends ConfigFormBase {
      ],
    ];

    // Default field type for attributes.
    $field_type_attributes = 'textarea';

    // Default value for maxlength on attributes.
    $maxlength_attributes = FALSE;

    // Get the field type for attributes.
    if (!empty($config->get('field_type_attributes'))) {
      $field_type_attributes = $config->get('field_type_attributes');
    }

    // Get maxlength if exists.
    if (!empty($config->get('maxlength_attributes'))) {
      $maxlength_attributes = $config->get('maxlength_attributes');
    }

    $form['attributes_to_be_added'] = [
      '#title' => $this->t("Attributes to be added"),
      '#type' => 'textarea',
      '#type' => $field_type_attributes,
      '#description' => $this->t('Here you can insert any attributes, use one per line. For example: data-block-type|info'),
      '#maxlength' => $maxlength_attributes,
      '#states' => [
        'visible' => [
          ':input[name="operation"]' => [