-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransform.xslt
379 lines (315 loc) · 11.6 KB
/
transform.xslt
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
377
378
379
<?xml version="1.0"?>
<xsl:stylesheet encoding="UTF-8"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl"
version="1.0">
<!--
Copyright notice
(c) 2012-2013 Christine Beier ([email protected])
All rights reserved
This script is part of the master thesis "Die mobile Website der
Universität Passau Kommunikationskonzept und Usability-Test
eines selbst entwickelten Prototypen". The prototype is free software;
you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software
Foundation; either version 3 of the License, or any later version.
The GNU Lesser General Public License can be found at
http://www.gnu.org/licenses/lgpl.txt.
This script is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This copyright notice MUST APPEAR in all copies of the script!
-->
<xsl:output method="html" encoding="UTF-8" />
<!-- Grund-template: Rahmenstruktur des HTML-Dokuments. einzelne Bestandteile
werden gefüllt -->
<xsl:template match="/">
<html>
<head>
<!--setze Titel der Quell-Seite -->
<title>
<xsl:value-of select="//title" />
</title>
<base href="http://www.zitroneneis.org/UniGoesMobile/" />
<meta charset="utf-8" />
<!--navigation in ios verstecken -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<!--<link rel="stylesheet" type="text/css" href="cssv1/reset.css" media="all"/> -->
<link rel="stylesheet" type="text/css" href="cssv1/bootstrap.css"
media="all" />
<link rel="stylesheet" type="text/css" href="cssv1/content.css"
media="all" />
<link rel="stylesheet" type="text/css" href="cssv1/menu.css"
media="all" />
<link rel="stylesheet" type="text/css" href="cssv1/menu_neu.css" media="all"/>
<link rel="stylesheet" type="text/css" href="cssv1/styles.css"
media="all" />
<link rel="stylesheet" type="text/css" href="cssv1/ios_styles.css"
media="all" />
<link rel="stylesheet" type="text/css" href="cssv1/android_styles.css"
media="all" />
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.stayinwebapp.js"></script>
<script src="js/overthrow.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="js/useragent-detect.js"></script>
<script src="js/create-controls.js"></script>
<script type="text/javascript" src="js/bookmark.js"></script>
<meta name="viewport"
content="initial-scale=1, , maximum-scale=1, , minimum-scale=1" />
</head>
<body>
<div id="content-pane">
<div id="content">
<!-- FÜge Inhaltsbereich ein -->
<xsl:apply-templates select="//div[@id='center']" />
</div>
<div class="up-page-content-localnav" id="navigation-menu">
<nav>
<!-- Füge Navigation ein -->
<ul>
<xsl:for-each
select="//ul[@class='topmenu']/li | //ul[@id='topmenu']/li">
<li>
<xsl:if test="@class='top-activ'">
<xsl:attribute name="class">active sub</xsl:attribute>
</xsl:if>
<xsl:if test="a">
<a>
<xsl:apply-templates select="a/@*" />
<xsl:attribute name="href"><xsl:value-of
name="text"
select="php:functionString('str_replace','http://www.uni-passau.de/','',a/@href)" /></xsl:attribute>
<xsl:apply-templates select="a/node()" />
</a>
</xsl:if>
<xsl:if test="@class='top-activ'">
<xsl:apply-templates
select="//div[@id='left']/div[@class='mainnav']/ul" />
</xsl:if>
<!-- Menü rendern, wenn kein a tag im li ist, das passiert nur
auf fakultätsseiten, wo es oben kein Menü gibt! -->
<xsl:if test="not(a)">
<xsl:apply-templates
select="//div[@id='left']/div[@class='mainnav']/ul" />
</xsl:if>
</li>
</xsl:for-each>
</ul>
</nav>
</div>
<div class="up-page-content-localnav" id="shortcuts">
<!--Hier könnte noch Text stehen-->
<nav>
</nav>
</div>
<div id="favorites">
<p>Hier finden Sie Ihre gespeicherten Seiten der Uni-Passau</p>
</div>
<div class="" id="settings">
<h2>
Einstellungen
</h2>
<form>
<p class="bodytext">
Damit Sie sich auf der mobilen Website der Uni-Passau so gut wie
möglich
zurecht finden, bitten wir Sie um einige Angaben.
<br />
</p>
<div class="select">
<label for="targetaudience">Ich...</label>
<select name="targetaudience" class="targetaudience" id="targetaudience">
<option value="schueler">interessiere mich für ein Studium an der Uni Passau</option>
<option value="student">studiere bereits an der Uni Passau</option>
<option value="dozent">bin hier angestellt</option>
</select>
</div>
<p class="bodytext">Mit dieser Angabe, erhalten Sie eine speziell auf Sie
zugeschnittene Startseite, sowie für Sie wichtige Shortcuts unter
dem Punkt
"Direktzugriff".</p>
<div class="select">
<label for="targetdevice">Ich habe ein ...</label>
<select name="targetdevice" class="targetdevice" id="targetdevice">
<option value="">[keine Angabe]</option>
<option value="ios">IPhone/IPad/IPod</option>
<option value="android">Android-Gerät (Nexus 4, Samsung Galaxy,
...)</option>
</select>
</div>
<p class="bodytext">Damit Sie sich möglichst schnell zurecht
finden, präsentieren wir Ihnen je nach Smartphone-Typ
ein angepasstes layout. In der Regel wird dies automatisch
erkannt, wenn Sie aber ein anderes layout sehen wollen,
können
Sie diese Voreinstellung hier jederzeit entsprechend wechseln.</p>
<input type="submit" class="button btn" value="speichern" />
<p class="bodytext">
Nach dem Speichern werden Sie auf Ihre neue Startseite
weitergeleitet.
Sie können Ihre Einstellungen jederzeit unter
"Einstellungen" (Schraubenschlüssel-Symbol
<img src="/images/settings_tab1.png/" />
) ändern.
</p>
<a href="#" id="deletesettings">Einstellungen löschen</a>
</form>
</div>
</div>
<div id="footer">
<div id="copyright" class="">
<span>© 2013 Universität Passau
</span>
</div>
<div id="impressum" class="">
<a href="impressum.html" title="Impressum">
<span>Impressum
</span>
</a>
</div>
<div id="contact" class="">
<a href="kontakt.html" title="Kontakt">
<span>Kontakt
</span>
</a>
</div>
</div>
<div id="mainbar">
</div>
<div id="auxbar">
</div>
<div id="controls">
<div id="logo-icon" class="icon">
<a href="/UniGoesMobile/">
<img src="images/logo.png" />
</a>
</div>
<div id="sitetitle" class="label">
<xsl:value-of select="//title" />
</div>
<div id="search-icon" class="button">
<a href="#search-area" id="search-a" title="Suche">
<span>Suche
</span>
</a>
</div>
<div id="add-favorite-icon" class="button">
<a href="#bookmark-status" title="Seite merken">
<span>Seite merken
</span>
</a>
</div>
<div id="shortcuts-icon" class="button">
<a href="#shortcuts" title="Direktzugriff">
<span>Direktzugriff
</span>
</a>
</div>
<div id="favorites-icon" class="button">
<a href="#favorites" title="Favoriten">
<span>Favoriten
</span>
</a>
</div>
<div id="more-icon" class="button">
<a href="#more-container" title="Mehr">
<span>Mehr
</span>
</a>
</div>
<div id="less-icon" class="button">
<a href="#more-container" title="Mehr">
<span>Mehr
</span>
</a>
</div>
<div id="menu-icon" class="button">
<a href="#navigation-menu" title="Navigation">
<span>Navigation
</span>
</a>
</div>
<div id="content-icon" class="button">
<a href="#content" title="Inhalt">
<span>Inhalt
</span>
</a>
</div>
<div id="settings-icon" class="button">
<a href="#settings" title="Einstellungen">
<span>Einstellungen
</span>
</a>
</div>
<div id="more-container" class="container">
</div>
<div id="bookmark-status" class="status">
<p class="bodytext">
Ihre Favoriten wurden aktualisiert
</p>
<a href="javascript:return false;" class="button btn confirm">Ok</a>
</div>
</div>
<div id="overlay-pane">
</div>
<div id="elements">
<div id="search-area" class="container">
<form action="/UniGoesMobile/cgi-bin/search.cgi" id="search"
name="searchform" method="get">
<input name="q" type="search" class="search" id="Suche"
placeholder="Suchbegriff" />
</form>
</div>
</div>
</body>
</html>
</xsl:template>
<!-- Absolute URLs in Menülinks ersetzen -->
<!-- menüklassen ersetzen -->
<xsl:template
match="//li/@class[.='menu1-lev1-actifsub']|//li/@class[.='menu1-lev2-actifsub']|//li/@class[.='menu1-lev3-actifsub']">
<xsl:attribute name="class">active sub</xsl:attribute>
</xsl:template>
<xsl:template
match="//li/@class[.='menu1-lev1-curifsub']|//li/@class[.='menu1-lev2-curifsub']|//li/@class[.='menu1-lev3-curifsub']">
<xsl:attribute name="class">current sub</xsl:attribute>
</xsl:template>
<!--buttons für Seitennavigation -->
<xsl:template match="//p[@class='pagebrowser']/span/a/@class">
<xsl:attribute name="class">btn</xsl:attribute>
</xsl:template>
<xsl:template match="//div[@class='browseLinksWrap']/a">
<a>
<xsl:attribute name="class">btn</xsl:attribute>
<xsl:apply-templates select="@*|node()" />
</a>
</xsl:template>
<xsl:template match="//div[@class='browseLinksWrap']/span/@class">
<xsl:attribute name="class">btn disabled</xsl:attribute>
</xsl:template>
<xsl:template match="//p[@class='pagebrowser']/span/b/@class ">
<xsl:attribute name="class">btn disabled</xsl:attribute>
</xsl:template>
<!--<xsl:template match="//p[@class='pagebrowser']/span/b"> <b> <xsl:attribute
name="class">btn</xsl:attribute> <xsl:copy> <xsl:apply-templates select="@*|node()"/>
</xsl:copy> </b> </xsl:template> -->
<!-- bildpfade umbiegen -->
<xsl:template match="//img">
<img title="{@title}" alt="{@alt}" width="{@width}" height="{@width}"
src="http://old.uni-passau.de/{@src}" />
</xsl:template>
<xsl:template match="//input[@type='submit']">
<xsl:copy>
<xsl:attribute name="class">btn</xsl:attribute>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<!-- identitäts-Template: kopiert 1-zu-1 den input -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>