{% extends '@SonataAdmin/CRUD/base_list.html.twig' %} {% block navbar_title %} Configuration Globale Kohinos {% endblock %} {% block actions %} {# Suppression intentionnelle du bouton Ajouter #} {% endblock %} {% block list_table %} {% set all_parameters = admin.allParameters %} {% set parameter_sections = admin.parameterSections %} {# Formulaire englobant pour sauvegarder tous les changements #}
{# Champ caché pour le token CSRF #} {# Champ caché pour tracker les valeurs originales #} {# Barre d'actions Sonata #}
Annuler
{% for section_key, section in parameter_sections %} {% set section_id = 'section_' ~ section_key %} {% set is_disabled = section.disabled is defined and section.disabled %} {% set is_collapsible = section.collapsible is defined and section.collapsible %} {% set has_activation = section.enabledBy is defined %} {% set is_empty_module = (section.parameters|length == 0 and section.subsections is not defined) %} {# Récupérer le paramètre d'activation depuis activationParameter #} {% set activation_param = section.activationParameter is defined ? section.activationParameter : null %}
{# Header de section #}

{% if section.icon is defined %} {% endif %} {{ section.title }}

{# Switch d'activation si le module en a un #} {% if has_activation and activation_param %}
{% endif %} {# Icône de collapse pour les sections pliables NON VIDES #} {% if is_collapsible and not is_empty_module %} {% endif %}
{# Corps de section - NE PAS AFFICHER POUR LES MODULES VIDES #} {% if not is_empty_module %}
{# Afficher les sous-rubriques si présentes #} {% if section.subsections is defined %} {% for subsection_key, subsection in section.subsections %}

{{ subsection.title }}

{% for object in subsection.parameters %}
{{ object.description }} {% if admin.help(object.name) %} {{ admin.help(object.name)|raw }} {% endif %}
{% if object.value == 'true' or object.value == 'false' %} {% elseif object.name ends with 'TEXT' or object.name ends with 'ADRESS' %} {% else %} {% endif %}
{% endfor %}
{% endfor %} {% elseif section.title == 'Carte' %} {% set mapCenter = '' %} {% set mapZoom = '' %} {% set allowGeolocation = 'false' %} {% for object in section.parameters %} {% if object.name == 'MAP_CENTER' %} {% set mapCenter = object.value %} {% endif %} {% if object.name == 'MAP_ZOOM' %} {% set mapZoom = object.value %} {% endif %} {% if object.name == 'ALLOW_GEOLOCATION' %} {% set allowGeolocation = object.value %} {% endif %} {% include '@kohinos/admin/list_parameter_row.html.twig' with { 'object': object, 'admin': admin } %} {% endfor %} {# Champs cachés pour la carte #}
Aperçu de la carte :
{% else %} {% for object in section.parameters %} {# Ne pas afficher le paramètre d'activation s'il est déjà dans le header #} {% set is_activation_param = has_activation and activation_param and object.id == activation_param.id %} {% if not is_activation_param %}
{{ object.description }} {% if admin.help(object.name) %} {{ admin.help(object.name)|raw }} {% endif %}
{% if object.value == 'true' or object.value == 'false' %} {% elseif object.name == 'ADHESION_TEXT' %} {% elseif object.name ends with 'TEXT' or object.name ends with 'ADRESS' %} {% else %} {% endif %}
{% endif %} {% endfor %} {% endif %}
{% endif %}
{% endfor %}
{# Barre d'actions Sonata #}
Annuler
{# Fin du formulaire global #} {# Initialisation CKEditor pour ADHESION_TEXT #} {% endblock %}