<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:security="http://schooltool.org/securitypolicy"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:zcml="http://namespaces.zope.org/zcml"
    i18n_domain="schooltool">

  <!-- Register the skin for devmode -->
  <interface
      interface=".skin.ISchoolToolDevModeSkin"
      type="zope.publisher.interfaces.browser.IBrowserSkinType"
      name="SchoolToolDevMode"
      />

  <!-- Generic DevMode setup -->

  <interface
      interface="schooltool.devmode.skin.ISchoolToolDevModeSkin"
      type="zope.publisher.interfaces.browser.IBrowserSkinType"
      name="SchoolToolDevMode"
      />

  <configure package="schooltool.skin">

    <configure zcml:condition="have apidoc">

    <browser:navigationViewlet
      name="inspect"
      for="*"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.edit"
      link="@@introspector.html"
      title="Introspect"
      order="200"
      />

    <browser:navigationViewlet
      name="api-docs"
      for="*"
      manager="schooltool.app.browser.interfaces.IManageMenuViewletManager"
      template="templates/navigationViewlet.pt"
      class="schooltool.skin.skin.NavigationViewlet"
      permission="schooltool.view"
      link="++apidoc++/@@index.html"
      title="API Docs"
      order="220"
      />

    </configure>

    <browser:navigationViewlet
      name="sample-data"
      for="*"
      manager="schooltool.app.browser.interfaces.IManageMenuViewletManager"
      template="templates/navigationViewlet.pt"
      class="schooltool.skin.skin.NavigationViewlet"
      permission="schooltool.view"
      link="@@sampledata.html"
      title="Sample data"
      order="230"
      />

  </configure>

  <browser:viewlet
      name="devmode_css"
      for="*"
      manager="schooltool.skin.ICSSManager"
      class=".devmode.DevmodeCSSViewlet"
      permission="zope.View"
      layer="schooltool.devmode.skin.IDevModeLayer"
      />

  <!-- DevTools Menu configuration -->

  <browser:resource
      name="devmode.css" file="devmode.css"
      layer=".skin.IDevModeLayer"
      />

  <configure zcml:condition="have apidoc">

  <!-- Setup schooltool as a top-level package in API doc -->
  <apidoc:rootModule 
    xmlns:apidoc="http://namespaces.zope.org/apidoc"
    module="schooltool" />

  <!-- Introspector -->
  <browser:viewlet
      name="introspector_css"
      for="*"
      manager="schooltool.skin.ICSSManager"
      class=".devmode.IntrospectorCSSViewlet"
      permission="zope.View"
      layer="schooltool.devmode.skin.IDevModeLayer"
      />

  <browser:resource
      name="introspector.css" file="introspector.css"
      layer=".skin.IDevModeLayer"
      />

  <!-- apidoc customization -->
  <browser:resource
      name="apidoc.css" file="apidoc.css"
      layer=".skin.IDevModeLayer"
      />

  <security:allow
      crowds="administration"
      permission="zope.app.apidoc.UseAPIDoc" />

  </configure>

</configure>
