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

  <include package="plone.tiles" file="meta.zcml" />
  <include package=".prototype" />
  <include file="switchoff.zcml" />

  <!-- Provides markup around the Dexterity Add/Edit forms -->
  <adapter factory=".formwrapper.layout_factory" />

  <!-- Custom widgets using the provided layout -->
  <adapter factory=".widgets.PloneIntranetSelectFieldWidget" />

  <!-- set 'app-whatever' body class -->
  <browser:page
      name="plone_layout"
      for="*"
      permission="zope.Public"
      class=".policy.LayoutPolicy"
      allowed_interface="plone.app.layout.globals.interfaces.ILayoutPolicy"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="webstats_js"
      for="*"
      permission="zope.Public"
      class=".webstats_js.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <z3c:widgetTemplate
      mode="input"
      widget="z3c.form.interfaces.ISubmitWidget"
      layer="ploneintranet.layout.interfaces.IPloneintranetFormLayer"
      template="templates/submit_input.pt"
      />

  <browser:page
      name="apps.html"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".apps.Apps"
      permission="zope.Public"
      template="templates/apps.pt"
  />

  <browser:page
      name="app-not-available.html"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".apps.AppNotAvailable"
      permission="zope.Public"
      template="templates/app-not-available.pt"
  />

  <browser:page
      name="dashboard.html"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".dashboard.Dashboard"
      permission="ploneintranet.viewsite"
      template="templates/dashboard.pt"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <!--
      Override broken behaviour of plone.app.content delete_confirmation
      See https://github.com/plone/plone.app.content/issues/38
  -->
  <browser:page
      for="*"
      name="delete_confirmation"
      class=".actions.PIDeleteConfirmationForm"
      permission="zope2.DeleteObjects"
      layer="ploneintranet.theme.interfaces.IThemeSpecific"
      />

  <browser:page
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      name="date-picker-i18n.json"
      class=".date_picker.I18nJSONView"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="personal-menu.html"
      for="*"
      permission="zope.Public"
      template="templates/personal-menu.pt"
      class=".personal_tools.PersonalTools"
      layer="..interfaces.IPloneintranetLayoutLayer"
      />

  <plone:tile
      name="tasks.tile"
      title="A title for the tasks"
      description="My tile's description"
      add_permission="cmf.ManagePortal"
      class=".dashboard.TasksTile"
      permission="zope.Public"
      for="*"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <plone:tile
      name="news.tile"
      title="A title for the news"
      description="News tile showing news on the dashboard"
      add_permission="cmf.ManagePortal"
      class=".dashboard.NewsTile"
      permission="zope.Public"
      for="*"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <plone:tile
      name="my_documents.tile"
      title="Documents"
      description="Tile to list recently modified documents"
      add_permission="cmf.ManagePortal"
      permission="zope2.View"
      class=".dashboard.MyDocumentsTile"
      template="templates/my_documents.pt"
      for="Products.CMFPlone.interfaces.siteroot.IPloneSiteRoot"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

</configure>
