[19856] | 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 | 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 | extension-element-prefixes="java util"
|
---|
| 8 | exclude-result-prefixes="java util">
|
---|
| 9 |
|
---|
[19988] | 10 | <!-- use the 'main' layout -->
|
---|
[19856] | 11 | <xsl:include href="layouts/main.xsl"/>
|
---|
| 12 |
|
---|
[19988] | 13 | <!-- set page title -->
|
---|
| 14 | <xsl:template name="pageTitle"><gslib:serviceName/></xsl:template>
|
---|
[19856] | 15 |
|
---|
[19988] | 16 | <!-- set page breadcrumbs -->
|
---|
| 17 | <xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/> <gslib:collectionNameLinked/><gslib:rightArrow/></xsl:template>
|
---|
| 18 |
|
---|
| 19 | <!-- the page content -->
|
---|
[19856] | 20 | <xsl:template match="/page/pageResponse">
|
---|
[24009] | 21 | <xsl:call-template name="classifierLoadScript"/>
|
---|
[19856] | 22 | <!-- this right sidebar -->
|
---|
[23813] | 23 | <xsl:if test="$berryBasketOn">
|
---|
| 24 | <div id="rightSidebar">
|
---|
| 25 | <!-- show the berry basket if it's turned on -->
|
---|
| 26 | <gslib:berryBasket/>
|
---|
| 27 | <xsl:text> </xsl:text>
|
---|
| 28 | </div>
|
---|
| 29 | </xsl:if>
|
---|
[19856] | 30 |
|
---|
| 31 | <!--
|
---|
| 32 | show the clasifier results -
|
---|
| 33 | you can change the appearance of the results by editing
|
---|
| 34 | the two templates at the bottom of this file
|
---|
| 35 | -->
|
---|
[19988] | 36 | <ul id="results">
|
---|
[19856] | 37 | <xsl:apply-templates select="classifier/*"/>
|
---|
| 38 | </ul>
|
---|
| 39 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
| 40 |
|
---|
| 41 | </xsl:template>
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | <!--
|
---|
| 45 | TEMPLATE FOR DOCUMENTS
|
---|
| 46 | -->
|
---|
| 47 | <xsl:template match="documentNode" priority="3">
|
---|
| 48 |
|
---|
| 49 | <!-- show the document details -->
|
---|
| 50 | <li class="document">
|
---|
| 51 |
|
---|
| 52 | <a>
|
---|
[23989] | 53 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&d=<xsl:value-of select="@nodeID"/>&dt=<xsl:value-of select="@docType"/>&p.a=b&p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&ed=1</xsl:attribute>
|
---|
[19856] | 54 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
|
---|
| 55 | </a>
|
---|
| 56 | <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
|
---|
| 57 |
|
---|
| 58 | </li>
|
---|
| 59 |
|
---|
| 60 | </xsl:template>
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | <!--
|
---|
| 64 | TEMPLATE FOR GROUPS OF DOCUMENTS
|
---|
| 65 | -->
|
---|
| 66 | <xsl:template match="classifierNode" priority="3">
|
---|
| 67 |
|
---|
[24009] | 68 | <table id="title{@nodeID}"><tr>
|
---|
| 69 | <!-- Expand/collapse button -->
|
---|
| 70 | <td class="headerTD">
|
---|
| 71 | <img id="toggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
| 72 | <xsl:attribute name="src">
|
---|
| 73 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
| 74 | </xsl:attribute>
|
---|
| 75 | </img>
|
---|
| 76 | </td>
|
---|
| 77 | <!-- Bookshelf icon -->
|
---|
| 78 | <td>
|
---|
| 79 | <img>
|
---|
| 80 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'bookshelf_image')"/></xsl:attribute>
|
---|
| 81 | </img>
|
---|
| 82 | </td>
|
---|
| 83 | <!-- Link title -->
|
---|
| 84 | <td>
|
---|
| 85 | <a href="javascript:toggleSection('{@nodeID}');">
|
---|
| 86 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
|
---|
| 87 | </a>
|
---|
| 88 | </td>
|
---|
| 89 | </tr></table>
|
---|
| 90 |
|
---|
| 91 | <!-- Show any documents or sub-groups in this group -->
|
---|
| 92 | <xsl:if test="documentNode|classifierNode">
|
---|
| 93 | <div id="div{@nodeID}" class="classifierContainer" style="display:block;">
|
---|
| 94 | <xsl:apply-templates select="documentNode|classifierNode"/>
|
---|
| 95 | </div>
|
---|
| 96 | </xsl:if>
|
---|
| 97 | </xsl:template>
|
---|
| 98 |
|
---|
| 99 | <xsl:template name="classifierLoadScript">
|
---|
| 100 | <script type="text/javascript">
|
---|
| 101 | <xsl:text disable-output-escaping="yes">
|
---|
| 102 | var collapseImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/><xsl:text disable-output-escaping="yes">";
|
---|
| 103 | var expandImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/><xsl:text disable-output-escaping="yes">";
|
---|
| 104 | var loadingImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'loading_image')"/><xsl:text disable-output-escaping="yes">";
|
---|
[24018] | 105 | var berryBaskets = "</xsl:text><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/><xsl:text disable-output-escaping="yes">";
|
---|
[24009] | 106 | var inProgress = new Array();
|
---|
| 107 |
|
---|
| 108 | function isExpanded(sectionID)
|
---|
| 109 | {
|
---|
| 110 | var divElem = document.getElementById("div" + sectionID);
|
---|
| 111 | if(divElem.style.display == "block")
|
---|
| 112 | {
|
---|
| 113 | return true;
|
---|
| 114 | }
|
---|
| 115 | return false;
|
---|
| 116 | }
|
---|
| 117 |
|
---|
| 118 | function toggleSection(sectionID)
|
---|
| 119 | {
|
---|
| 120 | var section = document.getElementById("div" + sectionID);
|
---|
| 121 | var sectionToggle = document.getElementById("toggle" + sectionID);
|
---|
| 122 |
|
---|
| 123 | if(section)
|
---|
| 124 | {
|
---|
| 125 | if(isExpanded(sectionID))
|
---|
| 126 | {
|
---|
| 127 | section.style.display = "none";
|
---|
| 128 | sectionToggle.setAttribute("src", expandImageURL);
|
---|
| 129 | }
|
---|
| 130 | else
|
---|
| 131 | {
|
---|
| 132 | section.style.display = "block";
|
---|
| 133 | sectionToggle.setAttribute("src", collapseImageURL);
|
---|
| 134 | }
|
---|
| 135 | }
|
---|
| 136 | else
|
---|
| 137 | {
|
---|
| 138 | httpRequest(sectionID);
|
---|
| 139 | }
|
---|
| 140 | }
|
---|
| 141 |
|
---|
| 142 | function httpRequest(sectionID)
|
---|
| 143 | {
|
---|
| 144 | if(!inProgress[sectionID])
|
---|
| 145 | {
|
---|
| 146 | inProgress[sectionID] = true;
|
---|
| 147 | var httpRequest;
|
---|
| 148 | if (window.XMLHttpRequest) {
|
---|
| 149 | httpRequest = new XMLHttpRequest();
|
---|
| 150 | }
|
---|
| 151 | else if (window.ActiveXObject) {
|
---|
| 152 | httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 | var sectionToggle = document.getElementById("toggle" + sectionID);
|
---|
| 156 | sectionToggle.setAttribute("src", loadingImageURL);
|
---|
[19856] | 157 |
|
---|
[24009] | 158 | var url = document.URL;
|
---|
[24018] | 159 | url = url.replace(/(&|\?)cl=[a-z\.0-9]+/gi, "$1cl=" + sectionID + "&excerptid=div" + sectionID);
|
---|
| 160 |
|
---|
| 161 | if(berryBaskets == "on")
|
---|
| 162 | {
|
---|
| 163 | url = url + "&berrybasket=on";
|
---|
| 164 | }
|
---|
[19856] | 165 |
|
---|
[24009] | 166 | httpRequest.open('GET', url, true);
|
---|
| 167 | httpRequest.onreadystatechange = function()
|
---|
| 168 | {
|
---|
| 169 | if (httpRequest.readyState == 4)
|
---|
| 170 | {
|
---|
| 171 | if (httpRequest.status == 200)
|
---|
| 172 | {
|
---|
| 173 | var newDiv = document.createElement("div");
|
---|
| 174 | var sibling = document.getElementById("title" + sectionID);
|
---|
| 175 | var parent = sibling.parentNode;
|
---|
| 176 |
|
---|
| 177 | if(sibling.nextSibling)
|
---|
| 178 | {
|
---|
| 179 | parent.insertBefore(newDiv, sibling.nextSibling);
|
---|
| 180 | }
|
---|
| 181 | else
|
---|
| 182 | {
|
---|
| 183 | parent.appendChild(newDiv);
|
---|
| 184 | }
|
---|
[24018] | 185 |
|
---|
[24009] | 186 | newDiv.innerHTML = httpRequest.responseText;
|
---|
| 187 | sectionToggle.setAttribute("src", collapseImageURL);
|
---|
[24018] | 188 |
|
---|
| 189 | if(berryBaskets == "on")
|
---|
| 190 | {
|
---|
| 191 | checkout();
|
---|
| 192 | }
|
---|
[24009] | 193 | }
|
---|
| 194 | else
|
---|
| 195 | {
|
---|
| 196 | sectionToggle.setAttribute("src", expandImageURL);
|
---|
| 197 | }
|
---|
| 198 | inProgress[sectionID] = false;
|
---|
| 199 | }
|
---|
| 200 | }
|
---|
| 201 | httpRequest.send();
|
---|
| 202 | }
|
---|
| 203 | }
|
---|
| 204 | </xsl:text>
|
---|
| 205 | </script>
|
---|
[19856] | 206 | </xsl:template>
|
---|
| 207 |
|
---|
| 208 | </xsl:stylesheet>
|
---|
| 209 |
|
---|