Subversion Repositories bacoAlunos

Rev

Rev 1312 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1312 jmachado 1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:cmPort="http://www.cm-portalegre.pt/projectos/" version="1.0" xmlns:saxon="http://saxon.sf.net/" extension-element-prefixes="saxon" xmlns:d="http://www.estgp.pt/baco/directory/" xmlns:foo="foo"   xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
3
                xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
4
    <xsl:import href="utils.xsl"/>
5
    <xsl:output method="html" encoding="UTF-8" omit-xml-declaration="yes" />
6
 
7
    <xsl:param name="language"></xsl:param>
8
    <xsl:param name="slideMenu">false</xsl:param>
9
    <xsl:param name="contextPath">/baco</xsl:param>
10
    <xsl:param name="username">jmachado</xsl:param>
11
    <xsl:param name="name">Jorge Machado</xsl:param>
12
    <xsl:param name="roles">professor,administrador</xsl:param>
13
    <!--<xsl:param name="ACTUAL">pagina_a1.2.1</xsl:param>-->
14
    <!--<xsl:param name="ACTUAL">ficha_trabalhoIncluido</xsl:param>-->
15
    <xsl:param name="ACTUAL">ionline</xsl:param>
16
    <xsl:param name="ACTUAL_REMOTE_CHILD">FTP_3_Trabalhos</xsl:param>
17
    <xsl:param name="includeXML">oai_dc.xml</xsl:param>
18
 
19
    <xsl:template match="/">
20
        <div>
21
            <xsl:apply-templates select="//*[@id=$ACTUAL]" mode="root"/>
22
        </div>
23
 
24
    </xsl:template>
25
 
26
    <xsl:template match="cmPort:dadosProjecto">
27
        <table>
28
            <tr>
29
                <th colspan="2">Dados de Projecto</th>
30
            </tr>
31
            <tr>
32
                <th>Nome</th>
33
                <td><xsl:value-of select="./cmPort:nome/text()"/></td>
34
            </tr>
35
            <tr>
36
                <th>Data</th>
37
                <td><xsl:value-of select="./cmPort:data/text()"/></td>
38
            </tr>
39
            <tr>
40
                <th>Local</th>
41
                <td><xsl:value-of select="./cmPort:local/text()"/></td>
42
            </tr>
43
            <tr>
44
                <th>Equipa Técnica</th>
45
                <td><xsl:value-of select="./cmPort:equipaTecnica/text()"/></td>
46
            </tr>
47
            <xsl:if test="./cmPort:parecer/text()">
48
                <tr>
49
                    <th>Parecer</th>
50
                    <td><xsl:value-of select="./cmPort:parecer/text()"/></td>
51
                </tr>
52
            </xsl:if>
53
        </table>
54
 
55
    </xsl:template>
56
 
57
    <xsl:template match="/" mode="single">
58
        <html>
59
            <head>
60
                <title>O meu Directório ESTG</title>
61
                <style type="text/css">
62
                    body
63
                    {
64
                    color: black;
65
                    border: 0;
66
                    padding: 0;
67
                    margin-left: auto;
68
                    margin-right: auto;
69
                    margin-top: 0;
70
                    font-family:  sans-serif;
71
                    font-size: 0.7em;
72
                    }
73
                    ul
74
                    {
75
                    margin:0;
76
                    }
77
                    #header, #header td, #header td a
78
                    {
79
                    padding-left:10px;
80
                    background-color:#396F9D;
81
                    color:white;
82
                    }
83
 
84
                    #bigTable
85
                    {
86
                    width:100%;
87
                    }
88
 
89
                    #latNavContainer
90
                    {
91
                    width:160px;
92
                    vertical-align:top;
93
                    }
94
 
95
                    #footer
96
                    {
97
                    border-top: 1px solid black;
98
                    text-align:center;
99
                    }
100
 
101
                    #latNav
102
                    {
103
                    padding-left:10px;
104
                    background-color:lightgreen;
105
                    }
106
 
107
                    #latNav h2
108
                    {
109
                    font-family:  sans-serif;
110
                    font-size: 0.7em;
111
                    background-color: blue;
112
                    color:yellow;
113
                    margin-bottom:0;
114
                    }
115
 
116
                    #latNav ul
117
                    {
118
                    list-style:none;
119
                    padding-left: 15px;
120
                    margin-left:0;
121
 
122
                    }
123
                    #latNav li
124
                    {
125
                    font-size: 0.7em;
126
                    white-space:nowrap;
127
                    }
128
                    #latNav li .selected
129
                    {
130
                    background-color:green;
131
                    }
132
 
133
                    #topnav
134
                    {
135
                    padding-left:10px;
136
                    background-color:yellow;
137
                    }
138
                    #content
139
                    {
140
                    padding:4px;
141
                    border: 1px solid black;
142
                    }
143
 
144
                    <!--Blocos do conteudo dos directorios-->
145
                    .block
146
                    {
147
                    margin-bottom:10px;
148
                    border-left: 1px solid #8EC73F;
149
                    }
150
 
151
                    .block .head
152
                    {
153
                    font-style:italic;
154
                    }
155
 
156
                    .block
157
                    {
158
                    font-family:  sans-serif;
159
                    font-size: 0.7em;
160
                    }
161
                    .block ul li p
162
                    {
163
                    background-color:transparent;
164
                    font-style:italic;
165
                    }
166
                    .block ul li ul li
167
                    {
168
                    padding-left: 0;
169
                    }
170
 
171
                    .block p, .navLeftMenu h2 {
172
                    background-color: #8EC73F;
173
                    padding-left: 0;
174
                    margin: 0;
175
 
176
                    }
177
                    .block ul
178
                    {
179
                    list-style:none;
180
                    padding-left: 5px;
181
                    margin-left:0;
182
                    }
183
                    .block ul li{
184
                    padding-top:3px;
185
                    padding-left:0;
186
                    margin-left:0;
187
                    }
188
                    .block a {
189
                    color: #4d4d4d;
190
                    text-decoration: none;
191
                    }
192
                    .block a:visited {
193
                    /*color: #4d4d4d;*/
194
                    text-decoration: none;
195
                    }
196
                    .block a:hover, .linkUnderlineGrayToGreen a:hover {
197
                    color: #8EC73F;
198
                    text-decoration: underline;
199
                    }
200
                    .links p
201
                    {
202
                    background-color:yellow;
203
                    }
204
                    .links .block
205
                    {
206
                    border-left: 1px solid yellow;
207
                    }
208
                    .columnTable
209
                    {
210
                    width:100%;
211
                    }
212
                    .columnTable td
213
                    {
214
                    margin-left: 10px;
215
                    }
216
                    td.column {
217
                    vertical-align: top;
218
                    }
219
 
220
                </style>
221
            </head>
222
            <body>
223
                <xsl:call-template name="header"/>
224
 
225
                <xsl:apply-templates select="//*[@id=$ACTUAL]" mode="root"/>
226
 
227
                <xsl:call-template name="footer"/>
228
            </body>
229
        </html>
230
    </xsl:template>
231
 
232
    <xsl:template name="header">
233
        <div id="header">
234
            <h1>Bem vindos ao meu directorio</h1>
235
            Está autenticado como <xsl:value-of select="$name"/> com os papeis: <xsl:value-of select="$roles"/>
236
        </div>
237
    </xsl:template>
238
    <xsl:template name="footer">
239
        <div id="footer">
240
            Sistema de Directorios da <a href="http://www.estgp.pt">ESTG</a> 2008
241
        </div>
242
    </xsl:template>
243
    <!--
244
        ===========================================================
245
        |       Página de Apresentação de um Nó no Corpo da Página
246
        ===========================================================
247
    -->
248
    <xsl:template match="d:directory" mode="root">
249
        <xsl:apply-templates select="." mode="topNav"/>
250
        <xsl:apply-templates select="." mode="childs"/>
251
    </xsl:template>
252
 
253
    <xsl:template match="d:leaf[@node='true']" mode="root">
254
        <xsl:apply-templates select="." mode="topNav"/>
255
        <table cellpadding="0" cellspacing="0" width="100%" border="0">
256
            <tr>
257
                <td id="leftPage">
258
                    <xsl:apply-templates select=".." mode="latNav"/>
259
                </td>
260
                <td class="contentPortal">
261
                    <div class="portal">
262
                        <xsl:apply-templates select="." mode="childs"/>
263
                    </div>
264
                </td>
265
            </tr>
266
        </table>
267
    </xsl:template>
268
 
