<mm:content type="text/xml"
	    expires="-1"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
      xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"
      >
  <jsp:directive.page session="true" errorPage="error.jspx" />
  <jsp:output omit-xml-declaration="true" />
  <mm:import externid="rich_language" from="session">client</mm:import>
  <mm:locale language="$rich_language">
    <mm:cloud rank="basic user" >
      <fmt:bundle basename="org.mmbase.kupu.Messages">
        <mm:import id="node" externid="objectnumber" />
        <mm:import externid="loadonly" />
        <mm:notpresent  referid="node">
          <div class="node" title="No Node">
            <p><fmt:message key="No node" /></p>
          </div>
        </mm:notpresent>
        <mm:present referid="node">

          <mm:param name="org.mmbase.xml-mode" value="kupu" />
          <mm:node id="node" referid="node">
            <mm:import id="gui" escape="tagstripper(NONE)"><mm:nodeinfo type="gui" /></mm:import>
            <mm:nodeinfo type="nodemanager" id="nodetype" write="false" />
            <div class="node mm_nm_${nodetype}"
                 title="${node.number} ${gui}">
              <mm:notpresent referid="loadonly">
                <table>
                  <tr>
                    <th><jsp:text>#<mm:field name="number" /> (<mm:nodeinfo type="guitype" />)</jsp:text></th>
                    <mm:hasfunction name="index">
                      <th><mm:function name="index" /></th>
                    </mm:hasfunction>
                  </tr>
                </table>
                <form>
                  <mm:fieldlist id="field" type="edit" varStatus="status">
                    <mm:fieldinfo type="name">
                      <mm:compare value="body" inverse="true">
                        <p class="mm_f_${status.current.name} ${status.current.readOnly ? 'readonly' : ''} mm_state_${status.current.state} ${status.current.virtual ? 'virtual' : ''} ${status.current.required ? 'required' : ''}">
                          <span class="name"><mm:fieldinfo type="guiname" /></span>
                          <jsp:text> </jsp:text>
                          <span class="value">
                            <mm:fieldinfo type="name">
                              <mm:compare value="title">
                                <!-- noempty, because HTML sucks -->
                                <mm:fieldinfo  options="noempty,extra:onKeyUp='updateTree(${node.number}, this.value); kupu.content_changed=true;'" type="input" />
                              </mm:compare>
                              <mm:compare value="title" inverse="true">
                                <mm:fieldinfo  options="noempty,extra:onChange='kupu.content_changed=true;'" type="input" />
                              </mm:compare>
                            </mm:fieldinfo>
                          </span>
                        </p>
                      </mm:compare>
                    </mm:fieldinfo>
                  </mm:fieldlist>
                </form>
              </mm:notpresent>
            </div>
          </mm:node>
          <mm:write session="kupu_node" referid="node" />
        </mm:present>
      </fmt:bundle>
    </mm:cloud>
  </mm:locale>
</mm:content>
