services:
    _defaults:
        autoconfigure: true

    _instanceof:
        Contao\CoreBundle\Framework\FrameworkAwareInterface:
            calls:
                - [setFramework, ['@contao.framework']]

    contao_news.listener.generate_page:
        class: Contao\NewsBundle\EventListener\GeneratePageListener
        arguments:
            - '@contao.framework'
        tags:
            - { name: contao.hook, hook: generatePage }

    contao_news.listener.insert_tags:
        class: Contao\NewsBundle\EventListener\InsertTagsListener
        arguments:
            - '@contao.framework'
        tags:
            - { name: contao.hook, hook: replaceInsertTags }

    contao_news.listener.preview_url_convert:
        class: Contao\NewsBundle\EventListener\PreviewUrlConvertListener
        arguments:
            - '@contao.framework'
        tags:
            - kernel.event_listener

    contao_news.listener.preview_url_create:
        class: Contao\NewsBundle\EventListener\PreviewUrlCreateListener
        arguments:
            - '@request_stack'
            - '@contao.framework'
        tags:
            - kernel.event_listener

    contao_news.picker.news_provider:
        class: Contao\NewsBundle\Picker\NewsPickerProvider
        arguments:
            - '@knp_menu.factory'
            - '@router'
            - '@?translator'
            - '@security.helper'
        tags:
            - { name: contao.picker_provider, priority: 128 }
