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 | <xsl:template name="goto-sparql-button">
|
---|
12 |
|
---|
13 | <!-- sparql -->
|
---|
14 | <li>
|
---|
15 | <a href="{$library_name}/collection/{$collNameChecked}/page/sparql">
|
---|
16 | <xsl:attribute name="title">Sparql Interface page</xsl:attribute>
|
---|
17 | <span id="sparqlButton">Sparql</span>
|
---|
18 | <script type="text/javascript">
|
---|
19 | <xsl:text disable-output-escaping="yes">
|
---|
20 | $("#sparqlButton").button();
|
---|
21 | $("#sparqlButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
|
---|
22 | </xsl:text>
|
---|
23 | </script>
|
---|
24 | </a>
|
---|
25 | </li>
|
---|
26 |
|
---|
27 | </xsl:template>
|
---|
28 |
|
---|
29 | <xsl:template name="goto-comparison-button">
|
---|
30 |
|
---|
31 | <!-- comparison -->
|
---|
32 | <li>
|
---|
33 | <a href="{$library_name}/page/compare">
|
---|
34 | <xsl:attribute name="title">Collection Comparison page</xsl:attribute>
|
---|
35 | <span id="comparisonButton">Compare</span>
|
---|
36 | <script type="text/javascript">
|
---|
37 | <xsl:text disable-output-escaping="yes">
|
---|
38 | $("#comparisonButton").button();
|
---|
39 | $("#comparisonButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
|
---|
40 | </xsl:text>
|
---|
41 | </script>
|
---|
42 | </a>
|
---|
43 | </li>
|
---|
44 |
|
---|
45 | </xsl:template>
|
---|
46 |
|
---|
47 |
|
---|
48 | <!-- ***** HOME HELP PREFERENCES LOGIN ***** -->
|
---|
49 | <xsl:template name="home-help-preferences">
|
---|
50 | <ul id="bannerLinks">
|
---|
51 |
|
---|
52 | <!-- RSS feed link can appear in a global format statement (where it has no type attribute)
|
---|
53 | or in section specific format statements, such as browse, search, display.
|
---|
54 | If it's present in any format statement, display the RSS link in the bannerlinks section. -->
|
---|
55 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search' or not(@type)]/gsf:option[@name='RSS']/@value = 'true'">
|
---|
56 | <li><gsf:link type="rss"><gsf:icon file="rssicon.png"/></gsf:link></li>
|
---|
57 | </xsl:if>
|
---|
58 |
|
---|
59 | <!-- preferences -->
|
---|
60 | <li>
|
---|
61 | <a href="{$library_name}/collection/{$collNameChecked}/page/pref">
|
---|
62 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
|
---|
63 | <span id="preferencesButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></span>
|
---|
64 | <script type="text/javascript">
|
---|
65 | <xsl:text disable-output-escaping="yes">
|
---|
66 | $("#preferencesButton").button({icons:{primary:"ui-icon-wrench"}});
|
---|
67 | $("#preferencesButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
|
---|
68 | </xsl:text>
|
---|
69 | </script>
|
---|
70 | </a>
|
---|
71 | </li>
|
---|
72 |
|
---|
73 | <!-- help -->
|
---|
74 | <li>
|
---|
75 | <a href="{$library_name}/collection/{$collNameChecked}/page/help">
|
---|
76 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
|
---|
77 | <span id="helpButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></span>
|
---|
78 | <script type="text/javascript">
|
---|
79 | <xsl:text disable-output-escaping="yes">
|
---|
80 | $("#helpButton").button({icons:{primary:"ui-icon-help"}});
|
---|
81 | $("#helpButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
|
---|
82 | </xsl:text>
|
---|
83 | </script>
|
---|
84 | </a>
|
---|
85 | </li>
|
---|
86 |
|
---|
87 | <xsl:call-template name="goto-sparql-button"/>
|
---|
88 | <xsl:call-template name="goto-comparison-button"/>
|
---|
89 |
|
---|
90 |
|
---|
91 | <!-- login/logout -->
|
---|
92 | <li id="userMenuButton">
|
---|
93 | <xsl:choose>
|
---|
94 | <xsl:when test="/page/pageRequest/userInformation/@username">
|
---|
95 | <a>
|
---|
96 | <xsl:attribute name="href">javascript:toggleUserMenu();</xsl:attribute>
|
---|
97 | <script type="text/javascript">
|
---|
98 | <xsl:text disable-output-escaping="yes">
|
---|
99 | function toggleUserMenu()
|
---|
100 | {
|
---|
101 | var button = $("#userMenuButton");
|
---|
102 | var menu;
|
---|
103 |
|
---|
104 | if(button.data("userMenu"))
|
---|
105 | {
|
---|
106 | menu = button.data("userMenu");
|
---|
107 | if(menu.css("display") == "block")
|
---|
108 | {
|
---|
109 | menu.hide();
|
---|
110 | }
|
---|
111 | else
|
---|
112 | {
|
---|
113 | menu.show();
|
---|
114 | }
|
---|
115 | }
|
---|
116 | else
|
---|
117 | {
|
---|
118 | menu = $("<UL>")
|
---|
119 | .css("position", "absolute")
|
---|
120 | .css("display", "block")
|
---|
121 | .css("z-index", "100")
|
---|
122 | .css("list-style", "none outside none")
|
---|
123 | .css("margin", "0px")
|
---|
124 | .css("padding", "0px")
|
---|
125 | .css("font-size", "90%");
|
---|
126 |
|
---|
127 | menu.attr("id", "userMenu");
|
---|
128 |
|
---|
129 | button.data("userMenu", menu);
|
---|
130 |
|
---|
131 | var settingsLink = $("<a>")
|
---|
132 | .attr("href", gs.xsltParams.library_name + "/admin/AccountSettings?s1.username=</xsl:text><xsl:value-of select="/page/pageRequest/userInformation/@username"/><xsl:text disable-output-escaping="yes">");
|
---|
133 | var settingsButton = $("<LI>")
|
---|
134 | .css("padding", "3px")
|
---|
135 | .html("Account settings")
|
---|
136 | .addClass("ui-state-default");
|
---|
137 | settingsLink.append(settingsButton);
|
---|
138 |
|
---|
139 | var editingLink = $("<a>")
|
---|
140 | .attr("href", "javascript:;");
|
---|
141 | var editingButton = $("<LI>")
|
---|
142 | .css("padding", "3px")
|
---|
143 | .html((gs.userInformation.editEnabled == "true") ? "Disable edit mode" : "Enable edit mode")
|
---|
144 | .addClass("ui-state-default")
|
---|
145 | .click(function()
|
---|
146 | {
|
---|
147 | var url = gs.xsltParams.library_name + "?a=g&rt=ro&s=ChangeUserEditMode&s1.username=" + gs.userInformation.username + "&s1.enabled=" + ((gs.userInformation.editEnabled == "true") ? "false" : "true");
|
---|
148 | $.ajax(url)
|
---|
149 | .success(function(response)
|
---|
150 | {
|
---|
151 | location.reload();
|
---|
152 | });
|
---|
153 | });
|
---|
154 | editingLink.append(editingButton);
|
---|
155 |
|
---|
156 | var url = document.URL;
|
---|
157 | var hasQueryString = (url.indexOf("?") != -1);
|
---|
158 | var hashIndex = url.indexOf("#");
|
---|
159 |
|
---|
160 | var hashPart;
|
---|
161 | if(hashIndex != -1)
|
---|
162 | {
|
---|
163 | hashPart = url.substring(hashIndex);
|
---|
164 | url = url.substring(0, hashIndex);
|
---|
165 | }
|
---|
166 |
|
---|
167 | var logoutLink = $("<a>")
|
---|
168 | .attr("href", url + (hasQueryString ? "&" : "?") + "logout=" + (hashPart ? hashPart : ""));
|
---|
169 | var logoutButton = $("<LI>")
|
---|
170 | .css("padding", "3px")
|
---|
171 | .html("Logout")
|
---|
172 | .addClass("ui-state-default");
|
---|
173 | logoutLink.append(logoutButton);
|
---|
174 |
|
---|
175 | menu.append(settingsLink);
|
---|
176 | menu.append(editingLink);
|
---|
177 | menu.append(logoutLink);
|
---|
178 |
|
---|
179 | var buttonLeft = button.offset().left;
|
---|
180 | var buttonTop = button.offset().top;
|
---|
181 |
|
---|
182 | var buttonHeight = button.height();
|
---|
183 |
|
---|
184 | menu.offset({top: buttonTop + buttonHeight + 4, left: buttonLeft});
|
---|
185 | $("#topArea").append(menu);
|
---|
186 | }
|
---|
187 | }
|
---|
188 | </xsl:text>
|
---|
189 | </script>
|
---|
190 | <span id="loginButton"><xsl:value-of select="/page/pageRequest/userInformation/@username"/></span>
|
---|
191 | <script type="text/javascript">
|
---|
192 | <xsl:text disable-output-escaping="yes">
|
---|
193 | $("#loginButton").button({icons:{primary:"ui-icon-unlocked"}});
|
---|
194 | $("#loginButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
|
---|
195 | </xsl:text>
|
---|
196 | </script>
|
---|
197 | </a>
|
---|
198 | </xsl:when>
|
---|
199 | <xsl:otherwise>
|
---|
200 | <a>
|
---|
201 | <xsl:attribute name="href">
|
---|
202 | <xsl:value-of select="$library_name"/>
|
---|
203 | <xsl:text>?a=p&sa=login&redirectURL=</xsl:text>
|
---|
204 | <xsl:value-of select="$library_name"/>
|
---|
205 | <xsl:text>%3F</xsl:text>
|
---|
206 | <xsl:if test="/page/pageRequest/@action">
|
---|
207 | <xsl:text>a=</xsl:text>
|
---|
208 | <xsl:value-of select="/page/pageRequest/@action"/>
|
---|
209 | </xsl:if>
|
---|
210 | <xsl:if test="/page/pageRequest/@subaction">
|
---|
211 | <xsl:text>%26sa=</xsl:text>
|
---|
212 | <xsl:value-of select="/page/pageRequest/@subaction"/>
|
---|
213 | </xsl:if>
|
---|
214 | <xsl:for-each select="/page/pageRequest/paramList/param">
|
---|
215 | <xsl:if test="@name != 'password' and @name != 's1.password' and @name != 's1.newPassword' and @name != 's1.oldPassword'">
|
---|
216 | <xsl:text>%26</xsl:text>
|
---|
217 | <xsl:value-of select="@name"/>
|
---|
218 | <xsl:text>=</xsl:text>
|
---|
219 | <xsl:value-of select="@value"/>
|
---|
220 | </xsl:if>
|
---|
221 | </xsl:for-each>
|
---|
222 | </xsl:attribute>
|
---|
223 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/></xsl:attribute>
|
---|
224 | <span id="loginButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_b')"/></span>
|
---|
225 | <script type="text/javascript">
|
---|
226 | <xsl:text disable-output-escaping="yes">
|
---|
227 | $("#loginButton").button({icons:{primary:"ui-icon-locked"}});
|
---|
228 | $("#loginButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
|
---|
229 | </xsl:text>
|
---|
230 | </script>
|
---|
231 | </a>
|
---|
232 | </xsl:otherwise>
|
---|
233 | </xsl:choose>
|
---|
234 | </li>
|
---|
235 |
|
---|
236 | <!-- debuginfo (doesn't use class="ui-state-error" since the text is not legible due to inherited text-colour) -->
|
---|
237 | <xsl:if test="/page/pageRequest/paramList/param[(@name='debug') and (@value='on' or @value='true' or @value='1')]">
|
---|
238 | <li>
|
---|
239 | <a href="{$library_name}/collection/{$collNameChecked}/page/debug">
|
---|
240 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'debuginfo_tip')"/></xsl:attribute>
|
---|
241 | <span id="debugButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'debuginfo_b')"/></span>
|
---|
242 | <script type="text/javascript">
|
---|
243 | <xsl:text disable-output-escaping="yes">
|
---|
244 | $("#debugButton").button({icons:{primary:"ui-icon-info"}});
|
---|
245 | $("#debugButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
|
---|
246 | </xsl:text>
|
---|
247 | </script>
|
---|
248 | </a>
|
---|
249 | </li>
|
---|
250 | </xsl:if>
|
---|
251 | </ul>
|
---|
252 | </xsl:template>
|
---|
253 |
|
---|
254 | </xsl:stylesheet>
|
---|