function config_translation_config_schema_info_alter
Same name in other branches
- 8.9.x core/modules/config_translation/config_translation.module \config_translation_config_schema_info_alter()
- 10 core/modules/config_translation/config_translation.module \config_translation_config_schema_info_alter()
- 11.x core/modules/config_translation/config_translation.module \config_translation_config_schema_info_alter()
Implements hook_config_schema_info_alter().
File
-
core/
modules/ config_translation/ config_translation.module, line 181
Code
function config_translation_config_schema_info_alter(&$definitions) {
$map = [
'label' => '\\Drupal\\config_translation\\FormElement\\Textfield',
'text' => '\\Drupal\\config_translation\\FormElement\\Textarea',
'date_format' => '\\Drupal\\config_translation\\FormElement\\DateFormat',
'text_format' => '\\Drupal\\config_translation\\FormElement\\TextFormat',
'mapping' => '\\Drupal\\config_translation\\FormElement\\ListElement',
'sequence' => '\\Drupal\\config_translation\\FormElement\\ListElement',
'plural_label' => '\\Drupal\\config_translation\\FormElement\\PluralVariants',
];
// Enhance the text and date type definitions with classes to generate proper
// form elements in ConfigTranslationFormBase. Other translatable types will
// appear as a one line textfield.
foreach ($definitions as $type => &$definition) {
if (isset($map[$type]) && !isset($definition['form_element_class'])) {
$definition['form_element_class'] = $map[$type];
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.