<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="untranslated"
    >

  <include
      package="plone.tiles"
      file="meta.zcml"
      />
  <include package="z3c.jbot" />
  <browser:jbot
      directory="overrides"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />
  <browser:jbot
      directory="overrides-quaive-specific"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <include file="switchoff.zcml" />

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


  <!-- This view is used to check whether the Ploneintranet theme is enabled.
  Use it as follows:
      <div tal:condition="exists: here/@@ploneintranet_enabled">...</div>
      <div tal:condition="not: exists: here/@@ploneintranet_enabled">...</div>
  -->
  <browser:page
      name="ploneintranet_enabled"
      for="*"
      class=".utils.PloneintranetEnabled"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

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

  <!-- bindings for prototype
       intentionally zope.Public
  -->
  <browser:page
      name="proto"
      for="*"
      class=".proto.ProtoView"
      permission="zope.Public"
      />

  <browser:page
      name="mobile-menu"
      for="*"
      template="templates/mobile_menu.pt"
      permission="zope.Public"
      />

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

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

  <browser:page
      name="apps.html"
      for="ploneintranet.layout.app.IAppsContainer"
      class=".apps.Apps"
      template="templates/apps.pt"
      permission="ploneintranet.viewsite"
      />

  <browser:page
      name="view"
      for="ploneintranet.layout.app.IApp"
      class=".apps.AppNoBarcelonetaView"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="app-tile"
      for="ploneintranet.layout.app.IApp"
      class=".apps.AppTile"
      template="templates/app-tile.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="app-redirect-to-url"
      for="ploneintranet.layout.app.IApp"
      class=".apps.AppRedirect"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <!-- Additional registration under a different name so that AppTile can
       check for it. This is legacy behavior. Existing apps with this view
       name should be migrated to use "app-redirect-to-url" and set the field
       "external" on the app object to True. -->
  <browser:page
      name="external-app"
      for="ploneintranet.layout.app.IApp"
      class=".apps.AppRedirect"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

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

  <browser:page
      name="app-unauthorized"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".apps.AppNotAvailable"
      template="templates/app-unauthorized.pt"
      permission="zope2.View"
      />

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

  <browser:page
      name="dashboard.html"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".barceloneta.BarcelonetaWarning"
      permission="ploneintranet.viewsite"
      />

  <browser:page
      name="edit-dashboard"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".dashboard.EditDashboard"
      template="templates/edit-dashboard.pt"
      permission="ploneintranet.viewsite"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />


  <browser:page
      name="delete_confirmation"
      for="*"
      class=".actions.PIDeleteConfirmationForm"
      permission="zope2.DeleteObjects"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="delete-link"
      for="*"
      class=".actions.PIDeleteLink"
      template="templates/delete_link.pt"
      permission="zope2.DeleteObjects"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="plone_lock_info"
      for="plone.locking.interfaces.ITTWLockable"
      class=".locking.PILockingInformation"
      allowed_attributes="is_locked is_locked_for_current_user lock_is_stealable lock_info render_panel"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="plone_lock_operations"
      for="plone.locking.interfaces.ITTWLockable"
      class=".locking.PILockingOperations"
      allowed_attributes="create_lock safe_unlock force_unlock refresh_lock"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="workflow_menu"
      for="*"
      class=".workflow.WorkflowMenu"
      template="templates/workflow_menu.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="saving_badge"
      for="*"
      class=".saving_badge.View"
      template="templates/saving_badge.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <!-- zope.Public is there on purpose to remove the lock when workflow changes
       do not allow the user to edit view the content anymore -->
  <browser:page
      name="toggle-lock"
      for="*"
      class=".toggle_lock.ToggleLockView"
      template="templates/toggle-lock.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

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

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

  <browser:page
      name="app-preferences"
      for="ploneintranet.layout.app.IApp"
      class=".personal_settings.PersonalSettings"
      template="templates/personal-settings.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <!-- override change password form -->
  <browser:page
      name="change-password"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".passwordpanel.PloneIntranetPasswordPanel"
      template="templates/change-password.pt"
      permission="cmf.SetOwnPassword"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <!--
      A variant on cmf.SetOwnPassword. zope2.View safe enough.
  -->
  <browser:page
      name="verify_password_reset_allowed"
      for="*"
      class=".utils.VerifyPasswordResetAllowed"
      permission="zope2.View"
      />

  <!-- Yes, zope.Public, everybody can call this to set cache headers -->
  <browser:view
      name="http-cache-headers"
      for="*"
      class=".httpheaders.HTTPHeaders"
      permission="zope.Public"
      />

  <browser:page
      name="in_workspace"
      for="*"
      class=".utils.InWorkspace"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="activitystream.dashboard.tile"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".dashboard.ActivityStreamTile"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />
  <!-- wrapped.activitystream.tile predates activitystream.tile.
           Code was consolidated, registration kept because it may be referenced in users' custom dashboards -->
  <browser:page
      name="wrapped.activitystream.tile"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".dashboard.ActivityStreamTile"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

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

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

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

  <plone:tile
      name="grouped_search.tile"
      title="Grouped Search"
      description="Tile to list recently modified documents"
      for="*"
      class=".grouped_search.GroupedSearchTile"
      template="templates/grouped_search.pt"
      permission="zope2.View"
      add_permission="cmf.ManagePortal"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="sidebar-toggle-button"
      for="*"
      template="templates/sidebar-toggle-button.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="panel_template"
      for="*"
      template="templates/panel_template.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel_template_tabbed"
      for="*"
      template="templates/panel_template_tabbed.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel_attachment_picker"
      for="*"
      class=".attachments.AttachmentsSearch"
      template="templates/panel_attachment_picker.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel_remove_attachment"
      for="*"
      class=".attachments.RemoveAttachmentPanel"
      template="templates/panel_remove_attachment.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel_attachment_picker_search_results"
      for="*"
      class=".attachments.AttachmentsSearch"
      template="templates/panel_attachment_picker_search_results.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="on-screen-help"
      for="*"
      class=".on_screen_help.View"
      template="templates/on-screen-help.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="pi-refresh-compilations"
      for="*"
      class=".actions.RefreshCompilationsView"
      permission="cmf.ManagePortal"
      />

  <browser:page
      name="pi-mail-password"
      for="*"
      class=".actions.MailPassword"
      permission="zope.Public"
      />

  <browser:page
      name="mail_password_template"
      for="*"
      class=".actions.MailPasswordTemplate"
      template="templates/mail_password_template.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="mail_password_not_found"
      for="*"
      class=".actions.MailPasswordNotFound"
      template="templates/mail_password_not_found.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="mail_password_external"
      for="*"
      class=".actions.MailPasswordExternal"
      template="templates/mail_password_external.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

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

  <browser:page
      name="password-helper"
      for="*"
      class=".actions.PasswordHelper"
      permission="zope.Public"
      />

  <browser:page
      name="previews"
      for="*"
      class=".previews.PreviewsView"
      template="templates/previews.pt"
      permission="zope2.View"
      />

  <browser:page
      name="previews-page-compound-rendered"
      for="*"
      class=".previews.PreviewsView"
      template="templates/previews-page-compound-rendered.pt"
      permission="zope2.View"
      />

  <browser:page
      name="previews"
      for="plone.app.contenttypes.interfaces.IImage"
      class=".previews.PreviewsView"
      template="templates/previews-images.pt"
      permission="zope2.View"
      />

  <browser:page
      name="previews"
      for="plone.app.contenttypes.interfaces.ILink"
      class=".previews.LinkPreviewsView"
      template="templates/previews-links.pt"
      permission="zope2.View"
      />

  <browser:page
      name="about.html"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".about.About"
      template="templates/about.pt"
      permission="cmf.ManagePortal"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="about.json"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".about.AboutJSON"
      permission="cmf.ManagePortal"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="versions_history_form"
      for="*"
      class=".history.VersionsHistoryView"
      template="templates/versions_history_form.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="login"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class="ploneintranet.layout.browser.login.LoginForm"
      template="templates/login.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="login_form"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class="ploneintranet.layout.browser.login.LoginForm"
      template="templates/login.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

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

  <browser:page
      name="plone_redirector_view"
      for="*"
      class=".redirector.PIFourOhFourView"
      allowed_interface="plone.app.redirector.interfaces.IFourOhFourView"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="rabbit-auth"
      for="*"
      class=".auth.View"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />


  <!-- texteditor -->
  <browser:page
      name="texteditor"
      for="*"
      class=".texteditor.TextEditor"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-toolbar"
      for="*"
      class=".texteditor.TextEditorToolbar"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-mini"
      for="*"
      class=".texteditor.TextEditorMini"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-toolbar-mini"
      for="*"
      class=".texteditor.TextEditorToolbarMini"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-tiptap"
      for="*"
      class=".texteditor.TextEditorTiptap"
      template="templates/texteditor_tiptap.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-toolbar-tiptap"
      for="*"
      class=".texteditor.TextEditorTiptap"
      template="templates/texteditor_toolbar_tiptap.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-mini-tiptap"
      for="*"
      class=".texteditor.TextEditorMiniTiptap"
      template="templates/texteditor_tiptap.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-toolbar-mini-tiptap"
      for="*"
      class=".texteditor.TextEditorMiniTiptap"
      template="templates/texteditor_toolbar_tiptap.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-redactor"
      for="*"
      class=".texteditor.TextEditorRedactor"
      template="templates/texteditor_redactor.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-toolbar-redactor"
      for="*"
      class=".texteditor.BaseTextEditor"
      template="templates/texteditor_toolbar_redactor.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-mini-redactor"
      for="*"
      class=".texteditor.TextEditorMiniRedactor"
      template="templates/texteditor_redactor.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="texteditor-toolbar-mini-redactor"
      for="*"
      class=".texteditor.BaseTextEditor"
      template="templates/texteditor_toolbar_redactor.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:pages
      for="Products.CMFCore.interfaces.IFolderish"
      class=".texteditor.ImagePanel"
      permission="cmf.AddPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      >
    <browser:page
        name="panel-upload-image"
        template="templates/texteditor_panel_image_upload.pt"
        />
    <browser:page
        name="panel-image-search-result"
        template="templates/texteditor_panel_image_search_result.pt"
        />
    <browser:page
        name="panel-select-image-workspace"
        template="templates/texteditor_panel_image_selection.pt"
        />
  </browser:pages>

  <browser:page
      name="images.json"
      for="Products.CMFCore.interfaces.IFolderish"
      class=".utils.ImagePickerJson"
      permission="cmf.AddPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="images-upload.json"
      for="Products.CMFCore.interfaces.IFolderish"
      class=".utils.ImageUploadJson"
      permission="cmf.AddPortalContent"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />


  <!-- error pages -->
  <browser:page
      name="index.html"
      for="Exception"
      class="Products.CMFPlone.browser.exceptions.ExceptionView"
      template="templates/error_message.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="insufficient-privileges"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".error_handling.InsufficientPrivilegesView"
      template="templates/error_message_403.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="unauthorized"
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      class=".error_handling.UnauthorizedView"
      template="templates/error_message_401.pt"
      permission="zope.Public"
      layer="ploneintranet.layout.interfaces.IPloneintranetLayoutLayer"
      />

  <browser:page
      name="download_files"
      for="Products.CMFCore.interfaces.IFolderish"
      class=".folders.DownloadFiles"
      permission="cmf.ModifyPortalContent"
      />

</configure>
