imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }
    - { resource: "@UserBundle/Resources/config/services.yml" }
    - { resource: "@FormationBundle/Resources/config/services.yml" }
    - { resource: "@LangueBundle/Resources/config/services.yml" }
    - { resource: "@CoursesBundle/Resources/config/services.yml" }

# Doctrine Configuration
doctrine:
    dbal:
        driver: pdo_mysql
        host: '%database_host%'
        port: '%database_port%'
        dbname: '%database_name%'
        user: '%database_user%'
        password: '%database_password%'
        charset: UTF8
        # if using pdo_sqlite as your database driver:
        #   1. add the path in parameters.yml
        #     e.g. database_path: '%kernel.project_dir%/var/data/data.sqlite'
        #   2. Uncomment database_path in parameters.yml.dist
        #   3. Uncomment next line:
        #path: '%database_path%'

    orm:
        auto_generate_proxy_classes: '%kernel.debug%'
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true

fos_user:
    db_driver:     orm                       # Le type de BDD à utiliser, nous utilisons l'ORM Doctrine depuis le début
    firewall_name: main                      # Le nom du firewall derrière lequel on utilisera ces utilisateurs #
    user_class:    UserBundle\Entity\Utilisateur # La classe de l'entité User que nous utilisons
    from_email:
        address: '%from_email_address%'
        sender_name: '%from_email_sender_name%'
    registration:
        form:
            type: UserBundle\Form\RegistrationFormType
        confirmation:
            enabled:    true
            template:   UserBundle:Utilisateurs:email.txt.twig # Permet de désactiver le mail fos user
    profile:
        form:
          type: UserBundle\Form\ProfileFormType
    group:
        group_class: UserBundle\Entity\groupe
    service:
        mailer: fos_user.mailer.twig_swift

framework:
    #esi: ~
    translator: { fallbacks: ['%locale%'] }
    secret: '%secret%'
    router:
        resource: '%kernel.project_dir%/app/config/routing.yml'
        strict_requirements: ~
    form: ~
    csrf_protection: ~
    validation: { enable_annotations: true }
    #serializer: { enable_annotations: true }
    default_locale: 'fr'
    trusted_hosts: ~
    session:
        # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
        handler_id: session.handler.native_file
        save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
    fragments: ~
    http_method_override: true
    assets: ~
    php_errors:
        log: true
    templating:
        engines: ['twig']
    serializer: { enable_annotations: true }

knp_paginator:
    page_range: 5                       # number of links showed in the pagination menu (e.g: you have 10 pages, a page_range of 3, on the 5th page you'll see links to page 4, 5, 6)
    default_options:
        page_name: page                 # page query parameter name
        sort_field_name: sort           # sort field query parameter name
        sort_direction_name: direction  # sort direction query parameter name
        distinct: true                  # ensure distinct results, useful when ORM queries are using GROUP BY statements
        filter_field_name: filterField  # filter field query parameter name
        filter_value_name: filterValue  # filter value query paameter name
    template:
        pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig'
        sortable:   '@KnpPaginator/Pagination/sortable_link.html.twig' # sort link template
        filtration: '@KnpPaginator/Pagination/filtration.html.twig'  # filters template

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    locale: 'fr'
    media_dossier_asset: 'uploads/media'
    media_dossier: '%kernel.project_dir%/web/%media_dossier_asset%'
    label_filtre_aucun: '--Sans filtre--' #purement décoratif
    label_filtre_vide: '--vide--' #attention au preg_quote car regexisé par DataTable
    types_media:
        #pdf: ['pdf']
        son: ['mp3', 'wav']
        vidéo: ['avi', 'mpeg', 'mp4']
        image: ['png', 'bmp', 'jpeg', 'jpg']
    #attention: modifier ces valeurs peut casser le site !
    etats_tentative: # et activite, par extention
        0: "En cours"
        1: "Validé"
        2: "Correction"
        3: "Corrigé"

