Skip to content
Snippets Groups Projects
Commit 7ec5d8e2 authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3270211 by RenatoG: Make bulk operations to be consider the settings on...

Issue #3270211 by RenatoG: Make bulk operations to be consider the settings on fieldtype and maxlengh of settings page
parent bb07e98c
No related branches found
No related tags found
10 merge requests!62Issue #3272848 by RenatoG: When the error appear the field is hidden and the...,!59Issue #3497768: Click JavaScript to close details causes modals to scroll unnecessarily,!35Issue #3366420: \Drupal calls should be avoided in classes,!34Issue #3366420: \Drupal calls should be avoided in classes,!29Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!28Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!23Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!22Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!20Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!7Issue #3320529 by justcaldwell: block_classes_stored setting only retains classes from most recently saved block
......@@ -102,6 +102,9 @@ class BlockClassBulkOperationsForm extends ConfigFormBase {
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// Get config object.
$config = $this->configFactory->getEditable('block_class.settings');
$form['operation'] = [
'#title' => $this->t("Operation"),
'#type' => 'select',
......@@ -114,10 +117,27 @@ class BlockClassBulkOperationsForm extends ConfigFormBase {
],
];
// Default field type.
$field_type = 'textfield';
// Default value for maxlength.
$maxlength_block_class_field = 255;
// Get the field type if exists.
if (!empty($config->get('field_type'))) {
$field_type = $config->get('field_type');
}
// Get maxlength if exists.
if (!empty($config->get('maxlength_block_class_field'))) {
$maxlength_block_class_field = $config->get('maxlength_block_class_field');
}
$form['classes_to_be_added'] = [
'#title' => $this->t("Classes to be added"),
'#type' => 'textfield',
'#type' => $field_type,
'#description' => $this->t("Customize the styling of all blocks by adding CSS classes. Separate multiple classes by spaces."),
'#maxlength' => $maxlength_block_class_field,
'#states' => [
'visible' => [
':input[name="operation"]' => [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment