Update of /var/cvs/contributions/didactor2/src/core/metainf/tags/di/core
In directory james.mmbase.org:/tmp/cvs-serv23049

Modified Files:
        html.tagx leaf.tagx 
Log Message:



See also: 
http://cvs.mmbase.org/viewcvs/contributions/didactor2/src/core/metainf/tags/di/core


Index: html.tagx
===================================================================
RCS file: 
/var/cvs/contributions/didactor2/src/core/metainf/tags/di/core/html.tagx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- html.tagx   15 Feb 2008 14:18:28 -0000      1.11
+++ html.tagx   29 Feb 2008 09:26:25 -0000      1.12
@@ -26,7 +26,7 @@
               doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
               
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
   <mm:content postprocessor="${empty postprocessor ? 'reducespace' : 
postprocessor}"
-              type="${type}"
+              type="${empty type ? 'application/xhtml+xml' : type}"
               unacceptable="CRIPPLE"
               language="${requestScope.language}" expires="${expires}">
     <mm:cloud rank="${empty rank ? 'didactor user' : rank}">


Index: leaf.tagx
===================================================================
RCS file: 
/var/cvs/contributions/didactor2/src/core/metainf/tags/di/core/leaf.tagx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- leaf.tagx   15 Feb 2008 14:18:28 -0000      1.2
+++ leaf.tagx   29 Feb 2008 09:26:25 -0000      1.3
@@ -2,50 +2,85 @@
     xmlns:c="http://java.sun.com/jsp/jstl/core";
     xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0";
     xmlns:jsp="http://java.sun.com/JSP/Page";
+    xmlns:fn="http://java.sun.com/jsp/jstl/functions";
     xmlns:di="http://www.didactor.nl/ditaglib_1.0";
     version="2.0">
   <jsp:directive.tag
-      description="In the edit-environment horrible trees are constructed with 
tables in tables and spacers and what not. This helps at least keeping the jsp 
more or less tidy."
+      description="
+                   In the edit-environment horrible trees are constructed with 
tables in tables and spacers and what not.
+                   This helps at least keeping the jsp more or less tidy."
       />
-  <jsp:directive.attribute name="last"   type="java.lang.Integer"   />
   <jsp:directive.attribute name="icon"   type="java.lang.String"   />
   <jsp:directive.attribute name="click"  type="java.lang.String"   />
   <jsp:directive.attribute name="open"   type="java.lang.Boolean"   />
-  <jsp:directive.attribute name="depth"  type="java.lang.Integer"    />
+  <jsp:directive.attribute name="branch" type="java.util.List"    />
+  <jsp:directive.attribute name="branchOffset" type="java.lang.Integer"    />
+  <jsp:directive.attribute name="branchPath" type="java.lang.String"    />
   <jsp:directive.attribute name="styleClass" />
 
-  <mm:import id="d" vartype="integer">
-    <c:choose>
-      <c:when test="${empty depth}">
-        <mm:depth>${_ - 1}</mm:depth>
-      </c:when>
-      <c:otherwise>${depth}</c:otherwise>
-    </c:choose>
-  </mm:import>
-
-  <mm:import id="l">${empty last ? 0 : last}</mm:import>
-
+  <mm:import id="offset" vartype="integer">${empty branchOffset ? 0 : 
branchOffset}</mm:import>
+  <mm:import id="d" vartype="integer">${fn:length(branchPath) + 
fn:length(branch) - offset}</mm:import>
 
   <table border="0" cellpadding="0" cellspacing="0" class="${styleClass}">
+
     <tr>
-      <mm:link  page="/education/wizards/gfx/tree_spacer.gif">
-        <td><img src="${_}" width="${16 * (1 + l)}" height="16" border="0" 
align="center" /></td>
+      <c:if test="${d ge 1}">
+        <mm:import id="bpi" vartype="integer">${fn:length(branchPath) - (empty 
branch ? 1 : (fn:length(branch) - offset lt 1 ? 1 : 0))}</mm:import>
+        <c:if test="${bpi gt 0}">
+          <c:forEach begin="0" end="${bpi - 1}"  var="i">
+            <c:choose>
+              <c:when test="${fn:substring(branchPath, i, i + 1) eq '.'}">
+                <mm:link page="/education/wizards/gfx/tree_spacer.gif" 
write="false">
+                  <td><img src="${_}" border="0" align="center" 
valign="middle"/></td>
       </mm:link>
+              </c:when>
+              <c:otherwise>
       <mm:link page="/education/wizards/gfx/tree_vertline.gif" write="false">
-        <c:forEach begin="${l + 1}" end="${d}">
             <td><img src="${_}" border="0" align="center" 
valign="middle"/></td>
+                </mm:link>
+              </c:otherwise>
+            </c:choose>
         </c:forEach>
+        </c:if>
+        <mm:import id="bi" vartype="integer">${fn:length(branch) - 
1}</mm:import>
+        <c:if test="${(bi ge 1) and (bi - 1 ge offset)}">
+          <c:forEach begin="${offset}" end="${bi - 1}" var="i">
+            <c:choose>
+              <c:when test="${branch[i].last}">
+                <mm:link page="/education/wizards/gfx/tree_spacer.gif" 
write="false">
+                  <td><img src="${_}" border="0" align="center" 
valign="middle"/></td>
+                </mm:link>
+              </c:when>
+              <c:otherwise>
+                <mm:link page="/education/wizards/gfx/tree_vertline.gif" 
write="false">
+                  <td><img src="${_}" border="0" align="center" 
valign="middle"/></td>
       </mm:link>
+              </c:otherwise>
+            </c:choose>
+          </c:forEach>
+        </c:if>
+      </c:if>
+      <mm:import id="l" vartype="boolean">${(empty branch or fn:length(branch) 
- offset eq 0) ? fn:substring(branchPath, d - 1, d) eq '.' : 
branch[fn:length(branch) - 1].last}</mm:import>
+
       <c:choose>
         <c:when test="${empty click}">
+          <c:choose>
+            <c:when test="${l}">
+              <mm:link page="/education/wizards/gfx/tree_leaflast.gif">
+                <td><img src="${_}" border="0" align="center" 
valign="middle"/></td>
+              </mm:link>
+            </c:when>
+            <c:otherwise>
           <mm:link page="/education/wizards/gfx/tree_vertline-leaf.gif">
             <td><img src="${_}" border="0" align="center" 
valign="middle"/></td>
           </mm:link>
+            </c:otherwise>
+          </c:choose>
         </c:when>
         <c:otherwise>
           <td>
             <a href="javascript:clickNode('${click}')">
-              <img src="gfx/tree_${empty open or ! open ? 'plus' : 
'min'}${last ? 'last' : ''}.gif" border="0"
+              <img src="gfx/tree_${empty open or ! open ? 'plus' : 'min'}${l ? 
'last' : ''}.gif" border="0"
                    align="center" valign="middle" id="img_${click}"/>
             </a>
           </td>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to