[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 | -->
|
---|
[24115] | 36 | <table id="results">
|
---|
| 37 | <xsl:for-each select="classifier/*">
|
---|
| 38 | <tr>
|
---|
| 39 | <xsl:apply-templates select="."/>
|
---|
| 40 | </tr>
|
---|
| 41 | </xsl:for-each>
|
---|
| 42 | </table>
|
---|
[19856] | 43 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
| 44 | </xsl:template>
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | <!--
|
---|
| 48 | TEMPLATE FOR DOCUMENTS
|
---|
| 49 | -->
|
---|
[24115] | 50 | <xsl:template match="documentNode">
|
---|
| 51 | <!-- The book icon -->
|
---|
| 52 | <td>
|
---|
| 53 | <img>
|
---|
| 54 | <xsl:attribute name="src">
|
---|
| 55 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'book_image')"/>
|
---|
| 56 | </xsl:attribute>
|
---|
| 57 | </img>
|
---|
| 58 | </td>
|
---|
| 59 | <!-- The document link -->
|
---|
| 60 | <td>
|
---|
[19856] | 61 | <a>
|
---|
[23989] | 62 | <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] | 63 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
|
---|
| 64 | </a>
|
---|
[24115] | 65 | </td>
|
---|
| 66 | <!-- The berry (optional) -->
|
---|
| 67 | <td>
|
---|
[19856] | 68 | <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
|
---|
[24115] | 69 | </td>
|
---|
[19856] | 70 | </xsl:template>
|
---|
| 71 |
|
---|
| 72 |
|
---|
| 73 | <!--
|
---|
| 74 | TEMPLATE FOR GROUPS OF DOCUMENTS
|
---|
| 75 | -->
|
---|
[24115] | 76 | <xsl:template match="classifierNode">
|
---|
[19856] | 77 |
|
---|
[24009] | 78 | <table id="title{@nodeID}"><tr>
|
---|
| 79 | <!-- Expand/collapse button -->
|
---|
| 80 | <td class="headerTD">
|
---|
| 81 | <img id="toggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
| 82 | <xsl:attribute name="src">
|
---|
| 83 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
| 84 | </xsl:attribute>
|
---|
| 85 | </img>
|
---|
| 86 | </td>
|
---|
| 87 | <!-- Bookshelf icon -->
|
---|
| 88 | <td>
|
---|
| 89 | <img>
|
---|
| 90 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'bookshelf_image')"/></xsl:attribute>
|
---|
| 91 | </img>
|
---|
| 92 | </td>
|
---|
| 93 | <!-- Link title -->
|
---|
| 94 | <td>
|
---|
| 95 | <a href="javascript:toggleSection('{@nodeID}');">
|
---|
| 96 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
|
---|
| 97 | </a>
|
---|
| 98 | </td>
|
---|
| 99 | </tr></table>
|
---|
| 100 |
|
---|
| 101 | <!-- Show any documents or sub-groups in this group -->
|
---|
| 102 | <xsl:if test="documentNode|classifierNode">
|
---|
[24115] | 103 | <div id="div{@nodeID}" class="classifierContainer">
|
---|
| 104 | <table>
|
---|
| 105 | <xsl:for-each select="documentNode|classifierNode">
|
---|
| 106 | <tr>
|
---|
| 107 | <xsl:apply-templates select="."/>
|
---|
| 108 | </tr>
|
---|
| 109 | </xsl:for-each>
|
---|
| 110 | </table>
|
---|
[24009] | 111 | </div>
|
---|
| 112 | </xsl:if>
|
---|
| 113 | </xsl:template>
|
---|
| 114 |
|
---|
| 115 | <xsl:template name="classifierLoadScript">
|
---|
| 116 | <script type="text/javascript">
|
---|
| 117 | <xsl:text disable-output-escaping="yes">
|
---|
| 118 | var collapseImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/><xsl:text disable-output-escaping="yes">";
|
---|
| 119 | var expandImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/><xsl:text disable-output-escaping="yes">";
|
---|
| 120 | var loadingImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'loading_image')"/><xsl:text disable-output-escaping="yes">";
|
---|
[24018] | 121 | var berryBaskets = "</xsl:text><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/><xsl:text disable-output-escaping="yes">";
|
---|
[24009] | 122 | var inProgress = new Array();
|
---|
| 123 |
|
---|
| 124 | function isExpanded(sectionID)
|
---|
| 125 | {
|
---|
| 126 | var divElem = document.getElementById("div" + sectionID);
|
---|
[24115] | 127 | if(!divElem.style.display || divElem.style.display == "block")
|
---|
[24009] | 128 | {
|
---|
| 129 | return true;
|
---|
| 130 | }
|
---|
| 131 | return false;
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | function toggleSection(sectionID)
|
---|
| 135 | {
|
---|
| 136 | var section = document.getElementById("div" + sectionID);
|
---|
| 137 | var sectionToggle = document.getElementById("toggle" + sectionID);
|
---|
| 138 |
|
---|
| 139 | if(section)
|
---|
| 140 | {
|
---|
| 141 | if(isExpanded(sectionID))
|
---|
| 142 | {
|
---|
| 143 | section.style.display = "none";
|
---|
| 144 | sectionToggle.setAttribute("src", expandImageURL);
|
---|
| 145 | }
|
---|
| 146 | else
|
---|
| 147 | {
|
---|
| 148 | section.style.display = "block";
|
---|
| 149 | sectionToggle.setAttribute("src", collapseImageURL);
|
---|
| 150 | }
|
---|
| 151 | }
|
---|
| 152 | else
|
---|
| 153 | {
|
---|
| 154 | httpRequest(sectionID);
|
---|
| 155 | }
|
---|
| 156 | }
|
---|
| 157 |
|
---|
| 158 | function httpRequest(sectionID)
|
---|
| 159 | {
|
---|
| 160 | if(!inProgress[sectionID])
|
---|
| 161 | {
|
---|
| 162 | inProgress[sectionID] = true;
|
---|
| 163 | var httpRequest;
|
---|
| 164 | if (window.XMLHttpRequest) {
|
---|
| 165 | httpRequest = new XMLHttpRequest();
|
---|
| 166 | }
|
---|
| 167 | else if (window.ActiveXObject) {
|
---|
| 168 | httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
|
---|
| 169 | }
|
---|
| 170 |
|
---|
| 171 | var sectionToggle = document.getElementById("toggle" + sectionID);
|
---|
| 172 | sectionToggle.setAttribute("src", loadingImageURL);
|
---|
[19856] | 173 |
|
---|
[24009] | 174 | var url = document.URL;
|
---|
[24018] | 175 | url = url.replace(/(&|\?)cl=[a-z\.0-9]+/gi, "$1cl=" + sectionID + "&excerptid=div" + sectionID);
|
---|
| 176 |
|
---|
| 177 | if(berryBaskets == "on")
|
---|
| 178 | {
|
---|
| 179 | url = url + "&berrybasket=on";
|
---|
| 180 | }
|
---|
[19856] | 181 |
|
---|
[24009] | 182 | httpRequest.open('GET', url, true);
|
---|
| 183 | httpRequest.onreadystatechange = function()
|
---|
| 184 | {
|
---|
| 185 | if (httpRequest.readyState == 4)
|
---|
| 186 | {
|
---|
| 187 | if (httpRequest.status == 200)
|
---|
| 188 | {
|
---|
| 189 | var newDiv = document.createElement("div");
|
---|
| 190 | var sibling = document.getElementById("title" + sectionID);
|
---|
| 191 | var parent = sibling.parentNode;
|
---|
| 192 |
|
---|
| 193 | if(sibling.nextSibling)
|
---|
| 194 | {
|
---|
| 195 | parent.insertBefore(newDiv, sibling.nextSibling);
|
---|
| 196 | }
|
---|
| 197 | else
|
---|
| 198 | {
|
---|
| 199 | parent.appendChild(newDiv);
|
---|
| 200 | }
|
---|
[24018] | 201 |
|
---|
[24009] | 202 | newDiv.innerHTML = httpRequest.responseText;
|
---|
| 203 | sectionToggle.setAttribute("src", collapseImageURL);
|
---|
[24018] | 204 |
|
---|
| 205 | if(berryBaskets == "on")
|
---|
| 206 | {
|
---|
| 207 | checkout();
|
---|
| 208 | }
|
---|
[24009] | 209 | }
|
---|
| 210 | else
|
---|
| 211 | {
|
---|
| 212 | sectionToggle.setAttribute("src", expandImageURL);
|
---|
| 213 | }
|
---|
| 214 | inProgress[sectionID] = false;
|
---|
| 215 | }
|
---|
| 216 | }
|
---|
| 217 | httpRequest.send();
|
---|
| 218 | }
|
---|
| 219 | }
|
---|
| 220 | </xsl:text>
|
---|
| 221 | </script>
|
---|
[19856] | 222 | </xsl:template>
|
---|
| 223 |
|
---|
| 224 | </xsl:stylesheet>
|
---|
| 225 |
|
---|