source: documentation/trunk/tutorial_sample_files/interfaces/aybara/header.xsl@ 28556

Last change on this file since 28556 was 28556, checked in by jlwhisler, 8 years ago

Changed XSL so it only contains the create-html-header template for simplicity (and to match the tutorial).

File size: 4.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util gsf">
10
11 <!-- Creates a header for the html page -->
12 <xsl:template name="create-html-header">
13 <base>
14 <xsl:attribute name="href">
15 <xsl:choose>
16 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'siteURL']">
17 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'siteURL']"/>
18 </xsl:when>
19 <xsl:when test="/page/pageRequest/@baseURL">
20 <xsl:value-of select="/page/pageRequest/@baseURL"/>
21 </xsl:when>
22 </xsl:choose>
23 </xsl:attribute>
24 </base>
25 <xsl:comment>[if lte IE 6]&gt;&lt;/base&gt;&lt;![endif]</xsl:comment>
26
27 <title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
28
29 <xsl:if test="/page/pageRequest/@action ='d'">
30
31 <xsl:variable name="myMetadataHeader" select="/page/pageResponse/format/gsf:headMetaTags/gsf:metadata"/>
32 <xsl:for-each select="$myMetadataHeader">
33 <xsl:variable name="metaname" select="@name"/>
34
35 <xsl:variable name="metavals"
36 select="/page/pageResponse/document/metadataList/metadata[@name = $metaname]|/page/pageResponse/document/documentNode/metadataList/metadata[@name = $metaname]"/>
37 <xsl:for-each select="$metavals">
38 <META NAME="{$metaname}" CONTENT="{.}"/>
39 </xsl:for-each>
40 </xsl:for-each>
41
42 </xsl:if>
43
44 <xsl:choose>
45 <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value">
46 <!-- Get the theme from the interfaceConfig.xml file -->
47 <link rel="stylesheet" href="{/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value}" type="text/css"/>
48 </xsl:when>
49 <xsl:otherwise>
50 <link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui-1.8.16.custom.css" type="text/css"/>
51 </xsl:otherwise>
52 </xsl:choose>
53 <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
54 <link rel="shortcut icon" href="interfaces/{$interface_name}/images/favicon.ico"/>
55
56 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.min.js"><xsl:text> </xsl:text></script>
57 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery-ui-1.10.2.custom/js/jquery-ui-1.10.2.custom.min.js"><xsl:text> </xsl:text></script>
58 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.themeswitcher.min.js"><xsl:text> </xsl:text></script>
59 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.blockUI.js"><xsl:text> </xsl:text></script>
60 <script type="text/javascript" src="interfaces/{$interface_name}/js/ace/ace.js"><xsl:text> </xsl:text></script>
61
62 <script type="text/javascript" src="interfaces/{$interface_name}/js/zoomer.js"><xsl:text> </xsl:text></script>
63
64 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
65 <xsl:call-template name="map-scripts"/>
66 </xsl:if>
67
68 <xsl:if test="/page/pageResponse/format/gsf:option[@name='mapEnabledOpenLayers']/@value = 'true'">
69 <xsl:call-template name="openlayers-map-scripts"/>
70 </xsl:if>
71
72
73 <xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
74 <xsl:call-template name="panoramaViewer-scripts"/>
75 </xsl:if>
76
77 <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
78 <xsl:if test="/page/pageRequest/paramList/param[(@name='docEdit') and (@value='on' or @value='true' or @value='1')]">
79 <script type="text/javascript" src="interfaces/{$interface_name}/js/direct-edit.js"><xsl:text> </xsl:text></script>
80 <xsl:call-template name="init-direct-edit"/>
81 </xsl:if>
82 <script type="text/javascript" src="interfaces/{$interface_name}/js/debug_scripts.js"><xsl:text> </xsl:text></script>
83 <script type="text/javascript" src="interfaces/{$interface_name}/js/visual-xml-editor.js"><xsl:text> </xsl:text></script>
84 </xsl:if>
85
86 <xsl:call-template name="setup-gs-variable"/>
87 <xsl:call-template name="define-js-macro-variables"/>
88
89 <xsl:call-template name="additionalHeaderContent"/>
90 </xsl:template>
91
92</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.