imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }

# Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    locale: fr
    photos_directory: '%kernel.project_dir%/public/uploads/photos'

framework:
    #esi:             ~
    translator:      { fallbacks: ["%locale%"] }
    secret:          "%secret%"
    router:
        resource: "%kernel.project_dir%/config/routing.yml"
        strict_requirements: ~
        type: ~
    form:            ~
    assets:          ~
    csrf_protection: ~
    validation:      ~
    #serializer:      ~
    default_locale:  "%locale%"
    trusted_hosts:   ~
    session:
        # handler_id set to null will use default session handler from php.ini
        handler_id:  ~
        storage_factory_id: session.storage.factory.native
    fragments:       ~
    http_method_override: true
    mailer:
        dsn: '%mailer_dsn%'


# Twig Configuration
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"
    paths:
        "%kernel.project_dir%/src/Cyberl/UserBundle/Resources/views": FOSUser
    form_themes:
        - '@SonataMedia/Form/media_widgets.html.twig'
        - '@SonataForm/Form/datepicker.html.twig'

# Doctrine Configuration
doctrine:
    dbal:
        driver:   pdo_mysql
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
        server_version: '5.7'
        types:
            json: Cyberl\FceBundle\DBAL\Type\LegacyJsonType

        # if using pdo_sqlite as your database driver:
        #   1. add the path in parameters.yml
        #     e.g. database_path: "%kernel.root_dir%/data/data.db3"
        #   2. Uncomment database_path in parameters.yml.dist
        #   3. Uncomment next line:
        #     path:     "%database_path%"

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        resolve_target_entities:
            Sonata\UserBundle\Entity\BaseUser: Cyberl\UserBundle\Entity\User
        entity_managers:
            default:
                quote_strategy: doctrine.orm.quote_strategy.ansi
                auto_mapping: true
                mappings:
                    ApplicationSonataMediaBundle: ~
                    SonataMediaBundle: ~
                    SonataClassificationBundle: ~
                    CyberlFceBundle:
                        type: attribute
                        dir: '%kernel.project_dir%/src/Cyberl/FceBundle/Entity'
                        prefix: 'Cyberl\FceBundle\Entity'
                        alias: CyberlFceBundle
                    CyberlUserBundle:
                        type: attribute
                        dir: '%kernel.project_dir%/src/Cyberl/UserBundle/Entity'
                        prefix: 'Cyberl\UserBundle\Entity'
                        alias: CyberlUserBundle

stof_doctrine_extensions:
    orm:
        default:
            sluggable: true
            timestampable: true


gregwar_captcha: ~

knp_menu:
    twig: true

sonata_user:
    class:
        user: Cyberl\UserBundle\Entity\User

#######
#ADMIN#
#######
sonata_intl:
    timezone:
        # default timezone used as fallback
        default: Europe/Paris

        # locale specific overrides
        locales:
            fr: Europe/Paris
            fr_FR: Europe/Paris
            en_UK: Europe/Paris
        detectors:
            - sonata.intl.timezone_detector.user
            - sonata.intl.timezone_detector.locale_aware
sonata_block:
    default_contexts: [cms]
    blocks:
        sonata.admin.block.admin_list:
            contexts:   [admin]

        sonata.admin_doctrine_orm.block.audit:
            contexts:   [admin]

        sonata.block.service.text:
        sonata.block.service.action:
        sonata.block.service.rss:

        # Some specific block from the SonataMediaBundle
        sonata.media.block.media:
        sonata.media.block.gallery:
        sonata.media.block.feature_media:

sonata_admin:
    title:      FCE France - Administration
    title_logo: bundles/sonataadmin/logo_title.png
    templates:
        # default global templates
        layout:  CyberlFceBundle:Admin:sonata_standard_layout.html.twig
        ajax:    SonataAdminBundle::ajax_layout.html.twig

        # default actions templates, should extend a global templates
        list:    SonataAdminBundle:CRUD:list.html.twig
        show:    SonataAdminBundle:CRUD:show.html.twig
        edit:    SonataAdminBundle:CRUD:edit.html.twig
    dashboard:
        blocks:
            # display a dashboard block
            - { position: left, type: sonata.admin.block.admin_list, settings: { groups: [users, delegations, evenement, documents] } }
            - { position: right, type: sonata.block.service.text, settings: { content: "<h2>Bienvenue dans votre espace d'administration</h2> <p>Sélectionnez dans les blocs ci-contre la partie que vous souhaitez administrer</p><p>&nbsp;</p>"} }
            - { position: right, type: sonata.admin.block.admin_list, settings: { groups: [annonces, articles,pages,partenaires,divers] } }
        groups:
            users:
                label: Adhérentes
                items:
                    - sonata.user.admin.user
                    - sonata.admin.preinscription
                    - sonata.admin.mandat
                    - sonata.admin.activite
                    - sonata.admin.activiteparent
                    - sonata.admin.newsletter
            delegations:
                label: Délégations
                items:
                    - sonata.admin.delegation
                    - sonata.admin.delegationbureau
                    - sonata.admin.region
                    - cyberl_fce.admin.delegation_communication_cat
            annonces:
                label: Annonces
                items:
                    - sonata.admin.annonce
                    - sonata.admin.catannonce
            landing:
                label: Landing
                items:
                    - sonata.admin.landing
            evenement:
                label: Evénements
                items:
                    - sonata.admin.evenement
            documents:
                label: Documents
                items:
                    - sonata.admin.doc
                    - sonata.admin.doccat
                    - sonata.media.admin.media
            articles:
                label: Actualités
                items:
                    - sonata.admin.article
            pages:
                label: Pages
                items:
                    - sonata.admin.page
            partenaires:
                label: Partenaires
                items:
                    - sonata.admin.partenaire
                    - sonata.admin.partenairecat
            divers:
                label: Paiement
                items:
                    - sonata.admin.cotisationnational
                    - sonata.admin.userstatut
                    - sonata.admin.paiement

