Loading src/Form/BlockClassSettingsForm.php +29 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,25 @@ class BlockClassSettingsForm extends ConfigFormBase { '#default_value' => $config->get('enable_attributes'), ]; $qty_attributes_per_block = 10; // If there is a settings for that use this. if (!empty($config->get('qty_attributes_per_block'))) { $qty_attributes_per_block = $config->get('qty_attributes_per_block'); } // Define the settings for quantity per block. $form['global_settings']['attributes']['qty_attributes_per_block'] = [ '#title' => $this->t("Quantity of attributes per block"), '#type' => 'number', '#default_value' => $qty_attributes_per_block, '#states' => [ 'visible' => [ ':input[name="enable_attributes"]' => ['checked' => TRUE], ], ], ]; $maxlength_attributes = FALSE; if (!empty($config->get('maxlength_attributes'))) { Loading Loading @@ -283,6 +302,12 @@ class BlockClassSettingsForm extends ConfigFormBase { $form_state->setErrorByName('qty_classes_per_block', $this->t('The quantity of classes per block should be an positive value')); } $qty_attributes_per_block = $form_state->getValue('qty_attributes_per_block'); if ($qty_attributes_per_block < 1) { $form_state->setErrorByName('qty_attributes_per_block', $this->t('The quantity of attributes per block should be an positive value')); } // Get the $items_per_page field. $items_per_page = $form_state->getValue('items_per_page'); Loading Loading @@ -327,6 +352,10 @@ class BlockClassSettingsForm extends ConfigFormBase { // Set the quantity per block in the settings. $config->set('qty_classes_per_block', $qty_classes_per_block); $qty_attributes_per_block = $form_state->getValue('qty_attributes_per_block'); $config->set('qty_attributes_per_block', $qty_attributes_per_block); // Get the maxlength_block_class_field field. $maxlength_block_class_field = $form_state->getValue('maxlength_block_class_field'); Loading Loading
src/Form/BlockClassSettingsForm.php +29 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,25 @@ class BlockClassSettingsForm extends ConfigFormBase { '#default_value' => $config->get('enable_attributes'), ]; $qty_attributes_per_block = 10; // If there is a settings for that use this. if (!empty($config->get('qty_attributes_per_block'))) { $qty_attributes_per_block = $config->get('qty_attributes_per_block'); } // Define the settings for quantity per block. $form['global_settings']['attributes']['qty_attributes_per_block'] = [ '#title' => $this->t("Quantity of attributes per block"), '#type' => 'number', '#default_value' => $qty_attributes_per_block, '#states' => [ 'visible' => [ ':input[name="enable_attributes"]' => ['checked' => TRUE], ], ], ]; $maxlength_attributes = FALSE; if (!empty($config->get('maxlength_attributes'))) { Loading Loading @@ -283,6 +302,12 @@ class BlockClassSettingsForm extends ConfigFormBase { $form_state->setErrorByName('qty_classes_per_block', $this->t('The quantity of classes per block should be an positive value')); } $qty_attributes_per_block = $form_state->getValue('qty_attributes_per_block'); if ($qty_attributes_per_block < 1) { $form_state->setErrorByName('qty_attributes_per_block', $this->t('The quantity of attributes per block should be an positive value')); } // Get the $items_per_page field. $items_per_page = $form_state->getValue('items_per_page'); Loading Loading @@ -327,6 +352,10 @@ class BlockClassSettingsForm extends ConfigFormBase { // Set the quantity per block in the settings. $config->set('qty_classes_per_block', $qty_classes_per_block); $qty_attributes_per_block = $form_state->getValue('qty_attributes_per_block'); $config->set('qty_attributes_per_block', $qty_attributes_per_block); // Get the maxlength_block_class_field field. $maxlength_block_class_field = $form_state->getValue('maxlength_block_class_field'); Loading