269
    <xsl:template match="d:directory" mode="childs">
270
 
271
        <div class="row">
272
            <xsl:for-each select="d:leaf">
273
                <div class="col-xs-12 col-sm-6 col-md-3 col-lg-2">
274
 
275
                    <div class="list-group">
276
                        <div class="list-group-item list-group-item-heading">
277
                            <!--<xsl:apply-templates select="." mode="link"/>-->
278
                            <xsl:apply-templates select="." mode="label"/>
279
                        </div>
280
 
281
                        <xsl:for-each select="d:leaf[@node='false']">
282
                            <div class="list-group-item">
283
                                <xsl:apply-templates select="." mode="link"/>
284
                            </div>
285
                        </xsl:for-each>
286
                    </div>
287
 
288
                </div>
289
            </xsl:for-each>
290
        </div>
291
    </xsl:template>
292
 
293
    <xsl:template match="d:leaf[@node='true']" mode="childs">
294
        <table class="columnTable">
295
            <tr>
296
                <td class="column">
297
                    <xsl:if test="d:leaf[@node='false']">
298
                        <div class="block links">
299
                            <p><xsl:call-template name="leafsBlockLabel"/></p>
300
                            <ul>
301
                                <xsl:for-each select="d:leaf[@node='false']">
302
                                    <li>
303
                                        <xsl:apply-templates select="." mode="link"/>
304
                                    </li>
305
                                </xsl:for-each>
306
                            </ul>
307
                        </div>
308
                    </xsl:if>
309
                </td>
310
                <xsl:if test="d:leaf[@node='true']">
311
                    <xsl:choose>
312
                        <xsl:when test="d:groupsDeclaration/d:group/d:name">
313
                            <xsl:for-each select="d:groupsDeclaration/d:group/d:name">
314
                                <tr>
315
                                    <xsl:variable name="group" select="."/>
316
                                    <xsl:for-each select="../../../d:leaf[@node='true' and @group=$group]">
317
                                        <td class="column">
318
                                            <xsl:apply-templates select="." mode="block"/>
319
                                        </td>
320
                                    </xsl:for-each>
321
                                </tr>
322
                            </xsl:for-each>
323
                        </xsl:when>
324
                        <xsl:otherwise>
325
                            <xsl:for-each select="d:leaf[@node='true']">
326
                                <td class="column">
327
                                    <xsl:apply-templates select="." mode="block"/>
328
                                </td>
329
                            </xsl:for-each>
330
                        </xsl:otherwise>
331
                    </xsl:choose>
332
                </xsl:if>
333
            </tr>
334
        </table>
335
    </xsl:template>
336
 
337
    <xsl:template match="d:leaf[@node='true']" mode="block">
338
        <div class="block">
339
            <p><xsl:apply-templates select="." mode="link"/></p>
340
            <ul>
341
                <xsl:for-each select="d:leaf[@node='false']">
342
                    <li>
343
                        <xsl:apply-templates select="." mode="link"/>
344
                    </li>
345
                </xsl:for-each>
346
                <xsl:for-each select="d:leaf[@node='true']">
347
                    <li>
348
                        <xsl:apply-templates select="." mode="link"/>
349
                    </li>
350
                </xsl:for-each>
351
            </ul>
352
        </div>
353
    </xsl:template>
354
    <!--
355
        ===========================================================
356
        |       Página de Apresentação de uma Folha no Corpo da Página
357
        ===========================================================
358
    -->
359
    <xsl:template match="d:leaf[@node='false']" mode="root">
360
        <xsl:apply-templates select="." mode="topNav"/>
361
        <table id="bigTable" cellspacing="0" cellpadding="0">
362
            <tr>
363
                <td id="leftPage">
364
                    <xsl:apply-templates select=".." mode="latNav"/>
365
                </td>
366
                <td class="contentPortal">
367
                    <xsl:choose>
368
                        <xsl:when test="not(@remoteExtensionRoot='true') and not(./d:*[@ftpDirectory])">
369
                            <xsl:apply-templates select="." mode="bodyContent"/>
370
                        </xsl:when>
371
                        <xsl:otherwise>
372
                            <xsl:choose>
373
                                <xsl:when test="//*[@id=$ACTUAL_REMOTE_CHILD]">
374
                                    <xsl:apply-templates select="//*[@id=$ACTUAL_REMOTE_CHILD]" mode="remoteChildsContent"/>
