<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:five="http://namespaces.zope.org/five"
    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
    xmlns:i18n="http://namespaces.zope.org/i18n"
    i18n_domain="ploneintranet">

  <include package="." file="permissions.zcml" />

    <!-- Zope2 initialization -->
    <five:registerPackage package="." initialize=".initialize" />

    <!-- Include configuration for dependencies listed in setup.py -->
    <includeDependencies package="." />

    <include package=".viewlets" />
    <include package=".adapters" />
    <include package=".browser" />
    <include package=".upgrades" />

    <!-- switch off all IAppLayer on the navigation root -->
    <subscriber
        for="plone.app.layout.navigation.interfaces.INavigationRoot
             zope.app.publication.interfaces.IBeforeTraverseEvent"
        handler=".layers.disable_app_layers"
        />
    <!-- enable only the "right" IAppLayer per app
         see app.AbstractAppContainer -->

    <genericsetup:registerProfile
        name="default"
        title="Plone Intranet: -- [Layout]"
        directory="profiles/default"
        description="Extension profile for ploneintranet.layout."
        provides="Products.GenericSetup.interfaces.EXTENSION"
        post_handler="ploneintranet.layout.setuphandlers.setupVarious"
        />

    <genericsetup:registerProfile
        name="uninstall"
        title="Plone Intranet: -- [Layout uninstall]"
        directory="profiles/uninstall"
        description="Extension profile for ploneintranet.layout."
        provides="Products.GenericSetup.interfaces.EXTENSION"
        post_handler="ploneintranet.layout.setuphandlers.uninstall"
        />

</configure>
