Changeset 5388 for trunk/gsdl3/web/interfaces
- Timestamp:
- 2003-09-01T09:55:05+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/web/interfaces/nzdl/transform/style.xsl
r5120 r5388 10 10 <xsl:param name="interface_name"/> 11 11 <xsl:param name="library_name"/> 12 13 <!-- some global variables --> 14 <xsl:variable name="colour-button-text">#345437</xsl:variable> 15 <xsl:variable name="colour-navbar-link-text">#345437</xsl:variable> 16 <xsl:variable name="colour-navbar-selected-text">#c6aa69</xsl:variable> 12 17 13 18 <!-- the main page layout template is here --> … … 35 40 </xsl:template> 36 41 42 <!-- any global java script should go in here --> 43 <xsl:template name="headScript"> 44 </xsl:template> 45 46 <!-- the old javascript for rollover images --> 47 <!-- 37 48 <xsl:template name="headScript"> 38 49 <script> 39 50 <xsl:text disable-output-escaping="yes"> 40 <! --51 <! 41 52 var loaded = new Array(); 42 53 function gbutton (image, onimage) { … … 59 70 } 60 71 } 61 // -->72 //> 62 73 </xsl:text> 63 74 64 75 </script> 65 76 </xsl:template> 66 77 --> 78 67 79 <xsl:template name="genericPageBanner"> 68 80 <xsl:variable name="lang" select="/page/@lang"/> … … 71 83 <tr><td align="left"></td> 72 84 <td align="right"> 73 <a href="{$library_name}?a=p&sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a> 85 <table> 86 <tr><td xsl:use-attribute-sets="td-brownbutton"> 87 <a style="text-decoration:none" href="{$library_name}?a=p&sa=home"> 88 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b> 89 </a> 90 </td></tr></table> 74 91 </td> 75 92 </tr> … … 79 96 </xsl:template> 80 97 81 82 <!-- just pass in collname cos use it everywhere - saves working it out lots of times -->83 98 <xsl:template name="standardPageBanner"> 84 99 <xsl:param name="collName"/> 85 100 <xsl:param name="pageType"/> 86 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/> 87 <xsl:variable name="colIcon" select="/page/pageResponse/collection/displayItem[@name='icon']"/> 88 <xsl:variable name="lang" select="/page/@lang"/> 89 <table width="537"> 101 <xsl:param name="clTop"/> 102 <xsl:variable name="this-element" select="/page/pageResponse/collection"/> 103 <table width="100%"> 90 104 <tr> 91 105 <td align="left" rowspan="2"> 92 106 <a href="{$library_name}?a=p&sa=about&c={$collName}"> 93 <img border="1" src="{$httpPath}/images/{$colIcon}"> 94 <xsl:attribute name="alt"> 95 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/> 96 </xsl:attribute> 97 </img> 107 <xsl:choose> 108 <xsl:when test="$this-element/displayItem[@name='icon']"> 109 <img border="0"> 110 <xsl:attribute name="src"> 111 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/> 112 </xsl:attribute> 113 <xsl:attribute name="alt"> 114 <xsl:value-of select="$this-element/displayItem[@name='name']"/> 115 </xsl:attribute> 116 <xsl:attribute name="title"> 117 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/> 118 </xsl:attribute> 119 </img> 120 </xsl:when> 121 <xsl:otherwise> 122 <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b> 123 </xsl:otherwise> 124 </xsl:choose> 98 125 </a> 99 126 </td> 100 127 <td align="right"> 101 <a href="{$library_name}?a=p&sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a> 102 <a href="{$library_name}?a=p&sa=help&c={$collName}" onMouseover="roll('help',1);" onMouseOut="roll('help',0);"><img name="help" src="interfaces/nzdl/images/{$lang}/chelpof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chelpon.gif');" border="0" alt="Help page"/></a> 103 <a href="{$library_name}?a=p&sa=pref&c={$collName}" onMouseover="roll('pref',1);" onMouseOut="roll('pref',0);"><img name="pref" src="interfaces/nzdl/images/{$lang}/cprefof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/cprefon.gif');" border="0" alt="Preferences page"/></a> 128 <table cellspacing='4'> 129 <tr> 130 <td xsl:use-attribute-sets="td-brownbutton"> 131 <a style="text-decoration:none" href="{$library_name}?a=p&sa=home"> 132 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b> 133 </a> 134 </td> 135 <xsl:choose> 136 <xsl:when test="$pageType='help'"> 137 <td xsl:use-attribute-sets="td-brownbutton-off"> 138 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b> 139 </td> 140 </xsl:when> 141 <xsl:otherwise> 142 <td xsl:use-attribute-sets="td-brownbutton"> 143 <a style="text-decoration:none" href="{$library_name}?a=p&sa=help&c={$collName}"> 144 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b> 145 </a> 146 </td> 147 </xsl:otherwise> 148 </xsl:choose> 149 <xsl:choose> 150 <xsl:when test="$pageType='pref'"> 151 <td xsl:use-attribute-sets="td-brownbutton-off"> 152 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b> 153 </td> 154 </xsl:when> 155 <xsl:otherwise> 156 <td xsl:use-attribute-sets="td-brownbutton"> 157 <a title="xxpref" style="text-decoration:none" href="{$library_name}?a=p&sa=pref&c={$collName}"> 158 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b> 159 </a> 160 </td> 161 </xsl:otherwise> 162 </xsl:choose> 163 </tr> 164 </table> 104 165 </td> 105 166 </tr> 167 <xsl:if test="not(/page/pageRequest/@action='d')"> 168 <xsl:variable name="text"> 169 <xsl:choose> 170 <xsl:when test="$pageType='browse'"> 171 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier[@name=$clTop]/displayItem[@name='name']"/> 172 </xsl:when> 173 <xsl:otherwise> 174 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, concat($pageType, '_t'))"/> 175 </xsl:otherwise> 176 </xsl:choose> 177 </xsl:variable> 178 <tr> 179 <td align='right' width="200" height="57" background='interfaces/nzdl/images/titleicon.gif'><font size="+2" color='black'><xsl:value-of select="$text"/>  </font></td> 180 </tr> 181 </xsl:if> 182 </table> 183 <p/> 184 </xsl:template> 185 186 187 <xsl:template name="navigationBar"> 188 <xsl:param name="collName"/> 189 <xsl:param name="clTop"/> 190 <xsl:variable name="this-element" select="/page/pageResponse/collection"/> 191 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/> 192 <xsl:variable name="classifiers" select="$this-element/serviceList/service[@name='ClassifierBrowse']/classifierList"/> 193 <table border='0' cellspacing='0' width='100%'> 106 194 <tr> 107 <td align='right'><xsl:if test="$pageType"><img src="interfaces/nzdl/images/{$lang}/h_{$pageType}.gif" width="200" height="57"/></xsl:if></td> 108 </tr> 109 110 <tr> 111 <td colspan='2'></td> 195 <xsl:if test="$this-element/serviceList/service[@type='query']"> 196 <td xsl:use-attribute-sets="td-navbar"> 197 <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template> 198 </td> 199 </xsl:if> 200 201 <xsl:for-each select="$classifiers/classifier"> 202 <td xsl:use-attribute-sets="td-navbar"> 203 <xsl:apply-templates select="." mode="navbar"> 204 <xsl:with-param name="collName" select="$collName"/> 205 <xsl:with-param name="clTop" select="$clTop"/> 206 </xsl:apply-templates> 207 </td> 208 </xsl:for-each> 209 210 <xsl:if test="$this-element/serviceList/service[@name='PhindApplet']"> 211 <td xsl:use-attribute-sets="td-navbar"> 212 <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template> 213 </td> 214 </xsl:if> 112 215 </tr> 113 216 </table> 114 115 <xsl:call-template name="navigationBar"> 116 <xsl:with-param name="collName" select="$collName"/> 117 </xsl:call-template> 118 </xsl:template> 119 120 <xsl:template name="navigationBar"> 121 <xsl:param name="collName"/> 122 <xsl:variable name="classifiers" select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList"/> 123 <xsl:variable name="action" select="/page/pageRequest/@action"/> 124 <xsl:variable name="classifier"><xsl:if test="$action='b'"><xsl:value-of select="/page/pageRequest/paramList/param[@name='cl']/@value"/></xsl:if></xsl:variable> 125 <xsl:variable name="lang" select="/page/@lang"/> 126 <!--action=<xsl:value-of select="$action"/>, classifier=<xsl:value-of select="$classifier"/>--> 127 <xsl:text disable-output-escaping='yes'> 128 <!-- Navigation Bar --> 129 </xsl:text> 130 <nobr> 131 <xsl:call-template name="nbSearch"> 132 <xsl:with-param name="collName" select="$collName"/> 133 <xsl:with-param name="action" select="$action"/> 134 </xsl:call-template> 135 136 <xsl:for-each select="$classifiers/classifier"> 137 <xsl:apply-templates select="." mode="nav-bar-button"> 138 <xsl:with-param name="collName" select="$collName"/> 139 <xsl:with-param name="classifier" select="$classifier"/> 140 </xsl:apply-templates> 141 </xsl:for-each> 142 <xsl:call-template name="nbPhrase"> <!-- this may be nothing if there is no phrase browsing for a collection --> 143 <xsl:with-param name="collName" select="$collName"/> 144 <xsl:with-param name="action" select="$action"/> 145 </xsl:call-template> 146 </nobr> 147 <xsl:text disable-output-escaping='yes'> 148 <!-- End of Navigation Bar --> 149 </xsl:text> 150 </xsl:template> 151 152 <xsl:template name="dividerBar"> 153 <xsl:param name='text'/> 154 <br/><table width='537' border="0" cellpadding="0" cellspacing="0"> 155 <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b> <xsl:value-of select='$text'/></b></font></td></tr></table><br/> 156 </xsl:template> 157 158 <xsl:template name="navBarImage"> 159 <xsl:param name="url"/> 160 <xsl:param name="name"/> 161 <xsl:param name="alt"/> 162 <xsl:variable name="lang" select="/page/@lang"/> 163 <a href="{$url}" onMouseOver="roll('{$name}', 1);" onMouseOut="roll('{$name}', 0);"><img name="{$name}" src="interfaces/nzdl/images/{$lang}/t{$name}of.gif" onLoad="gbutton(this,'interfaces/nzdl/images/{$lang}/t{$name}on.gif');" border='0' alt="{$alt}" title="{alt}"/></a> 164 </xsl:template> 165 166 <xsl:template name="nbSearch"> 167 <xsl:param name="collName"/> 168 <xsl:param name="action"/> 169 <xsl:variable name="lang" select="/page/@lang"/> 170 <xsl:choose> 171 <xsl:when test="$action='q'"> 172 <img src="interfaces/nzdl/images/{$lang}/tSearchgr.gif" border='0' alt="Search" title="Search"/> 173 </xsl:when> 174 <xsl:otherwise> 175 <!-- need to check for form search --> 176 <xsl:variable name="query-service"> 217 <br/> 218 </xsl:template> 219 220 <xsl:template name="navbar-search"> 221 <xsl:param name="collName"/> 222 <xsl:choose> 223 <xsl:when test="/page/pageRequest/@action='q'"><b><nobr><font size='+1' color='{$colour-navbar-selected-text}'>search</font></nobr></b></xsl:when> 224 <xsl:otherwise> 225 <xsl:variable name="service"> 177 226 <xsl:choose> 178 227 <xsl:when test="not(/page/pageRequest/paramList/param[@name='ct'])">TextQuery</xsl:when> … … 182 231 </xsl:choose> 183 232 </xsl:variable> 184 <xsl:call-template name="navBarImage"> 185 <xsl:with-param name="url">nzdl?a=q&rt=d&s=<xsl:value-of select="$query-service"/>&c=<xsl:value-of select="$collName"/></xsl:with-param> 186 <xsl:with-param name="name">Search</xsl:with-param> 187 <xsl:with-param name="alt">Search</xsl:with-param> 188 </xsl:call-template> 189 </xsl:otherwise> 190 </xsl:choose> 191 </xsl:template> 192 193 <xsl:template name="nbPhrase"> 194 <xsl:param name="collName"/> 195 <xsl:param name="action"/> 196 <xsl:variable name="lang" select="/page/@lang"/> 197 <xsl:if test="/page/pageResponse/collection/serviceList/service[@name='PhindApplet']"> 198 <xsl:choose> 199 <xsl:when test="$action='a'"><!-- note, this assumes that the phind applet is the only applet --> 200 <img src="interfaces/nzdl/images/{$lang}/tPhrasegr.gif" border='0' alt="Phrase Browse" title="Phrase Browse"/> 201 </xsl:when> 202 <xsl:otherwise> 203 <xsl:call-template name="navBarImage"> 204 <xsl:with-param name="url">nzdl?a=a&rt=d&s=PhindApplet&c=<xsl:value-of select="$collName"/></xsl:with-param> 205 <xsl:with-param name="name">Phrase</xsl:with-param> 206 <xsl:with-param name="alt">Phrase Browse</xsl:with-param> 207 </xsl:call-template> 208 </xsl:otherwise> 209 </xsl:choose> 210 </xsl:if> 211 </xsl:template> 212 213 <xsl:template match="classifier" mode="nav-bar-button"> 214 <xsl:param name="collName"/> 215 <xsl:param name="classifier"/> 216 <xsl:variable name="buttonname"><xsl:choose><xsl:when test="@buttonname"><xsl:value-of select="@buttonname"/></xsl:when><xsl:otherwise><xsl:value-of select="@content"/></xsl:otherwise></xsl:choose></xsl:variable> 217 <xsl:variable name="lang" select="/page/@lang"/> 218 <xsl:choose> 219 <xsl:when test="starts-with($classifier, @name)"> 220 <img src="interfaces/nzdl/images/{$lang}/t{$buttonname}gr.gif" border='0' alt="{$buttonname}" title="{$buttonname}"/> 221 </xsl:when> 222 <xsl:otherwise> 223 <xsl:call-template name="navBarImage"> 224 <xsl:with-param name="url">nzdl?a=b&rt=r&s=ClassifierBrowse&c=<xsl:value-of select="$collName"/>&cl=<xsl:value-of select="@name"/></xsl:with-param> 225 <xsl:with-param name="name" select="$buttonname"/> 226 <xsl:with-param name="alt" select="$buttonname"/> 227 </xsl:call-template> 228 </xsl:otherwise> 229 </xsl:choose> 230 </xsl:template> 231 233 234 <a style="text-decoration:none" href="{$library_name}?a=q&rt=d&s={$service}&c={$collName}"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name=$service]/displayItem[@name='description']"/></xsl:attribute><b><nobr><font size='+1' color='{$colour-navbar-link-text}'>search</font></nobr></b></a> 235 </xsl:otherwise> 236 </xsl:choose> 237 </xsl:template> 238 239 <xsl:template name="navbar-phind"> 240 <xsl:param name="collName"/> 241 <xsl:choose> 242 <xsl:when test="/page/pageRequest/paramList/param[@name='s']/@value='PhindApplet'"><b><nobr><font size='+1' color='{$colour-navbar-selected-text}'>phrases</font></nobr></b></xsl:when> 243 <xsl:otherwise> 244 <a style="text-decoration:none" href="{$library_name}?a=a&rt=d&s=PhindApplet&c={$collName}"><xsl:if test="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"/></xsl:attribute></xsl:if><b><nobr><font size='+1' color='{$colour-navbar-link-text}'>phrases</font></nobr></b></a> 245 </xsl:otherwise> 246 </xsl:choose> 247 </xsl:template> 248 249 <xsl:template match="classifier" mode="navbar"> 250 <xsl:param name="collName"/> 251 <xsl:param name="clTop"/> 252 <xsl:choose> 253 <xsl:when test="/page/pageRequest/@action='b' and $clTop=@name"> 254 <b><nobr><font size='+1' color='{$colour-navbar-selected-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></xsl:when> 255 <xsl:otherwise> 256 <a style="text-decoration:none" href="{$library_name}?a=b&rt=r&s=ClassifierBrowse&c={$collName}&cl={@name}"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute><b><nobr><font size='+1' color='{$colour-navbar-link-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></a> 257 </xsl:otherwise> 258 </xsl:choose> 259 </xsl:template> 260 261 <xsl:template name="dividerBar"> 262 <xsl:param name='text'/> 263 <br/><table width='537' border="0" cellpadding="0" cellspacing="0"> 264 <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b> <xsl:value-of select='$text'/></b></font></td></tr></table><br/> 265 </xsl:template> 266 232 267 <xsl:attribute-set name="body-style"> 233 268 <xsl:attribute name="bgcolor">#ffffff</xsl:attribute> … … 238 273 <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute> 239 274 </xsl:attribute-set> 240 241 <!-- this should probably use a greenstone image rather than nzdl image --> 275 276 <xsl:attribute-set name="td-brownbutton"> 277 <xsl:attribute name='background'>interfaces/default/images/brownbutton.gif</xsl:attribute> 278 <xsl:attribute name='height'>20</xsl:attribute> 279 <xsl:attribute name='align'>center</xsl:attribute> 280 </xsl:attribute-set> 281 282 <xsl:attribute-set name="td-brownbutton-off"> 283 <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute> 284 <xsl:attribute name='height'>20</xsl:attribute> 285 <xsl:attribute name='align'>center</xsl:attribute> 286 </xsl:attribute-set> 287 288 <xsl:attribute-set name="td-navbar"> 289 <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute> 290 <xsl:attribute name='height'>20</xsl:attribute> 291 <xsl:attribute name='align'>center</xsl:attribute> 292 </xsl:attribute-set> 293 242 294 <xsl:template name="nzdlPageBanner"> 243 295 <center> … … 257 309 </table> 258 310 </center> 259 260 <!-- end of page banner --> 261 311 <!-- end of page banner --> 262 312 </xsl:template> 263 313 … … 269 319 </xsl:template> 270 320 271 272 <xsl:template name="iconblankbar">273 <p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>274 </xsl:template>275 276 321 <xsl:template name="imagegreenstone"> 277 322 <img src="interfaces/nzdl/images/gsdl.gif" width="140" height="77" border="0" hspace='0'><xsl:attribute name='alt'><xsl:call-template name='textimagegreenstone'/></xsl:attribute></img> 278 323 </xsl:template> 279 324 280 281 325 <!-- Display the appropriate image, depending on the node type --> 282 326 <xsl:template match="documentNode" mode="displayNodeIcon">
Note:
See TracChangeset
for help on using the changeset viewer.