source: GTP-Internal/trunk/Webpage/NOF/gtp_webpage/Styles/GameTools1-v18/template/decoratorStyle.xsl @ 714

Revision 714, 3.0 KB checked in by giegl, 18 years ago (diff)

GTP NOF webpage initial check in

Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet  xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4<!-- Global parameters -->
5<xsl:param name="navbarOrientation">vertical</xsl:param>
6
7<xsl:template match="header" mode="graphicView"> 
8  <xsl:apply-templates select="./preview"/>     
9</xsl:template>
10
11<xsl:template match="preview">
12  <xsl:apply-templates select="thumbnail"/>
13</xsl:template>
14
15<xsl:template match="thumbnail">
16  <img src="{./image/@path}" border="0"/>
17</xsl:template>
18
19
20<xsl:template match="rectangle" mode="graphicView"> 
21  <div style="top:{@offsetHeight}; left:{@offsetWidth}">
22    <table border="0" cellspacing="0" cellpadding="0">
23      <xsl:apply-templates select="hbox|vbox" mode="table"/>
24    </table>
25  </div><br/>
26</xsl:template>
27
28<xsl:template match="header"> 
29  <script>
30    var topOffset   = <xsl:value-of select="@topOffset"/>;
31    var leftOffset  = <xsl:value-of select="@leftOffset"/>;
32    var isDecorator = true;
33  </script>
34  <xsl:for-each select="rectangle" >
35    <xsl:apply-templates select="."/>
36  </xsl:for-each>   
37</xsl:template>
38
39
40<xsl:template match="rectangle">
41  <xsl:param name="offHeight">
42     <xsl:choose>
43       <xsl:when test="@offsetHeight = ''">0</xsl:when>
44       <xsl:otherwise><xsl:value-of select="@offsetHeight"/></xsl:otherwise>
45     </xsl:choose>
46  </xsl:param>
47
48  <xsl:param name="offWidth">
49     <xsl:choose>
50       <xsl:when test="@offsetWidth = ''">0</xsl:when>
51       <xsl:otherwise><xsl:value-of select="@offsetWidth"/></xsl:otherwise>
52     </xsl:choose>
53  </xsl:param>
54 
55  <div style="position:absolute; top:{$offHeight}; left:{$offWidth}">
56    <table border="0" cellspacing="0" cellpadding="0">
57      <xsl:apply-templates select="hbox|vbox" mode="table"/>
58    </table>
59  </div>
60</xsl:template>
61
62<xsl:template match="vbox" mode="table"> 
63  <xsl:for-each select="hbox">
64    <tr>
65     <xsl:apply-templates select="." mode="td"/>
66    </tr>
67  </xsl:for-each>     
68</xsl:template>
69
70
71<xsl:template match="hbox" mode="table">
72  <tr>
73    <xsl:for-each select="hbox">     
74      <xsl:apply-templates select="." mode="td"/> 
75    </xsl:for-each> 
76  </tr>   
77</xsl:template>
78
79
80<xsl:template match="hbox" mode="td">
81    <xsl:param name="navbarOrientation" select="@navbarOrientation"/>
82    <td bgcolor="{@bgcolor}" width="{@width}" height="{@height}" valign="{@valign}"  background="{@background}">
83      <xsl:if test="@includeBanner = 'true'"> 
84        <div id="bannerContainer"></div>
85      </xsl:if>
86      <xsl:if test="@includeNavbar = 'true'"> 
87 
88        <div id="navbarContainer" type="{$navbarOrientation}"></div>
89      </xsl:if>     
90      <xsl:apply-templates select="image|text"/>
91    </td>
92</xsl:template>
93
94<xsl:template match="image">
95  <xsl:choose>
96    <xsl:when test="@width != ''">
97      <img src="{@path}" width="{@width}" height="{@height}" />
98    </xsl:when>
99    <xsl:otherwise>
100      <img src="{@path}"/>
101    </xsl:otherwise>
102  </xsl:choose>
103 
104</xsl:template>
105
106</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.