root/main/branches/64_bit_Greenstone/greenstone3/web/interfaces/default-client-xslt/transform/icons.xsl @ 24007

Revision 24007, 4.4 KB (checked in by sjm84, 8 years ago)

Updating this branch to match the latest Greenstone3 changes

Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4  xmlns:java="http://xml.apache.org/xslt/java"
5  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6  extension-element-prefixes="java util"
7  exclude-result-prefixes="java util">
8 
9  <!-- some global parameters - these are set by whoever is invoking the transformation -->
10  <xsl:param name="interface_name"/>
11
12  <!-- Display the appropriate image, depending on the node type -->
13  <xsl:template match="documentNode" mode="displayNodeIcon">
14   
15    <!-- Root node: book icon (open or closed) -->
16    <xsl:choose>
17      <xsl:when test="@nodeType='root'">
18    <xsl:choose>
19      <xsl:when test="documentNode">
20        <xsl:call-template name="openbookimg">
21          <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param>
22        </xsl:call-template>
23      </xsl:when>
24      <xsl:otherwise>
25        <xsl:call-template name="closedbookimg">
26          <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_book')"/></xsl:with-param>
27        </xsl:call-template>
28      </xsl:otherwise>
29    </xsl:choose>
30      </xsl:when>
31     
32      <!-- Internal node: folder icon (open or closed) -->
33      <xsl:when test="@nodeType='internal'">
34    <xsl:choose>
35      <xsl:when test="documentNode">
36        <xsl:call-template name="openfolderimg">
37          <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_folder')"/></xsl:with-param>
38        </xsl:call-template>
39      </xsl:when>
40      <xsl:otherwise>
41        <xsl:call-template name="closedfolderimg">
42          <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_folder')"/></xsl:with-param>
43        </xsl:call-template>
44      </xsl:otherwise>
45    </xsl:choose>
46      </xsl:when>
47     
48      <!-- Leaf node: page icon, and this is the default -->
49      <xsl:otherwise>
50    <xsl:call-template name="textpageimg">
51      <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'view_document')"/></xsl:with-param>
52    </xsl:call-template>
53      </xsl:otherwise>
54    </xsl:choose>
55  </xsl:template>
56
57  <xsl:template name="openbookimg">
58    <xsl:param name="alt"/>
59    <xsl:param name="title"/>
60    <img  border="0" width="28" height="23"
61      src="interfaces/default/images/openbook.gif"
62      alt="{$alt}" title="{$title}"/>
63  </xsl:template>
64
65  <xsl:template name="closedbookimg">
66    <xsl:param name="alt"/>
67    <xsl:param name="title"/>
68    <img border="0" width="18" height="11"
69      src="interfaces/default/images/book.gif"
70      alt="{$alt}" title="{$title}"/>
71  </xsl:template>
72
73  <xsl:template name="openfolderimg">
74    <xsl:param name="alt"/>
75    <xsl:param name="title"/>
76    <img border="0" width="23" height="15"
77      src="interfaces/default/images/openfldr.gif"
78      alt="{$alt}" title="{$title}"/>
79  </xsl:template>
80
81  <xsl:template name="closedfolderimg">
82    <xsl:param name="alt"/>
83    <xsl:param name="title"/>
84    <img  border="0" width="23" height="15"
85      src="interfaces/default/images/clsdfldr.gif"
86      alt="{$alt}" title="{$title}"/>
87  </xsl:template>
88
89  <xsl:template name="textpageimg">
90    <xsl:param name="alt"/>
91    <xsl:param name="title"/>
92    <img  border="0" width="16" height="21"
93      src="interfaces/default/images/itext.gif"
94      alt="{$alt}" title="{$title}"/>
95  </xsl:template>
96
97  <xsl:template name="bookshelfimg">
98    <xsl:param name="alt"/>
99    <xsl:param name="title"/>
100    <img  border="0" width="20" height="16"
101      src="interfaces/default/images/bshelf.gif" 
102      alt="{$alt}" title="{$title}"/>
103  </xsl:template>
104
105  <xsl:template name="iconpdf">
106    <xsl:param name="alt">PDF</xsl:param>
107    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonpdf')"/></xsl:param>
108    <img border="0" width='26' height='26'
109      src='interfaces/default/images/ipdf.gif'
110      alt='{$alt}' title='{$title}'/>
111  </xsl:template>
112 
113  <xsl:template name="icondoc">
114    <xsl:param name="alt">Word</xsl:param>
115    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonmsword')"/></xsl:param>
116    <img border="0" width='26' height='26'
117      src='interfaces/default/images/imsword.gif'
118      alt='{$alt}' title='{$title}'/>
119  </xsl:template>
120
121</xsl:stylesheet>
122
Note: See TracBrowser for help on using the browser.