Warning, /graphics/digikam/core/dplugins/generic/tools/htmlgallery/themes/frames/template.xsl is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8" ?>
0002 
0003 <!--
0004  * ============================================================
0005  *
0006  * This file is a part of digiKam project
0007  * https://www.digikam.org
0008  *
0009  * Date        : 2010-01-21
0010  * Description : A framed theme for the digiKam html gallery tool.
0011  *
0012  * SPDX-FileCopyrightText: 2010 by Ruediger Bente <ruediger dot bente at gmx dot de>
0013  *
0014  * SPDX-License-Identifier: GPL-2.0-or-later
0015  *
0016  * ============================================================
0017  -->
0018 
0019 <!DOCTYPE stylesheet [
0020 <!ENTITY raquo "&#187;" >
0021 <!ENTITY blank "&#160;" >
0022 ]>
0023 
0024 <xsl:transform version="1.0"
0025         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
0026         xmlns:exsl="http://exslt.org/common"
0027         extension-element-prefixes="exsl">
0028 
0029 <!-- ********************************************************************* -->
0030 <!-- ** Create single image page for each imag                          ** -->
0031 <!-- ********************************************************************* -->
0032 <xsl:template name="createImagePage">
0033         <html>
0034         <head>
0035                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0036                 <title><xsl:value-of select="title"/></title>
0037                 <link rel="stylesheet" type="text/css" href="../frames/style.css"/>
0038         </head>
0039         <body id="imagePage">
0040         <h1>
0041                 <span>
0042                         <xsl:value-of select="../name"/>
0043                 </span>
0044         </h1>
0045         <div id="imagePage">
0046                 <table border="0" width="100%">
0047                 <tr>
0048                         <td align="center">
0049                                 <img src="{full/@fileName}" width="{full/@width}" height="{full/@height}" />
0050                                 <xsl:if test="original/@fileName != ''">
0051                                         <p>
0052                                         <a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a>
0053                                         (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)
0054                                         </p>
0055                                 </xsl:if>
0056 ยด                      </td>
0057                 </tr>
0058                 </table>
0059                 <p>
0060                         <xsl:value-of select="description"/>
0061                 </p>
0062 
0063         </div>
0064         <h1>
0065                 <span>
0066                         &raquo; <xsl:value-of select="title"/>
0067                         (<xsl:value-of select="position()"/>/<xsl:value-of select="last()"/>)
0068                         &raquo;
0069                 </span>
0070         </h1>
0071         </body>
0072         </html>
0073 </xsl:template>
0074 
0075 <!-- ********************************************************************* -->
0076 <!-- ** Create thumbnail page for each collection                       ** -->
0077 <!-- ********************************************************************* -->
0078 <xsl:template name="createThumbnailPage">
0079         <html>
0080         <head>
0081                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0082                 <title><xsl:value-of select="name"/></title>
0083                 <link rel="stylesheet" type="text/css" href="frames/style.css"/>
0084         </head>
0085         <body id="collectionPage">
0086         <div id="content">
0087         <ul>
0088                         <xsl:variable name="folder" select='fileName'/>
0089                         <xsl:for-each select="image">
0090                                 <li>
0091                                         <a href="{$folder}/{full/@fileName}.html" target="image">
0092                                                 <img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}"/>
0093                                         </a>
0094                                         <xsl:value-of select="title"/>
0095                                         (<xsl:value-of select="position()"/>/<xsl:value-of select="last()"/>)
0096                                 </li>
0097                                 <exsl:document href='{$folder}/{full/@fileName}.html'>
0098                                         <xsl:call-template name="createImagePage"/>
0099                                 </exsl:document>
0100                         </xsl:for-each>
0101         </ul>
0102         </div>
0103         </body>
0104         </html>
0105 </xsl:template>
0106 
0107 <!-- ********************************************************************* -->
0108 <!-- ** Create frameset page if only one collection                     ** -->
0109 <!-- ********************************************************************* -->
0110 <xsl:template name="createFrameSetPage">
0111 <!-- ** create variable tsize for the width of the thumbnails frame            ** -->
0112 <!-- ** add 50 pixel to tsize for the border around the thumbnail              ** -->
0113         <xsl:variable name="tsize" select="image[1]/thumbnail/@width + 50"/>
0114         <html>
0115         <head>
0116                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0117 
0118                 <title>
0119                 <xsl:value-of select="name"/>
0120                 </title>
0121                 <link rel="stylesheet" type="text/css" href="frames/style.css"/>
0122         </head>
0123         <frameset cols="{$tsize},*" noresize="1" border="0">
0124                 <frame src="thmbs.html" name="mythmbs"/>
0125                 <frame src="blank.html" name="image"/>
0126         </frameset>
0127         <exsl:document href="thmbs.html">
0128                 <xsl:call-template name="createThumbnailPage"/>
0129         </exsl:document>
0130         </html>
0131 </xsl:template>
0132 
0133 <!-- ********************************************************************* -->
0134 <!-- ** Create the collection index page when more than one collection  ** -->
0135 <!-- ********************************************************************* -->
0136 <xsl:template name="createCollectionIndexPage">
0137         <html>
0138         <head>
0139                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0140                 <title><xsl:value-of select="$i18nCollectionList"/></title>
0141                 <link rel="stylesheet" type="text/css" href="frames/style.css"/>
0142         </head>
0143         <body id="collectPage">
0144         <div id="CollectPageContent">
0145                         <xsl:for-each select="collections/collection">
0146                                         <xsl:sort select="name" order="ascending" data-type="text" />
0147                                         &blank;
0148                                         <a href="Thmbs{fileName}.html" target="mythmbs">
0149                                                 <xsl:value-of select="name"/>
0150 
0151                                         </a>
0152                                         <xsl:for-each select="image">
0153                                                 <xsl:choose>
0154                                                         <xsl:when test="position()=last()">
0155                                                                 (<xsl:value-of select="last()"/>)
0156                                                         </xsl:when>
0157                                                 </xsl:choose>
0158                                         </xsl:for-each>
0159                                 <exsl:document href="Thmbs{fileName}.html">
0160                                         <xsl:call-template name="createThumbnailPage"/>
0161                                 </exsl:document>
0162                                 
0163                         </xsl:for-each>
0164         </div> <!-- /content -->
0165         </body>
0166         </html>
0167         
0168 </xsl:template>
0169 
0170 <!-- ********************************************************************* -->
0171 <!-- ** Create the frameset page when more than one collection          ** -->
0172 <!-- ********************************************************************* -->
0173 <xsl:template name="createCollectionFrameSetPage">
0174 <!-- ** create variable tsize for the width of the thumbnails frame            ** -->
0175 <!-- ** add 50 pixel to tsize for the border around the thumbnail              ** -->
0176         <xsl:variable name="tsize" select="collections/collection[1]/image[1]/thumbnail/@width + 50"/>
0177         <html>
0178         <head>
0179                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0180 
0181                 <title>
0182                 <xsl:value-of select="name"/>
0183                 </title>
0184                 <link rel="stylesheet" type="text/css" href="frames/style.css"/>
0185         </head>
0186         <frameset rows="5%,*" noresize="1" border="0">
0187                 <frame src="collect.html" name="collection"/>
0188                 <frameset cols="{$tsize},*" noresize="1" border="0">
0189                         <frame src="blank.html" name="mythmbs"/>
0190                         <frame src="blank.html" name="image"/>
0191                 </frameset>
0192         </frameset>
0193         </html>
0194         <exsl:document href="collect.html">
0195                 <xsl:call-template name="createCollectionIndexPage"/>
0196         </exsl:document>
0197 </xsl:template>
0198 
0199 <!-- ********************************************************************* -->
0200 <!-- ** Create a blank page                                             ** -->
0201 <!-- ** as a starting page when more than one collection is used        ** -->
0202 <!-- ********************************************************************* -->
0203 <xsl:template name="createBlankPage">
0204         <html>
0205         <head>
0206                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0207 
0208                 <title>
0209                 <xsl:value-of select="name"/>
0210                 </title>
0211                 <link rel="stylesheet" type="text/css" href="frames/style.css"/>
0212         </head>
0213         <body id="collectionPage">
0214                 <xsl:value-of select="title"/>
0215         </body>
0216 
0217         </html>
0218 </xsl:template>
0219 
0220 
0221 <!-- ********************************************************************* -->
0222 <!-- ** the beginning of all                                            ** -->
0223 <!-- ********************************************************************* -->
0224 <xsl:template match="/">
0225         <xsl:choose>
0226                 <xsl:when test="count(collections/collection) &gt; 1">
0227                         <xsl:call-template name="createCollectionFrameSetPage"/>
0228                 </xsl:when>
0229                 <xsl:otherwise>
0230                         <xsl:for-each select="collections/collection">
0231                                 <xsl:call-template name="createFrameSetPage"/>
0232                         </xsl:for-each>
0233                 </xsl:otherwise>
0234         </xsl:choose>
0235         <exsl:document href="blank.html">
0236                 <xsl:call-template name="createBlankPage"/>
0237         </exsl:document>
0238 </xsl:template>
0239 
0240 </xsl:transform>