#pour se débarasser d'un log deprecated inutile https://medium.com/@nebkam/symfony-deprecated-route-and-method-annotations-4d5e1d34556a
sensio_framework_extra:
    router:
        annotations: false

stfalcon_tinymce:
    tinymce_jquery: true
    use_callback_tinymce_init: true # faut définir function callback_tinymce_init(editor) {
    selector: ".tinymce" # bricolage... stfalcon est-il bien déployé dans les assets ?
    #include_jquery: true
    #tinymce_jquery: true
    # Get current language from the parameters.ini
    language: '%locale%'
    theme:
    #    # Simple theme: same as default theme
    #    simple: ~
    #    # Advanced theme with almost all enabled plugins
         simple:
              toolbar1: "undo redo | bold italic underline | paste | removeformat "
              menubar: false
              statusbar: false
              height: 300
              plugins: "paste"
              paste_as_text: true
         advanced:
              toolbar1: "undo redo | bold italic underline | crochets | paste | removeformat "
              menubar: false
              statusbar: false
              height: 300
              plugins: "paste"
              paste_as_text: true
         nsgfedition:
              toolbar1: "undo redo | crochets | bold italic underline strikethrough | bullist numlist | justifyleft justifycenter justifyright justifyfull | paste | removeformat "
              menubar: false
              statusbar: true
              height: 300
              inline: true
              selector: '.inlinetinymce'
              plugins: "paste"
              paste_as_text: true
         normale:
              toolbar1: "undo redo | bold italic underline strikethrough | forecolor backcolor | bullist numlist | justifyleft justifycenter justifyright justifyfull "
              menubar: "edit insert table"
              statusbar: false
              height: 300
              inline: true
              selector: '.inlinetinymce'
              plugins: [
                           "textcolor advlist autolink lists charmap print preview ",
                           "searchreplace visualblocks code fullscreen",
                           "insertdatetime table contextmenu paste"
                       ]
              paste_as_text: true
         prof:
              toolbar1: "undo redo | bold italic underline strikethrough | bullist numlist | justifyleft justifycenter justifyright justifyfull "
              menubar: false
              statusbar: false
              height: 150
              paste_as_text: true
              plugins: "paste"
              content_style: ".ns_correction_prof {color: red;}"
              #content_css: "asset[bundles/mybundle/css/tinymce-content.css]"
         simple_min:
              toolbar1: "undo redo | bold italic underline strikethrough | forecolor backcolor | bullist numlist | justifyleft justifycenter justifyright justifyfull | outdent indent "
              menubar: false
              statusbar: false
              height: 100
              inline: true
              selector: '.inlinetinymce'
              plugins: [
                            "textcolor advlist autolink lists link image charmap print preview anchor",
                            "searchreplace visualblocks code fullscreen",
                            "insertdatetime media table contextmenu paste"
                        ]
              paste_as_text: true
    tinymce_buttons:
         crochets:
              title: "mettre en forme" # Ne pas modifier !!
              text: '[...]'

# Swiftmailer Configuration
swiftmailer:
    transport: '%mailer_transport%'
    host: '%mailer_host%'
    username: '%mailer_user%'
    password: '%mailer_password%'
    auth_mode: login
    spool: { type: memory }

# Twig Configuration
twig:
    cache: false
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
    form_themes:
        - 'TetranzSelect2EntityBundle:Form:fields.html.twig'
        - 'datetimepicker_widget.html.twig'
        - 'inlinetinymce_widget.html.twig'
        - 'form/fields.html.twig'
        - 'bootstrap_4_layout.html.twig'
    globals:
        media_dossier_asset: '%media_dossier_asset%'
        label_filtre_aucun: '%label_filtre_aucun%'
        label_filtre_vide: '%label_filtre_vide%'
        allowed_types_media: '%types_media%'
        ecole_nom: '%ecole_nom%'
        ecole_logo: '%ecole_logo%'
