сейчас этим всем рулит вот такой xsl код:
CODE (htmlphp):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE xsl:stylesheet>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html" encoding="utf-8"/>
- <xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
- <xsl:template match="/document">
- <SCRIPT>
- <xsl:comment>
- <xsl:text disable-output-escaping="yes">
- <![CDATA[
- function ShowImgWindow(title, src, width, height)
- {
- obj = window.open("", "", "scrollbars=0,dialog=0,minimizable=1,modal=1,width="+width+",height="+height+",resizable=0");
- obj.document.write("<html>");
- obj.document.write("<head>");
- obj.document.write("<title>"+title+"</title>");
- obj.document.write("</head>");
- obj.document.write("<body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>");
- obj.document.write("<img src=\""+src+"\" />");
- obj.document.write("</body>");
- obj.document.write("</html>");
- }
- newInt = '';
- function move_step(top) {
- if (top == 0)
- {
- clearInterval(newInt);
- }
- else if (top == 1)
- {
- newInt = setInterval("step_up()",90);
- }
- else
- {
- newInt = setInterval("step_down()",90);
- }
- }
- function moveMouseOut()
- {
- if (newInt != '')
- {
- move_step(0)
- }
- }
- function step_up(){
- var step_scroll = 10;
- var scroll = scroll_clipper.scrollLeft;
- scroll_clipper.scrollLeft = scroll + step_scroll;
- }
- function step_down(){
- var step_scroll = 10;
- var scroll = scroll_clipper.scrollLeft;
- scroll_clipper.scrollLeft = scroll - step_scroll;
- }
- function ClearInt()
- {
- if(newInt)
- {
- clearInterval(newInt)
- }
- }
- function ShowPhoto(src, big_photo_name, src_big_image, width_big_image, height_big_image)
- {
- document.getElementById('foto').innerHTML = '<img onclick="ShowImgWindow(\''+big_photo_name+'\',\''+src_big_image+'\', ' + width_big_image + ',' + height_big_image +')" src="' + src + '" class="img_b">';
- }
- ]]>
- </xsl:text>
- </xsl:comment>
- </SCRIPT>
- <!--
- <h1>
- <xsl:value-of disable-output-escaping="yes" select="blocks/name"/>
- </h1>
- -->
- <xsl:value-of disable-output-escaping="yes" select="blocks/description"/>
- <!-- Отображение записи информационного блока -->
- <div class="content-center-catalog" style="display: table;">
- <div id="foto" style="border: solid 1px #ffffff; display: table-cell; vertical-align: middle;">
- <xsl:if test="item_image!=''">
- <xsl:variable name="big_photo_name" select="item_propertys/item_property[@xml_name='big_file1']/property_name"/>
- <xsl:variable name="src_big_image" select="item_propertys/item_property[@xml_name='big_file1']/property_file_path"/>
- <xsl:variable name="width_big_image" select="item_propertys/item_property[@xml_name='big_file1']/value/@width"/>
- <xsl:variable name="height_big_image" select="item_propertys/item_property[@xml_name='big_file1']/value/@height"/>
- <img class="img_b" />
- </xsl:if>
- </div>
- </div>
- <div class="content-bottom-catalog">
- <table cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td style="vertical-align:middle; width:29px;">
- <img src="/images/l_arr.jpg" style="cursor:hand;" onMouseDown="javascript:move_step('-1')" onMouseUp="javascript:move_step('0')" onMouseOut="javascript:moveMouseOut()"/>
- </td>
- <td style="vertical-align:middle">
- <div id="scroll_clipper" style="width: 200px; height: 135px; overflow:auto;">
- <div id="scroll_clipper2" style=" white-space: nowrap;">
- <xsl:apply-templates select="blocks/items/item[item_status=1 and item_image != '']"/>
- </div>
- </div>
- </td>
- <td style="vertical-align:middle; width:29px;" align="right">
- <img src="/images/r_arr.jpg" style="cursor:hand;" onMouseDown="javascript:move_step('1')" onMouseUp="javascript:move_step('0')" onMouseOut="javascript:moveMouseOut()"/>
- </td>
- </tr>
- </table>
- </div>
- </xsl:template>
- <xsl:template match="blocks/items/item">
- <xsl:variable name="srcpath" select="item_image"/>
- <xsl:variable name="big_photo_name" select="item_name"/>
- <xsl:variable name="src_big_image" select="item_image"/>
- <xsl:variable name="width_big_image" select="item_image/@width"/>
- <xsl:variable name="height_big_image" select="item_image/@height"/>
- <!--<a href="JavaScript:void(0)" onclick="ShowImgWindow('{item_propertys/item_property[@xml_name='foto1']/property_name}','/{$srcpath}', {item_propertys/item_property[@xml_name='foto1']/value/@width}, {item_propertys/item_property[@xml_name='foto1']/value/@height})">
- <img src="/{item_propertys/item_property[@xml_name='foto1']/small_image/property_file_path}" class="gall" style="margin-top: 5px;"/></a>-->
- <img onclick="ShowPhoto('{$srcpath}', '{$big_photo_name}', '{$src_big_image}', {$width_big_image}, {$height_big_image})" src="{item_small_image}" class="gall"
- style="margin:0px 10px 0px 0px; cursor: pointer;"/>
- </xsl:template>
- </xsl:stylesheet>