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

  <!-- don't load unless there's something there / else release breaks -->
  <!-- i18n:registerTranslations directory="locales" / -->
  <five:registerPackage package="." initialize=".initialize" />
  <include package="Products.CMFCore" file="permissions.zcml" />

  <includeDependencies package="." />

  <utility factory=".token_utility.TokenUtility" />

  <genericsetup:registerProfile
     name="default"
     title="Plone Intranet: -- [Invitations]"
     directory="profiles/default"
     description="Invite users to a plone site using a unique URL"
     provides="Products.GenericSetup.interfaces.EXTENSION"
     />

  <genericsetup:registerProfile
     name="uninstall"
     title="Plone Intranet: -- [Invitations uninstall]"
     directory="profiles/uninstall"
     description="Uninstall the ploneintranet.invitations package"
     provides="Products.GenericSetup.interfaces.EXTENSION"
     />

  <browser:page
     for="Products.CMFCore.interfaces.ISiteRoot"
     name="accept-token"
     class=".views.AcceptToken"
     permission="zope2.View"
     layer=".interfaces.IPloneintranetInvitationsLayer"
     />

  <browser:page
     for="Products.CMFCore.interfaces.ISiteRoot"
     name="ploneintranet-invitations-invite-user"
     class=".invitations.InviteUser"
     template="invite_user.pt"
     permission="cmf.ManagePortal"
     layer=".interfaces.IPloneintranetInvitationsLayer"
     />

  <subscriber
     for="ploneintranet.invitations.events.ITokenAccepted"
     handler=".invitations.accept_invitation" />

</configure>