375
                                </xsl:when>
376
                                <xsl:otherwise>
377
                                    <xsl:apply-templates select="." mode="remoteChildsContent"/>
378
                                </xsl:otherwise>
379
                            </xsl:choose>
380
                        </xsl:otherwise>
381
                    </xsl:choose>
382
                </td>
383
            </tr>
384
        </table>
385
    </xsl:template>
386
 
387
 
388
    <xsl:template match="d:*" mode="remoteChildsContent">
389
        <xsl:apply-templates select="." mode="topNavRemote"/>
390
        <div class="files">
391
            <table cellpadding="0" cellspacing="0">
392
                <tr>
393
                    <th>
394
                        Nome do ficheiro/pasta
395
                    </th>
396
                    <th>
397
                        Data de Modificação
398
                    </th>
399
                    <th>
400
                        Tamanho
401
                    </th>
402
                </tr>
403
                <xsl:apply-templates select="./d:leaf[@node='false' and @ftpDirectory='true']" mode="ftpLine"/>
404
                <xsl:apply-templates select="./d:leaf[@node='false' and @ftpDirectory='false']" mode="ftpLine"/>
405
            </table>
406
        </div>
407
    </xsl:template>
408
    <xsl:template match="d:leaf[@node='false']" mode="ftpLine">
409
        <xsl:choose>
410
            <xsl:when test="./@ftpDirectory='true'">
411
                <tr class="dir">
412
                    <td colspan="3" >
1371 jmachado 413
                        <!--<img>
1312 jmachado 414
                            <xsl:attribute name="src"><xsl:value-of select="$contextPath"/>/imgs/folder.gif</xsl:attribute>
1371 jmachado 415
                        </img>-->
416
                        <span class="glyphicon glyphicon-folder-open"> </span>
1312 jmachado 417
                        <xsl:text> </xsl:text>
418
                        <xsl:apply-templates select="." mode="link"/>
419
                    </td>
420
                </tr>
421
            </xsl:when>
422
            <xsl:otherwise>
423
                <tr class="file">
424
                    <td>
425
                        <xsl:apply-templates select="." mode="mime"/><xsl:text> </xsl:text>
426
                        <xsl:apply-templates select="." mode="link"/>
427
                    </td>
428
                    <td>
429
                        <xsl:value-of select="./@lastModification"/>
430
                    </td>
431
                    <td>
432
                        <xsl:value-of select="./@size"/>
433
                    </td>
434
                </tr>
435
            </xsl:otherwise>
436
        </xsl:choose>
437
    </xsl:template>
438
    <xsl:template match="d:leaf[@node='false']" mode="mime">
439
        <img>
440
            <xsl:attribute name="alt"><xsl:value-of select="."/></xsl:attribute>
441
            <xsl:attribute name="src">
442
                <xsl:choose>
443
                    <xsl:when test="contains(@extension, 'rtf')"><xsl:value-of select="$contextPath"/>/imgs/mime/doc.gif</xsl:when>
444
                    <xsl:when test="contains(@extension, 'doc')"><xsl:value-of select="$contextPath"/>/imgs/mime/doc.gif</xsl:when>
445
                    <xsl:when test="contains(@extension, 'docx')"><xsl:value-of select="$contextPath"/>/imgs/mime/doc.gif</xsl:when>
446
                    <xsl:when test="contains(@extension, 'pdf')"><xsl:value-of select="$contextPath"/>/imgs/mime/pdf.gif</xsl:when>
447
                    <xsl:when test="contains(@extension, 'ppt')"><xsl:value-of select="$contextPath"/>/imgs/mime/ppt.gif</xsl:when>
448
                    <xsl:when test="contains(@extension, 'zip')"><xsl:value-of select="$contextPath"/>/imgs/mime/zip.gif</xsl:when>
449
                    <xsl:when test="contains(@extension, 'gz')"><xsl:value-of select="$contextPath"/>/imgs/mime/zip.gif</xsl:when>
450
                    <xsl:when test="contains(@extension, 'tgz')"><xsl:value-of select="$contextPath"/>/imgs/mime/zip.gif</xsl:when>
451
                    <xsl:when test="contains(@extension, 'rar')"><xsl:value-of select="$contextPath"/>/imgs/mime/rar.gif</xsl:when>
