Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/index.xsl
blob: 205e5ffad894a2453ba4afe77e7d14e35b0666fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
  version="1.0"
  encoding="UTF-8"
  indent="yes"
  omit-xml-declaration="yes"
  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />

<xsl:template match="/">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>

<!-- Establish character encoding -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<!-- Force reload from server, not local cache -->
<meta http-equiv="pragma" content="no-cache" />

<!-- Allows search engine bots to index this page -->
<meta name="ROBOTS" content="ALL" />

<!-- Disables Microsoft's Smart Tags functionality on this page -->
<meta name="MSSmartTagsPreventParsing" content="true" />

<!-- Provides keywords for search engines -->
<meta name="KEYWORDS"><xsl:attribute name="content"><xsl:value-of select="xml/global/keywords"/></xsl:attribute></meta>

<title><xsl:value-of select="xml/global/title" /></title>

<!-- Default stylesheet -->
<style media="all" type="text/css">@import "css/styles_black.css";</style>

<xsl:comment><![CDATA[[if IE]><link rel="stylesheet" href="css/ie.css" type="text/css" /><![endif] ]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen" href="css/ie6.css" /><![endif]]]></xsl:comment>

<script type="text/javascript" language="JavaScript">
<xsl:comment><![CDATA[
	logos = new Array();
    logos[0] = 'assets/logo_black_01.png';
    logos[1] = 'assets/logo_black_02.png';
    logos[2] = 'assets/logo_black_03.png';
    logos[3] = 'assets/logo_black_04.png';
    logos[4] = 'assets/logo_black_05.png';
    logos[5] = 'assets/logo_black_06.png';
    logos[6] = 'assets/logo_black_07.png';
    logos[7] = 'assets/logo_black_08.png';
    logos[8] = 'assets/logo_black_09.png';
    logos[9] = 'assets/logo_black_10.png';
    logos[10] = 'assets/logo_black_11.png';
    logos[11] = 'assets/logo_black_12.png';

	var loadCSS = function(file) { 
		var link = document.createElement('link'); 
		link.href = file; 
		link.rel = 'stylesheet'; 
		link.type = 'text/css'; 
		document.getElementsByTagName('head')[0].appendChild(link); 
	};

    function newImage()
    {
    	r = Math.round(Math.random()*11);
        document.getElementById("logo").setAttribute("src", logos[r])
        
        // get corresponding stylesheet
        if (r == 0) { loadCSS('css/styles_black_01.css'); }
        if (r == 1) { loadCSS('css/styles_black_02.css'); }
        if (r == 2) { loadCSS('css/styles_black_03.css'); }
        if (r == 3) { loadCSS('css/styles_black_04.css'); }
        if (r == 4) { loadCSS('css/styles_black_05.css'); }
        if (r == 5) { loadCSS('css/styles_black_06.css'); }
        if (r == 6) { loadCSS('css/styles_black_07.css'); }
        if (r == 7) { loadCSS('css/styles_black_08.css'); }
        if (r == 8) { loadCSS('css/styles_black_09.css'); }
        if (r == 9) { loadCSS('css/styles_black_10.css'); }
        if (r == 10) { loadCSS('css/styles_black_11.css'); }
        if (r == 11) { loadCSS('css/styles_black_12.css'); }
        
    }
]]></xsl:comment>
</script>

<script src="scripts/menu.js" type="text/javascript"></script>

</head>

<body>

<!-- logo -->
<div class="logo"><a href="index.php"><img src="assets/spacer.gif" alt="sugarlabs" width="202" height="45" border="0" id="logo" /></a></div>

<!-- menu -->

<!-- set variable to get section -->
<ul id="menu">
	<li>
		<a href="#" name="hint" class="current">menu</a>
		<ul id="expanded_menu_1">
			<li><a href="index.php" name="index" class="selected">index</a></li>
			
			<xsl:for-each select="//xml/sections/section">
			
				<li>
					<a>
						<xsl:attribute name="href">
							<xsl:text>index.php?template=page&amp;page=</xsl:text>
							<xsl:value-of select="./@id"/>
						</xsl:attribute>
						<xsl:value-of select="./@title"/>
					</a>
					
					<xsl:if test="section">
					<ul id="expanded_menu_2">				
						<xsl:for-each select="section">
							<li>
								<a>
									<xsl:attribute name="href">
										<xsl:text>index.php?template=page&amp;page=</xsl:text>
										<xsl:value-of select="./@id"/>
									</xsl:attribute>
									<xsl:value-of select="./@title"/>
								</a>
								
								<xsl:if test="section">
								<ul id="expanded_menu_3">				
									<xsl:for-each select="section">
										<li>
											<a>
												<xsl:attribute name="href">
													<xsl:text>index.php?template=page&amp;page=</xsl:text>
													<xsl:value-of select="./@id"/>
												</xsl:attribute>
												<xsl:value-of select="./@title"/>
											</a>
											
											<xsl:if test="section">
											<ul id="expanded_menu_4">				
												<xsl:for-each select="section">
													<li>
														<a>
															<xsl:attribute name="href">
																<xsl:text>index.php?template=page&amp;page=</xsl:text>
																<xsl:value-of select="./@id"/>
															</xsl:attribute>
															<xsl:value-of select="./@title"/>
														</a>
													</li>
												</xsl:for-each>
											</ul>
											</xsl:if>
										</li>
									</xsl:for-each>
								</ul>
								</xsl:if>
							</li>
						</xsl:for-each>
					</ul>
					</xsl:if>
				</li>
			</xsl:for-each>
		</ul>
	</li>
</ul>

<!-- global links -->
<div class="links-container">
	<span class="links">
		<xsl:for-each select="xml/links/link">
			<a class="link">
				<xsl:attribute name="href">
					<xsl:value-of select="./@url"/>
				</xsl:attribute>
				<xsl:value-of select="."/>
			</a>
			<xsl:if test="position() &lt; count(//xml/links/link)">
				<xsl:text> / </xsl:text>
			</xsl:if>
		</xsl:for-each>
	</span>
</div>

<!-- main content well -->
<div class="content-container">
	
	<div class="content">
		<ul id="keyphrases" class="content">
			<xsl:for-each select="//keyphrase">
	
				<xsl:sort select="." data-type="text" order="ascending"/>
				
				<li class="keyphrase">
					<xsl:attribute name="id">
						<xsl:text>line</xsl:text>
						<xsl:value-of select="position()"/>
					</xsl:attribute>
			
					<xsl:variable name="key"><xsl:value-of select="." /></xsl:variable>
					<a class="link">
						<xsl:attribute name="href">						
							<xsl:text>index.php?template=page&amp;page=</xsl:text>
							<xsl:value-of select="ancestor::page/@id" />
							
							<xsl:text>#phrase</xsl:text>
							<xsl:for-each select="//keyphrase">
							
								<xsl:if test=". = $key">
									<xsl:value-of select="position()" />
								</xsl:if>
								
							</xsl:for-each>
						</xsl:attribute>
						<xsl:text>...</xsl:text>
						<xsl:value-of select="./@title"/>
						<xsl:text>...</xsl:text>
					</a>
			
				</li>
			</xsl:for-each>
		</ul>
	</div>

	<!-- sidebar -->
	<xsl:if test="//xml/page[@id = 'index']/sidebar">
		<div class="sidebar">
			<xsl:for-each select="//xml/page[@id = 'index']/sidebar/*">
				<xsl:if test="local-name()='thumbnail'">
					<div class="thumb-wrapper spc last">
						<div class="spc">
							<a>
								<xsl:attribute name="href">
									<xsl:if test="@id">
										<xsl:text>index.php?template=page&amp;page=</xsl:text>
										<xsl:value-of select="@id"/>
									</xsl:if>
									<xsl:if test="@url">
										<xsl:value-of select="@url"/>
									</xsl:if>
								</xsl:attribute>
				
								<xsl:apply-templates select="image" />
							</a>
						</div>
						<xsl:if test="title">
							<div>
								<a class="link">
									<xsl:attribute name="href">
										<xsl:if test="@id">
											<xsl:text>index.php?template=page&amp;page=</xsl:text>
											<xsl:value-of select="@id"/>
										</xsl:if>
										<xsl:if test="@url">
											<xsl:value-of select="@url"/>
										</xsl:if>
									</xsl:attribute>
					
									<xsl:value-of select="title"/>
								</a>
							</div>
						</xsl:if>
						<xsl:if test="caption">
							<div class="links"><xsl:apply-templates select="caption"/></div>
						</xsl:if>
					</div>
				</xsl:if>
				<xsl:if test="local-name()='paragraph'">
					<div class="links clr"><xsl:apply-templates select="."/></div>
				</xsl:if>
			</xsl:for-each>
		</div>
	</xsl:if>
</div>

<!-- global pagination -->

<xsl:if test="//page[@id = 'index']/@paginate">
<div class="pagination">

	<xsl:if test="2 &lt;= count(//page[@paginate])">
		<a class="link">
			<xsl:attribute name="href">
				<xsl:text>index.php?template=page&amp;page=</xsl:text>

				<xsl:for-each select="//page[@paginate]">
					<xsl:if test="position() = 2">
						<xsl:value-of select="./@id"/>
					</xsl:if>
				</xsl:for-each>
				
			</xsl:attribute>
			<xsl:text>next &#62;</xsl:text>
		</a>
	</xsl:if>
	
</div>
</xsl:if>

<!-- footer -->
<div class="footer"><xsl:apply-templates select="xml/global/footer" /></div>

<script type="text/javascript">
<xsl:comment><![CDATA[

newImage();

var res = new Array();
var timeout_val = 100;

var n = 0;
var keyphrases = document.getElementById("keyphrases");
var labels = keyphrases.getElementsByTagName("li"); 

for (n = 1; n <= labels.length; n++) {
	var str = "line" + n;
	document.getElementById(str).style.visibility = "hidden";
	var str2 = "timer_func(" + n + ")";
	res[n] = setTimeout(str2, timeout_val * n);
}

function timer_func(line) 
{ 
	var str = "line" + line;
	document.getElementById(str).style.visibility = "visible"; 
}

]]></xsl:comment>
</script>
</body>
</html>
</xsl:template>

<!-- formatting -->

<xsl:template match="link">
	<a xmlns="http://www.w3.org/1999/xhtml" class="link">
		<xsl:if test="@external">
			<xsl:attribute name="target">_blank</xsl:attribute>
		</xsl:if>
		<xsl:attribute name="href">
			<xsl:if test="@url"><xsl:value-of select="@url"/></xsl:if>
			<xsl:if test="@id">index.php?template=page&#38;page=<xsl:value-of select="@id"/></xsl:if>
		</xsl:attribute>
		<xsl:value-of select="."/>
	</a>
</xsl:template>

<xsl:template match="line-break">
	<br xmlns="http://www.w3.org/1999/xhtml" />
</xsl:template>

<xsl:template match="italic">
	<em xmlns="http://www.w3.org/1999/xhtml">
		<xsl:value-of select="."/>
	</em>
</xsl:template>

<xsl:template match="image">
	<img border="0">
		<xsl:attribute name="src"><xsl:value-of select="@url"/></xsl:attribute>
		<xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
		<xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
		<xsl:if test="./@border">
			<xsl:attribute name="class">thumb</xsl:attribute>
		</xsl:if>
	</img>
</xsl:template>

<xsl:template match="headline">
	<span class="headline">
		<xsl:value-of select="."/>
	</span>
</xsl:template>

</xsl:stylesheet>