source: main/trunk/model-sites-dev/twso/collect/twso/transform/layouts/main.xsl@ 34223

Last change on this file since 34223 was 34223, checked in by kjdon, 4 years ago

the site skeleton plus some files

File size: 5.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
5 xmlns:java="http://xml.apache.org/xslt/java"
6 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
7 xmlns:gslib="http://www.greenstone.org/skinning"
8 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
9
10 xmlns:lxslt="http://xml.apache.org/xslt"
11 xmlns:result="http://www.example.com/results"
12 xmlns:exsl="http://exslt.org/common"
13
14 extension-element-prefixes="java util result exsl"
15 exclude-result-prefixes="util java util">
16
17 <xsl:import href="header.xsl"/>
18 <xsl:include href="formatmanager.xsl"/>
19
20
21 <!-- put the URL or path of your site here site -->
22 <!-- eg 'http://www.example.com/mysite' or '/mysite' -->
23 <!--<xsl:template name="siteURL"><xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteURL']"/></xsl:template>-->
24 <xsl:template name="siteURL"><xsl:text></xsl:text></xsl:template>
25
26 <!-- the output format for this layout is html -->
27 <!-- <xsl:output method="xml" version="1.0" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" indent="yes" omit-xml-declaration="yes"/> -->
28 <xsl:output method="html" omit-xml-declaration="yes"/>
29
30 <xsl:template match="/">
31 <xsl:call-template name="mainTemplate"/>
32 </xsl:template>
33
34
35 <!-- the main layout is defined here -->
36 <xsl:template name="mainTemplate">
37
38 <html>
39
40 <head>
41 <!-- ***** in header.xsl ***** -->
42 <xsl:call-template name="create-html-header"/>
43 <xsl:call-template name="berryBasketHeadTags"/>
44
45 </head>
46
47 <body><xsl:call-template name="textDirectionAttribute"/><xsl:call-template name="actionClass"/>
48
49 <xsl:call-template name="displayErrorsIfAny"/>
50 <a name="top"><xsl:text> </xsl:text></a>
51
52 <!--<div id="topArea" class="ui-state-default ui-corner-top">
53 <table>
54 <tbody>
55 <tr>
56 <td><div id="breadcrumbs"><xsl:call-template name="breadcrumbs"/><xsl:text> </xsl:text></div></td>
57
58 ***** in header.xsl *****
59 <td><xsl:call-template name="home-help-preferences"/></td>
60 </tr>
61 </tbody>
62 </table>
63 </div>-->
64 <noscript><div id="javascriptoff"><img id="warning" src="sites/$site_name/collect/twso/images/warning.png"/></div></noscript>
65
66 <div id="container" class="ui-corner-all">
67
68 <!-- ***** in header.xsl ***** -->
69 <xsl:call-template name="create-banner"/>
70 <xsl:if test="/page/pageRequest/paramList/param[(@name='formatedit') and (@value='on')]">
71 <xsl:call-template name="formatmanagerpre"/>
72 </xsl:if>
73
74 <div id="gs_content" class="ui-widget-content">
75 <!--
76 show the content of the page.
77 to customise this part, edit the xsl file for the page you want to edit
78 -->
79 <xsl:apply-templates select="/page"/>
80
81 </div>
82
83 <div id="gs_footer" class="ui-widget-header ui-corner-bottom">
84 <a href="http://www.greenstone.org"><xsl:call-template name="poweredByGS3TextBar"/></a>
85 </div>
86 <script type="text/javascript">
87 <xsl:text disable-output-escaping="yes">
88
89 var navbar = document.getElementById("gs-nav");
90 if(navbar != null){
91 var listItem = document.createElement('li');
92 listItem.setAttribute("class", "ui-state-default ui-corner-top");
93 var link = document.createElement('a');
94 link.href = gs.xsltParams.library_name +"/collection/twso/page/about"
95 //link.innerHTML="&lt;img src='sites/twso/collect/twso/images/home.png'/&gt;";
96 link.innerHTML = "home";
97 listItem.appendChild(link);
98 var first = navbar.firstChild;
99 navbar.insertBefore(listItem, first);
100
101 }
102
103 if(window != window.top){
104 console.log("we are in an iframe, need to do some mods");
105
106 var header = document.getElementsByTagName("head");
107 var css = document.createElement("link");
108 css.setAttribute("rel", "stylesheet");
109 css.setAttribute("href", "sites/twso/collect/twso/style/small.css");
110 if(header[0] != null){ header[0].appendChild(css); }
111
112 var classifiers = document.getElementById("results");
113 if(classifiers != null){
114 classifiers.style.width= "580px";
115 }
116
117 var banner = document.getElementById("titlearea");
118 if(banner != null){
119 banner.style.width = "0px";
120 banner.style.height = "0px";
121 banner.style.display = "none";
122 }
123 var collage = document.getElementById("collagewrapper");
124 if(collage != null){
125 collage.style.width = "580px";
126 collage.style.backgroundImage = "url('sites/twso/collect/twso/images/oldimagebackground2.png')";
127 collage.style.height = "482px";
128 }
129 var list_items = document.getElementsByClassName("ui-state-default ui-corner-top");
130 if(list_items.length > 0){
131 for(i = 0; i &lt; list_items.length; i++){
132 list_items[i].style.padding = "2px 5px 5px 2px";
133 list_items[i].style.height = "17px";
134 }
135 }
136 var classifier = document.getElementById("classifiernodelist");
137 if(classifier != null){
138 classifier.style.width = "570px";
139 }
140
141 var all_links = document.getElementsByTagName("a");
142 for(i = 0; i &lt; all_links.length; i++){
143 if(all_links[i] != null &amp;&amp; all_links[i].innerHTML == "powered by greenstone3"){
144 all_links[i].style.color = "#000";
145 }
146 }
147
148 var body = document.getElementsByTagName("body");
149 for(i = 0; i &lt; body.length; i++){
150 if(body[i] != null){
151 body[i].style.width = "580px";
152 body[i].style.backgroundImage = "none";
153 body[i].style.backgroundColor = "#FFF";
154 }
155 }
156
157
158 }
159 else {
160
161 console.log("iframe not detected. Mods not needed");
162 }
163 </xsl:text>
164 </script>
165 </div>
166 </body>
167 </html>
168 </xsl:template>
169</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.