452
                    <xsl:when test="contains(@extension, 'html')"><xsl:value-of select="$contextPath"/>/imgs/mime/html.gif</xsl:when>
453
                    <xsl:when test="contains(@extension, 'html')"><xsl:value-of select="$contextPath"/>/imgs/mime/html.gif</xsl:when>
454
                    <xsl:when test="contains(@extension, 'xls')"><xsl:value-of select="$contextPath"/>/imgs/mime/xls.gif</xsl:when>
455
                    <xsl:when test="contains(@extension, 'xlsx')"><xsl:value-of select="$contextPath"/>/imgs/mime/xls.gif</xsl:when>
456
                    <xsl:when test="contains(@extension, 'txt')"><xsl:value-of select="$contextPath"/>/imgs/mime/txt.gif</xsl:when>
457
                    <xsl:otherwise><xsl:value-of select="$contextPath"/>/imgs/mime/unknown.gif</xsl:otherwise>
458
                </xsl:choose>
459
            </xsl:attribute>
460
        </img>
461
    </xsl:template>
462
    <!--<xsl:function name="d:parse" as="document-node()">
463
         <xsl:param name="s" as="xs:string"/>
464
        <xsl:sequence  select="doc(concat('data:text/xml','&lt;ola&gt;teste&lt;/ola&gt;'))"/>
465
 
466
         --><!--<xsl:sequence  select="doc(concat('data:text/xml',$s))"/> --><!--
467
     </xsl:function>-->
468
 
469
 
470
    <!--
471
        ===========================================================
472
        |       Barra de Navegação Superior
473
        ===========================================================
474
    -->
475
 
476
 
477
    <xsl:template match="d:leaf[@node='false']" mode="topNav">
478
        <div id="topnav">
479
            <ul>
480
                <xsl:apply-templates select=".." mode="navBack"/>
481
                <li class="navPlace">
482
                    <xsl:apply-templates select="." mode="label"/>
483
                </li>
484
            </ul>
485
        </div>
486
    </xsl:template>
487
 
488
    <xsl:template match="d:leaf[@node='true']" mode="topNav">
489
        <div id="topnav">
490
            <ul>
491
                <xsl:apply-templates select=".." mode="navBack"/>
492
                <li class="navPlace">
493
                    <xsl:apply-templates select="." mode="label"/>
494
                </li>
495
            </ul>
496
        </div>
497
    </xsl:template>
498
 
499
    <xsl:template match="d:directory" mode="topNav">
500
        <!--O Baco faz isto por nós para que a barra superior fique alinhada correctamente-->
501
        <!--<div id="topnav">
502
            <ul>
503
                <li class="navPlace">
504
                    <xsl:call-template name="homeLink"/>
505
                </li>
506
                <li class="navPlace">
507
                    &gt;
508
                    <xsl:apply-templates select="." mode="label"/>
509
                </li>
510
            </ul>
511
        </div>-->
512
    </xsl:template>
513
 
514
    <xsl:template match="d:leaf[@node='false']" mode="topNavRemote">
515
        <div id="topnav">
516
            <ul>
517
                <li class="navPlace">
518
                    <xsl:value-of select="@label"/>
519
                </li>
520
            </ul>
521
        </div>
522
    </xsl:template>
523
 
524
    <xsl:template match="d:leaf[@node='true']" mode="topNavRemote">
525
        <div id="topnav">
526
            <ul>
527
                <xsl:apply-templates select=".." mode="navBackRemote"/>
528
                <li class="navPlace">
529
                    <xsl:apply-templates select="." mode="label"/>
530
                </li>
531
            </ul>
532
        </div>
533
    </xsl:template>
534
 
535
 
536
    <xsl:template match="d:directory" mode="navBack">
537
        <li class="navPlace">
538
            <xsl:call-template name="homeLink"/>
539
            <span class="glyphicon glyphicon-menu-right"/>
540
        </li>
541
        <li class="navPlace">
542
            <xsl:apply-templates select="." mode="link"/>
543
            <span class="glyphicon glyphicon-menu-right"/>
544
        </li>
545
    </xsl:template>
546
 
547
    <xsl:template match="d:leaf[@node='true']" mode="navBack">
548
        <xsl:apply-templates select=".." mode="navBack"/>
549
 
550
        <li class="navPlace">
