<?xml version="1.0"?>
<configure xmlns="http://namespaces.zope.org/browser"
           xmlns:z3c="http://namespaces.zope.org/z3c"
           xmlns:zope="http://namespaces.zope.org/zope"
           xmlns:flourish="http://schooltool.org/flourish"
           i18n_domain="schooltool">

  <!-- XXX: what's the right place for this? -->
  <zope:adapter factory=".form.FlourishRadioBoolTerms" />

  <zope:adapter factory=".widgets.PromptRequiredDemoField"
                name="prompt" />

  <zope:view
      type="schooltool.skin.flourish.IFlourishLayer"
      for="zope.html.field.IHtmlFragmentField"
      provides="zope.app.form.interfaces.IInputWidget"
      factory=".widgets.FlourishFckeditorFormlibWidget"
      permission="zope.Public"
      />

  <zope:view
      type="schooltool.skin.flourish.IFlourishLayer"
      for="zope.html.field.IXhtmlFragmentField"
      provides="zope.app.form.interfaces.IInputWidget"
      factory="schooltool.skin.widgets.FckeditorFormlibWidget"
      permission="zope.Public"
      />

  <zope:adapter
      factory=".form.FlourishErrorViewSnippet"
      trusted="True"
      permission="zope.Public"
      />

  <zope:adapter
      for="zope.schema.interfaces.IDate
           schooltool.skin.flourish.IFlourishLayer"
      provides="zope.formlib.interfaces.ISimpleInputWidget"
      factory=".widgets.FormlibDateWidget"
      permission="zope.Public"
      />

  <zope:adapter
      factory="schooltool.skin.widgets.CustomDateFieldTextWidget"
      provides="z3c.form.interfaces.IFieldWidget"
      for="zope.schema.interfaces.IDate
           schooltool.skin.flourish.IFlourishLayer"
      />

  <zope:adapter
      factory=".widgets.FlourishFckeditorFieldWidget"
      for="zope.html.field.IHtmlFragmentField
           schooltool.skin.flourish.IFlourishLayer"
      />

  <zope:adapter
      factory="schooltool.skin.flourish.widgets.Flourish_fckeditor_config"
      name="config"
      />

  <zope:class class=".widgets.FlourishFckeditorZ3CFormWidget">
    <require
        permission="zope.Public"
        interface="schooltool.skin.widgets.IFckeditorWidget"
        />
  </zope:class>

  <zope:adapter
      factory=".widgets.PhotoFieldWidget"
      provides="z3c.form.interfaces.IFieldWidget"
      for=".widgets.IPhoto
           schooltool.skin.flourish.IFlourishLayer"
      />

  <zope:adapter factory=".widgets.PhotoDataConverter" />

  <zope:class class=".widgets.PhotoWidget">
    <require
        permission="zope.Public"
        interface="z3c.form.interfaces.IFileWidget"
        />
  </zope:class>

  <z3c:widgetTemplate
      mode="input"
      widget=".widgets.IPhotoWidget"
      view="schooltool.basicperson.browser.person.FlourishPersonEditView"
      layer="schooltool.skin.flourish.IFlourishLayer"
      template="templates/photo_input.pt"
      />

</configure>