sonata_media:
    class:
        media: Application\Sonata\MediaBundle\Entity\Media
        gallery: Application\Sonata\MediaBundle\Entity\Gallery
        gallery_item: Application\Sonata\MediaBundle\Entity\GalleryHasMedia
        category: Application\Sonata\ClassificationBundle\Entity\Category
    default_context: default
    db_driver: doctrine_orm # or doctrine_mongodb
    contexts:
        default:  # the default context is mandatory
            providers:
                - sonata.media.provider.image
                - sonata.media.provider.file
            formats:
                delegation: { width: 311, height: 207 , quality: 90}
                bureau: { width: 143, height: 201 , quality: 90}
                trophee: { width: 210, height: 127 , quality: 90}
                partenaire: { width: 157, height: 106 , quality: 90}
                article: { width: 260, height: 200 , quality: 90}
            download:
                strategy: sonata.media.security.public_strategy
                #strategy: sonata.media.security.connected_strategy
        kbis:
            providers:
                - sonata.media.provider.file
            formats:
                small: { width: 100 , quality: 50}
        user:
            providers:
                - sonata.media.provider.image

            formats:
                preview:   { width: 50, quality: 100}
                small:     { width: 200, quality: 100}
                large:     { width: 600, quality: 100}
    cdn:
        server:
            path: /uploads/media # http://media.sonata-project.org/
    filesystem:
        local:
            directory:  "%kernel.project_dir%/public/uploads/media"
            create:     false
    providers:
        file:
            service:    sonata.media.provider.file
            resizer:    null
            filesystem: sonata.media.filesystem.local
            cdn:        sonata.media.cdn.server
            generator:  sonata.media.generator.default
            thumbnail:  sonata.media.thumbnail.format
            allowed_extensions: ['pdf', 'doc', 'docx', 'xls', 'xlsx']
            allowed_mime_types: ['application/pdf', 'application/x-pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
        image:
            service:    sonata.media.provider.image
            resizer:    sonata.media.resizer.simple
            filesystem: sonata.media.filesystem.local
            cdn:        sonata.media.cdn.server
            generator:  sonata.media.generator.default
            thumbnail:  sonata.media.thumbnail.format
            allowed_extensions: ['jpg', 'jpeg', 'png', 'gif']
            allowed_mime_types: ['image/jpeg', 'image/png', 'image/gif']


#######
#IMAGE#
#######



################
# TINYMCE CONF #
################
stfalcon_tinymce:
    include_jquery: false
    tinymce_jquery: false
    selector: ".tinymce"
    language: "%locale%"
    base_url: "/"
    theme:
        mailtemplate:
            document_base_url: "/"
        simple:
            file_browser_callback: "openKCFinderTinyMCE"
            theme: "advanced"
            plugins: "advlist,autolink,lists,link,image,charmap,print,preview,hr,anchor,pagebreak,searchreplace,wordcount,visualblocks,visualchars,code,insertdatetime,media,nonbreaking,save,table,contextmenu,directionality,emoticons,template,paste,textcolor,colorpicker,textpattern"
            toolbar1: "undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor"
            theme_advanced_toolbar_location: "top"
            theme_advanced_toolbar_align: "left"
            theme_advanced_statusbar_location: "bottom"
            theme_advanced_resizing: true
            file_picker_types: 'file image media'
            style_formats: [{title: "Headers", items: [{title: "Header 1", format: "h1"}, {title: "Header 2", format: "h2"}, {title: "Header 3", format: "h3"}, {title: "Header 4", format: "h4"}, {title: "Header 5", format: "h5"}, {title: "Header 6", format: "h6"} ]}, {title: "Blocks", items: [{title: "Paragraph", format: "p"}, {title: "Blockquote", format: "blockquote"}, {title: "Div", format: "div"}, {title: "Pre", format: "pre"}]}]
            content_css: "asset[bundles/cyberlfce/css/tinymce.css]"
            document_base_url: "/"
            relative_urls: false
        advanced:
            file_browser_callback: "openKCFinderTinyMCE"
            theme: "advanced"
            plugins: "advlist,autolink,lists,link,image,charmap,print,preview,hr,anchor,pagebreak,searchreplace,wordcount,visualblocks,visualchars,code,insertdatetime,media,nonbreaking,save,table,contextmenu,directionality,emoticons,template,paste,textcolor,colorpicker,textpattern"
            toolbar1: "undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor"
            theme_advanced_toolbar_location: "top"
            theme_advanced_toolbar_align: "left"
            theme_advanced_statusbar_location: "bottom"
            theme_advanced_resizing: true
            file_picker_types: 'file image media'
            style_formats: [{title: "Headers", items: [{title: "Header 1", format: "h1"}, {title: "Header 2", format: "h2"}, {title: "Header 3", format: "h3"}, {title: "Header 4", format: "h4"}, {title: "Header 5", format: "h5"}, {title: "Header 6", format: "h6"} ]}, {title: "Blocks", items: [{title: "Paragraph", format: "p"}, {title: "Blockquote", format: "blockquote"}, {title: "Div", format: "div"}, {title: "Pre", format: "pre"}]}]
            content_css: "asset[bundles/cyberlfce/css/tinymce.css]"
            document_base_url: "/"
            relative_urls: false
        medium:
            file_browser_callback: "openKCFinderTinyMCE"
            mode: "textareas"
            theme: "advanced"
            plugins: "table,paste,spellchecker"
            theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,|,hr,removeformat,|,sub,sup,|,spellchecker"
            theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,link,unlink,anchor,cleanup,code,|,tablecontrols"
            theme_advanced_buttons3: ""
            theme_advanced_toolbar_location: "top"
            theme_advanced_toolbar_align: "left"
            theme_advanced_statusbar_location: ""
            paste_auto_cleanup_on_paste: true
            convert_urls : false
            document_base_url: "/"
            relative_urls: false
        bbcode:
            file_browser_callback: "openKCFinderTinyMCE"
            mode: "none"
            theme: "advanced"
            plugins: "bbcode"
            theme_advanced_buttons1: "bold,italic,underline,undo,redo,link,unlink,image,forecolor,styleselect,removeformat,cleanup,code"
            theme_advanced_buttons2: ""
            theme_advanced_buttons3: ""
            theme_advanced_toolbar_location: "bottom"
            theme_advanced_toolbar_align: "center"
            theme_advanced_styles: "Code=codeStyle;Quote=quoteStyle"
            entity_encoding: "raw"
            convert_urls : false
            add_unload_trigger: false
            remove_linebreaks: false
            inline_styles: false
            convert_fonts_to_spans: false
            document_base_url: "/"
            relative_urls: false

#######################
# MOTEUR DE RECHERCHE #
#######################

#ewz_search: #Common_Utf8#TextNum\CaseInsensitive
#    analyzer: Zend\Search\Lucene\Analysis\Analyzer\Common\Utf8\CaseInsensitive
#    path:     %kernel.root_dir%/cache/%kernel.environment%/lucene/index

#######################
#    PAGINATION       #
#######################
knp_paginator:
    page_range: 5                      # default page range used in pagination control
    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
    template:
        pagination: '@KnpPaginator/Pagination/sliding.html.twig'     # sliding pagination controls template
        sortable: '@KnpPaginator/Pagination/sortable_link.html.twig' # sort link template

########################
#       FLUX RSS       #
########################
os_rss:
  title: FCE France,
  description: Les dernières actualités de FCE France
  language: fr
  webMaster: contact@fcefrance.fr
  link: www.fcefrance.fr
  item:
    entity: CyberlFceBundle:Article
    alias: a
    limit: 15
    title: titre
    description: description
    pubDate: date
    guid: id
    link: {route: showArticle, params: {slug: slug}}

###################
#    PAIEMENT     #
###################
#jms_payment_core:
#    secret: s3cr3tFROMcYbErL
liip_imagine:
    twig:
        mode: lazy
    resolvers:
        default:
            web_path: ~

    filter_sets:
        cache: ~

        # the name of the "filter set"
        my_thumb:

            # adjust the image quality to 100%
            quality: 100

            # list of transformations to apply (the "filters")
            filters:

                # create a thumbnail: set size to 140x180 and use the "outbound" mode
                # to crop the image when the size ratio of the input differs
                thumbnail: { size: [140, 180], mode: outbound }
        delegation:

            # adjust the image quality to 100%
            quality: 100

            # list of transformations to apply (the "filters")
            filters:

                # create a thumbnail: set size to 140x180 and use the "outbound" mode
                # to crop the image when the size ratio of the input differs
                thumbnail: { size: [311, 207], mode: outbound }

ensepar_html2pdf:
    orientation: P
    format: A4
    lang: fr
    unicode: true
    encoding: UTF-8
    margin: [10,15,10,15]
