4 * Contains \Drupal\bootstrap\Plugin\Setting\General\Forms\FormsSmartDescriptionsLimit.
7 namespace Drupal\bootstrap\Plugin\Setting\General\Forms;
9 use Drupal\bootstrap\Annotation\BootstrapSetting;
10 use Drupal\bootstrap\Plugin\Setting\SettingBase;
11 use Drupal\bootstrap\Utility\Element;
12 use Drupal\Core\Annotation\Translation;
13 use Drupal\Core\Form\FormStateInterface;
16 * The "forms_smart_descriptions_limit" theme setting.
18 * @ingroup plugins_setting
21 * id = "forms_smart_descriptions_limit",
23 * title = @Translation("Smart form descriptions maximum character limit"),
24 * defaultValue = "250",
25 * description = @Translation("Prevents descriptions from becoming tooltips by checking the character length of the description (HTML is not counted towards this limit). To disable this filtering criteria, leave an empty value."),
27 * "general" = @Translation("General"),
28 * "forms" = @Translation("Forms"),
32 class FormsSmartDescriptionsLimit extends SettingBase {
37 public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
38 $setting = $this->getSettingElement($form, $form_state);
39 $setting->setProperty('states', [
41 ':input[name="forms_smart_descriptions"]' => ['checked' => TRUE],