Update of /var/cvs/contributions/natmm/templates/nmintra/includes
In directory james.mmbase.org:/tmp/cvs-serv25266/templates/nmintra/includes

Modified Files:
        relatedimage.jsp relatedparagraph.jsp 
Removed Files:
        imagesposition.jsp relatedimage_no_description.jsp 
Log Message:
NMCMS-617 - Showing images doesn't work for IE. Also added popup code.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/natmm/templates/nmintra/includes
See also: http://www.mmbase.org/jira/browse/NMCMS-617


Index: relatedimage.jsp
===================================================================
RCS file: 
/var/cvs/contributions/natmm/templates/nmintra/includes/relatedimage.jsp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- relatedimage.jsp    3 Nov 2008 17:10:02 -0000       1.8
+++ relatedimage.jsp    22 Dec 2008 15:24:12 -0000      1.9
@@ -1,4 +1,6 @@
-<% 
+<%...@page isELIgnored="false"
+%><%...@page import="org.mmbase.util.images.*"
+%><%
 // ************* inner table to prevent clustering of images  
**********************
 // see the types/images_position at the editwizards
 // <option id="1">rechts</option>
@@ -10,24 +12,63 @@
 // <option id="7">rechts groot</option>
 // <option id="8">links groot</option>
 
-%><mm:related path="posrel,images" orderby="images.title" 
constraints="posrel.pos!='9'" searchdir="destination">
+%>
+<c:set var="right" value="false"/>
+<mm:related path="posrel,images" orderby="images.title" 
constraints="posrel.pos!='9'" searchdir="destination">
    <mm:field name="posrel.pos" jspvar="dummy" vartype="Integer" write="false">
+   <mm:node element="images" jspvar="image">
+      
     <%
+       boolean right = false;
        int posrel_pos = dummy.intValue();  
-       if((2<posrel_pos)&&(posrel_pos<5)) { imageTemplate = "+s(80)"; }
-       if((4<posrel_pos)&&(posrel_pos<7)) { imageTemplate = "+s(180)(>)"; }
-       if(6<posrel_pos) { imageTemplate = "+s(400)(>)"; }
-     %></mm:field>
-        <table border="0" cellpadding="0" cellspacing="0" <%...@include 
file="imagesposition.jsp" %>>
-    <%
-     // ************** inner table with image 
**********************************************
-     // ** give table small width otherwise description can push the table to 
large width **
-     %><tr><td><div align="center"><img src="<mm:node 
element="images"><mm:image template="<%= imageTemplate %>" /></mm:node
-                   >" alt="<mm:field name="images.title" />" 
border="0"></div></td></tr>
+       Dimension d = (Dimension) image.getFunctionValue("dimension", 
null).get();
+       int width = d.getWidth();
+       int height = d.getHeight();
+       pageContext.setAttribute("width", width);
+       pageContext.setAttribute("height", height);
+       
+       if(posrel_pos == 1 ||posrel_pos == 3 || posrel_pos == 5 || posrel_pos 
== 7){
+          right = true;
+       }
+       if((2<posrel_pos)&&(posrel_pos<5)) { 
+          imageTemplate = "+s(120)(>)";
+          if (width > 120) width = 120;
+       } else if((4<posrel_pos)&&(posrel_pos<7)) {
+          if (width > 180) width = 180;
+          imageTemplate = "+s(180)(>)"; 
+       } else if(6<posrel_pos) { 
+          if (width > 400) width = 400;
+          imageTemplate = "+s(400)(>)"; 
+       }
+       
+       if(right){ 
+   %><div style="float:right;margin:0 0 5px 5px; width: <%=width%>px;"><%
+   } else {
+   %><div style="float:left;margin:0 5px 5px 0; width: <%=width%>px;"><%
+   } %>
+   
+   <c:set var="resizedImageSource"><mm:image 
template="<%=imageTemplate%>"/></c:set>
+   <c:set var="showpopup"><mm:field name="reageer" vartype="String"/></c:set>
+   <c:set var="title"><mm:field name="images.title" /></c:set>
+   </mm:node>
+
+   <c:if test="${showpopup eq 1}">
+      <mm:node element="images" jspvar="image">
+         <c:set var="bigSource"><mm:image template="s(600x450)(>)" /></c:set>
+      </mm:node>
+      <a href="javascript:void(0)" onClick="window.open('${bigSource}', 
'PopUp', 
'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,width=620,height=470')"
 >
+   </c:if>
+
+   <img src="${resizedImageSource}" alt="${title}" border="0">
+   
+   <c:if test="${not empty showpopup}"></a></c:if>
+   
+   </mm:field>
+   <c:if test="${empty imageNoDescription}">
          <mm:field name="images.description">
-         <mm:isnotempty><tr><td><div align="center"><mm:write 
/></div></td></tr>
-             <tr><td class="black"><img src="media/spacer.gif" width="1" 
height="1"></td></tr>
-             <tr><td><img src="media/spacer.gif" width="1" 
height="5"></td></tr></mm:isnotempty
-         ></mm:field
-     ></table>
+         <mm:isnotempty><div style="text-align:center; margin: 5px 0pt 
0pt;"><mm:write /></div></mm:isnotempty>
+      </mm:field>
+   </c:if>
+   <c:remove var="imageNoDescription"/>
+   </div>
 </mm:related>
\ No newline at end of file


Index: relatedparagraph.jsp
===================================================================
RCS file: 
/var/cvs/contributions/natmm/templates/nmintra/includes/relatedparagraph.jsp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- relatedparagraph.jsp        22 Jun 2007 09:14:09 -0000      1.6
+++ relatedparagraph.jsp        22 Dec 2008 15:24:12 -0000      1.7
@@ -1,8 +1,10 @@
+<%...@page isELIgnored="false"%>
 <mm:node element="paragraaf">
 <table cellpadding="0" cellspacing="0" width="100%">
     <tr>
       <td>
-        <%...@include file="../includes/relatedimage_no_description.jsp" %>
+        <c:set var="imageNoDescription" value="true"/>
+        <%...@include file="../includes/relatedimage.jsp" %>
         <mm:field name="titel_zichtbaar"
                           ><mm:compare value="0" inverse="true"
                              ><div class="pageheader"><mm:field name="titel" 




_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to