551
            <xsl:apply-templates select="." mode="link"/>
552
 
553
            <span class="glyphicon glyphicon-menu-right"/>
554
        </li>
555
    </xsl:template>
556
 
557
    <xsl:template match="d:leaf[@node='false']" mode="navBack">
558
        <xsl:apply-templates select=".." mode="navBack"/>
559
 
560
        <li class="navPlace">
561
            <xsl:apply-templates select="." mode="link"/>
562
 
563
            <span class="glyphicon glyphicon-menu-right"/>
564
        </li>
565
    </xsl:template>
566
 
567
    <xsl:template match="d:leaf[@node='false']" mode="navBackRemote">
568
        <li class="navPlace">
569
            <xsl:apply-templates select="." mode="link"/>
570
        </li>
571
    </xsl:template>
572
    <xsl:template match="d:leaf[@node='true']" mode="navBackRemote">
573
        <xsl:apply-templates select=".." mode="navBackRemote"/>
574
        <li class="navPlace">
575
            <xsl:apply-templates select="." mode="link"/>
576
 
577
            <span class="glyphicon glyphicon-menu-right"/>
578
        </li>
579
    </xsl:template>
580
 
581
    <!--
582
        ===========================================================
583
        |       Barra de Navegação Lateral Esquerda
584
        ===========================================================
585
    -->
586
    <xsl:template match="d:leaf[@node='true']" mode="latNav">
587
        <!--<xsl:if test="./d:leaf or ./d:node">-->
588
 
589
        <div class="linkMenuBlock">
590
            <div class="linkMenuBlockTitle"><xsl:apply-templates select="." mode="label"/></div>
591
            <div class="linkLeftMenu">
592
                <div class="listClean">
593
                    <ul id="portalMenu">
594
                        <xsl:for-each select="./d:leaf[@node='true']">
595
                            <xsl:choose>
596
                                <xsl:when test="@id = $ACTUAL">
597
                                    <li class="navPlace selected">
598
                                        <xsl:apply-templates select="." mode="label"/>
599
                                    </li>
600
                                </xsl:when>
601
                                <xsl:otherwise>
602
                                    <li class="navPlace">
603
                                        <xsl:apply-templates select="." mode="link"/>
604
                                    </li>
605
                                </xsl:otherwise>
606
                            </xsl:choose>
607
                        </xsl:for-each>
608
                        <xsl:for-each select="./d:leaf[@node='false']">
609
                            <li class="navPlace"><xsl:apply-templates select="." mode="link"/></li>
610
                        </xsl:for-each>
611
                    </ul>
612
                </div>
613
            </div>
614
        </div>
615
        <!--</xsl:if>-->
616
    </xsl:template>
617
 
618
    <xsl:template match="d:leaf[@node='false']" mode="latNav">
619
        <!--<xsl:if test="./d:leaf or ./d:node">-->
620
        <div class="linkMenuBlock">
621
            <div class="linkMenuBlockTitle"><xsl:apply-templates select="." mode="label"/></div>
622
            <div class="linkLeftMenu">
623
                <div class="listClean">
624
                    <ul id="portalMenu">
625
                        <xsl:for-each select="./d:leaf[@node='true']">
626
                            <xsl:choose>
627
                                <xsl:when test="@id = $ACTUAL">
628
                                    <li class="navPlace selected">
629
                                        <xsl:apply-templates select="." mode="label"/>
630
                                    </li>
631
                                </xsl:when>
632
                                <xsl:otherwise>
633
                                    <li class="navPlace">
634
                                        <xsl:apply-templates select="." mode="link"/>
635
                                    </li>
636
                                </xsl:otherwise>
637
                            </xsl:choose>
638
                        </xsl:for-each>
639
                        <xsl:for-each select="./d:leaf[@node='false']">
640
                            <li class="navPlace"><xsl:apply-templates select="." mode="link"/></li>
641
                        </xsl:for-each>
642
                    </ul>
643
                </div>
644
            </div>
645
        </div>
646
        <!--</xsl:if>-->
647
    </xsl:template>
648
 
649
    <xsl:template match="d:directory" mode="latNav">
650
        <!--<xsl:if test="./d:leaf or ./d:node">-->
651
        <div class="linkMenuBlock">
652
            <div class="linkMenuBlockTitle"><xsl:apply-templates select="." mode="label"/></div>
