<div id="tree" class="mmbase-tool">
<mm:content
    type="text/xml"
    expires="-1"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:jsp="http://java.sun.com/JSP/Page" 
    xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"
    >
  <jsp:directive.page session="true" errorPage="../error.jspx" />
<mm:cloud rank="basic user">
<!-- 
     This tool is to show a kind of table of contents in which this node is.
     Can be used to navigate.

     Parts of this tree can be added with xmlhttprequest. So this jspx is kind of 'manually recursive'.
 
  Shows:
  <div class="tree" id="node_[]">
     [folder] <a id="a_[]">link to node</a>
     <ul>
       <li> 
         <div class="tree" id="node_[1]">
           [folder] <a id="a_[1]">index First subchapter</a>
         </div>
       </li>
       <li> 
         <div class="tree" id="node_[2]" class="off">
           [folder] <a id="a_[2]">index Second subchapter</a>
         </div>
       </li>
        .....
     </ul>
  </div>                                                            -->        
  <jsp:output omit-xml-declaration="true" />
  <mm:param name="org.mmbase.xml-mode" value="kupu" />
  <mm:import id="node" externid="objectnumber">pol_default</mm:import>
  <mm:import externid="root">${node}</mm:import>
  <mm:node referid="root" id="root" notfound="skip">
    <mm:param name="org.mmbase.index-root" referid="root" />
  </mm:node>
  <mm:node id="n" referid="node">
    <div class="tree" id="node_${n}">
      <mm:listrelationscontainer type="segments" role="index" searchdir="destination">
        <mm:sortorder field="pos" />       
        <a href="javascript: unloadRelated(${n});">
          <img class="icon" src="icons/map-open.gif" />
        </a>
        <a href="javascript: loadNode(${n});" id="a_${n}"> ${n.title}</a>
        <ul>          
        <mm:listrelations id="rel">
          <li> 
            <mm:relatednode id="segment">
              <div id="node_${segment}" class="tree">
                <mm:listrelationscontainer type="segments" role="index" searchdir="destination">                     
                  <mm:sortorder field="pos" />
                  <a  href="javascript: loadRelated(${segment});">                    
                    <img class="icon" src="icons/map.gif" />
                  </a>
                  <mm:hasfunction name="index">
                    <mm:function name="index" id="index" write="false" />
                  </mm:hasfunction>
                  <a href="javascript: loadNode(${segment});" id="a_${segment}" title="${index}"> ${segment.title}</a>
                </mm:listrelationscontainer>
              </div>
            </mm:relatednode>
          </li>
        </mm:listrelations>
        </ul>
      </mm:listrelationscontainer>
      <a class="create" title="New" href="javascript: createSubNode(${node});">
        <mm:link page="/mmbase/style/images/create.gif">
          <img src="${_}" alt="+" title="Creëer subhoofstuk" />
        </mm:link>
      </a>
    </div>
  </mm:node>
</mm:cloud>
</mm:content>
</div>