concernement added possibility to add existing entité

This commit is contained in:
Bachir Soussi Chiadmi 2023-04-25 15:01:20 +02:00
parent 3467bc3f5f
commit 6a09481105
2 changed files with 14 additions and 1 deletions

View File

@ -39,12 +39,13 @@ content:
label_singular: ''
label_plural: ''
allow_new: true
allow_existing: false
allow_existing: true
match_operator: CONTAINS
allow_duplicate: false
collapsible: false
collapsed: false
revision: false
removed_reference: optional
third_party_settings: { }
field_menace_maintien_degres:
type: number

View File

@ -148,7 +148,19 @@ function ouatminimal_preprocess_input(&$variables) {
// rename entité reference in paragraphe "add node" to "editer entité"
if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-add$/', $name)) {
$element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Editer l'entité";
}
// rename entité reference in paragraphe "Ajouter un node existant" to "ajouyer entite existante"
// "ief-field_entite-0-subform-field_entite-form-add"
if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-add-existing$/', $name)) {
$element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Ajouter une entité éxistante";
}
// rename entité reference in paragraphe "Ajout de node" to "Ajouter"
// "ief-reference-submit-field_entite-7-subform-field_entite-form"
if (preg_match('/^ief-reference-submit-field_entite-\d+-subform-field_entite-form$/', $name)) {
$element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Ajouter";
}
// rename remove (paragraphe) to "supprimer"
if (preg_match('/field_entite_\d+_remove/', $name)) {
$element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Supprimer";