653
            <div class="linkLeftMenu">
654
                <div class="listClean">
655
                    <ul id="portalMenu">
656
                        <xsl:for-each select="./d:leaf[@node='true']">
657
                            <xsl:choose>
658
                                <xsl:when test="@id = $ACTUAL">
659
                                    <li class="navPlace selected">
660
                                        <xsl:apply-templates select="." mode="label"/>
661
                                    </li>
662
                                </xsl:when>
663
                                <xsl:otherwise>
664
                                    <li class="navPlace">
665
                                        <xsl:apply-templates select="." mode="link"/>
666
                                    </li>
667
                                </xsl:otherwise>
668
                            </xsl:choose>
669
                        </xsl:for-each>
670
                        <xsl:for-each select="./d:leaf[@node='false']">
671
                            <li class="navPlace"><xsl:call-template name="linkPrefix"/><xsl:apply-templates select="." mode="link"/></li>
672
                        </xsl:for-each>
673
                    </ul>
674
                </div>
675
            </div>
676
        </div>
677
        <!--</xsl:if>-->
678
    </xsl:template>
679
 
680
    <xsl:template name="linkPrefix">
681
 
682
    </xsl:template>
683
    <!--
684
        ===========================================================
685
        |       Apresentar Todo o Directorio em árvore - NAO ESTA EM USO DE MOMENTO
686
        ===========================================================
687
    -->
688
 
689
    <xsl:template name="treeRoot">
690
        <xsl:if test="/d:directory/d:leaf[@node='true']">
691
            <ul>
692
                <xsl:for-each select="/d:directory/d:leaf[@node='true']">
693
                    <li>
694
                        <xsl:apply-templates select="." mode="treeLoop"/>
695
                    </li>
696
                </xsl:for-each>
697
            </ul>
698
        </xsl:if>
699
    </xsl:template>
700
 
701
    <xsl:template match="d:leaf[@node='true']" mode="treeLoop">
702
        <div>
703
            <xsl:if test="$ACTUAL=@id">
704
                <xsl:attribute name="style">background-color:yellow</xsl:attribute>
705
            </xsl:if>
706
            <p><xsl:value-of select="@label"/></p>
707
            <xsl:if test="./d:leaf[@node='false']">
708
                <xsl:for-each select="./d:leaf[@node='false']">
709
                    <xsl:apply-templates select="." mode="tree"/>
710
                </xsl:for-each>
711
            </xsl:if>
712
            <xsl:if test="./d:leaf[@node='true']">
713
                <ul>
714
                    <xsl:for-each select="./d:leaf[@node='true']">
715
                        <li>
716
                            <xsl:apply-templates select="." mode="treeLoop"/>
717
                        </li>
718
                    </xsl:for-each>
719
                </ul>
720
            </xsl:if>
721
        </div>
722
    </xsl:template>
723
 
724
    <xsl:template match="d:leaf[@node='false']" mode="tree">
725
        <div>
726
            <xsl:if test="$ACTUAL=@id">
727
                <xsl:attribute name="style">background-color:yellow</xsl:attribute>
728
            </xsl:if>
729
            <p><xsl:apply-templates mode="label"/></p>
730
        </div>
731
    </xsl:template>
732
 
733
 
734
    <!--
735
        ===========================================================
736
        |       TEMPLATES DE OUTROS ESQUEMAS
737
        ===========================================================
738
    -->
739
    <!-- Foo Templates -->
740
    <xsl:template match="foo:record">
741
        <p>titulo:<xsl:value-of select="foo:title"/></p>
742
        <p>texto:<xsl:value-of select="foo:text"/></p>
743
    </xsl:template>
744
 
745
 
746
    <!--OAIDC Templates-->
747
 
748
    <xsl:template match="oai_dc:dc">
749
        <table>
750
            <tr>
751
                <th colspan="2">Registo Bibliografico</th>
752
            </tr>
753
            <xsl:apply-templates select="./dc:*"/>
754
        </table>
755
    </xsl:template>
756
 
757
    <xsl:template match="dc:*">
758
        <tr>
759
            <th><xsl:value-of select="local-name(.)"/></th>
760
            <td><xsl:value-of select="./text()"/></td>
761
        </tr>
762
    </xsl:template>
763
 
764
 
765
</xsl:stylesheet>