<?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"
           i18n_domain="schooltool">

  <include file="z3cform.zcml" />

  <!-- Viewlet Managers -->

  <zope:interface
      interface=".skin.IActionMenuContext"
      type="zope.contentprovider.interfaces.ITALNamespaceData" />

  <viewletManager
      name="schooltool.Actions"
      permission="zope.Public"
      class=".skin.ActionMenuViewletManager"
      template="templates/actions.pt"
      />

  <viewletManager
      name="schooltool.CSS"
      permission="zope.Public"
      provides=".skin.ICSSManager"
      />

  <viewletManager
      name="schooltool.JavaScript"
      permission="zope.Public"
      provides=".skin.IJavaScriptManager"
      />

  <viewletManager
      name="schooltool.Header"
      permission="zope.Public"
      provides=".skin.IHeaderManager"
      />

  <viewletManager
      name="schooltool.MenuBar"
      permission="zope.Public"
      provides=".skin.IMenuBarMenuManager"
      class=".skin.MenuBarMenuViewletManager"
      template="templates/menubar.pt"
      />

  <viewletManager
      name="schooltool.NavigationMenu"
      permission="zope.Public"
      provides=".skin.INavigationManager"
      template="templates/navigation.pt"
      class=".skin.OrderedViewletManager"
      />

  <viewletManager
      name="schooltool.ActionsMenu"
      permission="zope.Public"
      class=".skin.ActionMenuViewletManager"
      template="templates/actionsbar.pt"
      />


  <!-- Skin and resources -->

  <zope:interface
      interface=".skin.ISchoolToolSkin"
      type="zope.publisher.interfaces.browser.IBrowserSkinType"
      name="SchoolTool"
      />

  <page
      name="standard_macros"
      for="*"
      class=".macros.StandardMacros"
      allowed_interface="zope.interface.common.mapping.IItemMapping"
      permission="zope.Public"
      layer="schooltool.skin.ISchoolToolLayer"
      />

  <page
      name="schooltool_macros"
      for="*"
      class=".macros.SchoolToolMacros"
      allowed_interface="zope.interface.common.mapping.IItemMapping"
      permission="zope.Public"
      />

  <page
      name="view_macros"
      for="*"
      permission="zope.View"
      template="templates/view_macros.pt"
      layer="schooltool.skin.ISchoolToolLayer"
      />

  <page
      name="rml_macros"
      for="*"
      permission="zope.View"
      template="templates/rml_macros.pt"
      layer="schooltool.skin.ISchoolToolLayer"
      />

  <page
      name="generic_macros"
      for="*"
      permission="zope.View"
      template="templates/generic_macros.pt"
      />

   <page
      name="onlinehelp_macros"
      for="*"
      permission="zope.View"
      template="templates/onlinehelp_macros.pt"
      layer="schooltool.skin.ISchoolToolLayer"
      />

  <page
      name="widget_macros"
      for="*"
      permission="zope.View"
      template="templates/widget_macros.pt"
      layer="schooltool.skin.ISchoolToolLayer"
      />

  <page
      name="formlib_macros"
      for="*"
      permission="zope.View"
      template="templates/formlib_macros.pt"
      layer="schooltool.skin.ISchoolToolLayer"
      />

  <icon
      name="zmi_icon"
      for="schooltool.app.interfaces.ISchoolToolApplication"
      file="resources/icon.png"
      />

  <resource
      name="logo.png"
      file="resources/schooltool.png"
      layer="schooltool.skin.ISchoolToolLayer" />

  <resource
      name="schooltool-report-logo.png"
      file="resources/schooltool-report-logo.png"
      layer="schooltool.skin.ISchoolToolLayer" />

  <resource
      name="schooltool.css"
      file="resources/schooltool.css"
      layer="schooltool.skin.ISchoolToolLayer" />

  <resource
      name="editor_config.js"
      file="resources/editor_config.js"
      layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="zonki-regular.png" file="resources/zonki-regular.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="zonki-reading.png" file="resources/zonki-reading.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="zonki-question.png" file="resources/zonki-question.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="zonki-pointing.png" file="resources/zonki-pointing.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="zonki-angry.png" file="resources/zonki-angry.png"
	    layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="bugs.gif" file="resources/bugs.gif"
	    layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="downarrow.png" file="resources/downarrow.png"
            layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="rightarrow.png" file="resources/rightarrow.png"
            layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="layout.css" file="resources/layout.css"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="print.css" file="resources/print.css"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="schooltool.js" file="resources/schooltool.js"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="jquery.js" file="resources/jquery.js"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="favicon.ico" file="resources/favicon.ico"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="toolbar-background.png"
	    file="resources/toolbar-background.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="toolbar-background-hover.png"
	    file="resources/toolbar-background-hover.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="sidebar-background.png"
	    file="resources/sidebar-background.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="sidebar-background-top.png"
	    file="resources/sidebar-background-top.png"
	    layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="previous.png" file="resources/previous.png"
	    layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="next.png" file="resources/next.png"
	    layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="printer.png" file="resources/printer.png"
	    layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="delete.png" file="resources/delete.png"
            layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="note-head-l.gif" file="resources/note-head-l.gif"
            layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="note-head-r.gif" file="resources/note-head-r.gif"
            layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="note-body-r.gif" file="resources/note-body-r.gif"
            layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="note-body-l.gif" file="resources/note-body-l.gif"
            layer="schooltool.skin.ISchoolToolLayer" />

  <resource name="private-note-head-l.gif"
            file="resources/private-note-head-l.gif"
            layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="private-note-head-r.gif"
            file="resources/private-note-head-r.gif"
            layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="private-note-body-r.gif"
            file="resources/private-note-body-r.gif"
            layer="schooltool.skin.ISchoolToolLayer" />
  <resource name="private-note-body-l.gif"
            file="resources/private-note-body-l.gif"
            layer="schooltool.skin.ISchoolToolLayer" />

  <!-- Breadcrumbs -->

  <page
      for="*"
      name="breadcrumbs"
      class=".breadcrumbs.Breadcrumbs"
      permission="zope.Public"
      allowed_interface=".interfaces.IBreadcrumbs"
      />

  <zope:adapter
      factory=".breadcrumbs.GenericBreadcrumbInfo"
      trusted="true"
      permission="zope.Public"
      />

  <!-- Error messages -->

  <page
      for="zope.interface.common.interfaces.IException"
      name="index.html"
      layer="schooltool.skin.ISchoolToolLayer"
      class=".error.ErrorView"
      template="templates/error.pt"
      permission="zope.Public"
      />

  <page
      for="zope.publisher.interfaces.INotFound"
      name="index.html"
      layer="schooltool.skin.ISchoolToolLayer"
      class="zope.app.exception.browser.notfound.NotFound"
      template="templates/notfound.pt"
      permission="zope.Public"
      />

  <page
      for="zope.security.interfaces.IUnauthorized"
      name="index.html"
      layer="schooltool.skin.ISchoolToolLayer"
      class="zope.app.exception.browser.unauthorized.Unauthorized"
      template="templates/unauthorized.pt"
      permission="zope.Public"
      />

  <zope:adapter
      for=".skin.NavigationViewlet"
      name="schooltool.view"
      factory=".skin.NavigationViewletViewCrowd" />

  <zope:adapter
      for=".skin.NavigationViewlet"
      name="schooltool.edit"
      factory=".skin.NavigationViewletEditCrowd" />

  <zope:view
      for="datetime.date"
      type="zope.publisher.interfaces.browser.IBrowserRequest"
      name="fullDate"
      factory=".dateformatter.DateFormatterFullView"
      permission="zope.Public"
      />

  <zope:view
      for="datetime.date"
      type="zope.publisher.interfaces.browser.IBrowserRequest"
      name="mediumDate"
      factory=".dateformatter.DateFormatterMediumView"
      permission="zope.Public"
      />

  <zope:view
      for="datetime.date"
      type="zope.publisher.interfaces.browser.IBrowserRequest"
      name="shortDate"
      factory=".dateformatter.DateFormatterShortView"
      permission="zope.Public"
      />

  <viewlet
      name="language_selector"
      for="*"
      manager="schooltool.skin.IHeaderManager"
      template="templates/language_selector.pt"
      permission="schooltool.view"
      class="schooltool.skin.skin.LanguageSelectorViewlet"
      />

  <z3c:widgetTemplate
      mode="input"
      widget=".widgets.IDateTextWidget"
      layer="schooltool.skin.skin.ISchoolToolLayer"
      template="date-input.pt"
      />

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

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

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

  <zope:class class=".widgets.FckeditorZ3CFormWidget">
    <require
        permission="zope.Public"
        interface=".widgets.IFckeditorWidget"
        />
  </zope:class>

  <zope:class class=".widgets.FCKConfig">
    <require
        permission="zope.Public"
        interface=".widgets.IFCKConfig"
        />
  </zope:class>

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

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

  <zope:adapter
      factory=".widgets.FckeditorFieldWidget"
      for="zope.html.field.IHtmlFragmentField
           z3c.form.interfaces.IFormLayer"
      />

  <z3c:widgetTemplate
      mode="display"
      widget=".widgets.IFckeditorWidget"
      layer="z3c.form.interfaces.IFormLayer"
      template="templates/fckwidget_display.pt"
      />

  <z3c:widgetTemplate
      mode="input"
      widget=".widgets.IFckeditorWidget"
      layer="z3c.form.interfaces.IFormLayer"
      template="templates/fckwidget_input.pt"
      />

  <zope:adapter
      factory=".widgets.Fckeditor_config"
      name="config"
      />

  <zope:adapter
      factory=".widgets.Fckeditor_addform_config"
      name="config"
      />

  <zope:adapter
      factory=".widgets.Fckeditor_editform_config"
      name="config"
      />


</configure>
