mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
DS-842 from trail to user box; add to all themes; keep URI when changing language
This commit is contained in:
@@ -130,7 +130,7 @@ public class Navigation extends AbstractDSpaceTransformer implements CacheablePr
|
||||
pageMeta.addMetadata("page","contactURL").addContent(contextPath + "/contact");
|
||||
pageMeta.addMetadata("page","feedbackURL").addContent(contextPath + "/feedback");
|
||||
|
||||
// Add the locale meta data including language dependent labels
|
||||
// Add the locale metadata including language-dependent labels
|
||||
Locale[] locales = I18nUtil.getSupportedLocales();
|
||||
for (int i=0; i < locales.length; i++)
|
||||
{
|
||||
|
@@ -1983,3 +1983,7 @@ background-color: rgb(255, 255, 255);
|
||||
margin: 2px 2px 0px 2px;
|
||||
/* border: 1px solid rgb(240, 240, 210); */
|
||||
}
|
||||
|
||||
#ds-language-selection {
|
||||
text-align: right;
|
||||
}
|
||||
|
@@ -384,27 +384,12 @@
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!-- Display a language selection if more than 1 language is supported -->
|
||||
<xsl:if test="count(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']) > 1">
|
||||
<div id="ds-language-selection">
|
||||
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']">
|
||||
<xsl:variable name="locale" select="."/>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat($context-path,'/?locale-attribute=')"/>
|
||||
<xsl:value-of select="$locale"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='supportedLocale'][@qualifier=$locale]"/>
|
||||
</a>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="languageSelection" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- The header (distinct from the HTML head element) contains the title, subtitle, login box and various
|
||||
placeholders for header images -->
|
||||
<xsl:template name="buildTrail">
|
||||
|
@@ -50,4 +50,17 @@
|
||||
-->
|
||||
<xsl:variable name="theme-path" select="concat($context-path,'/themes/',/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='theme'][@qualifier='path'])"/>
|
||||
|
||||
<!--
|
||||
Full URI of the current page. Composed of scheme, server name and port and request URI.
|
||||
-->
|
||||
<xsl:variable name="current-uri">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='scheme']"/>
|
||||
<xsl:text>://</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverName']"/>
|
||||
<xsl:text>:</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverPort']"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='URI']"/>
|
||||
</xsl:variable>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@@ -354,6 +354,7 @@
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:call-template name="languageSelection" />
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
@@ -583,4 +584,23 @@
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- Display language selection if more than 1 language is supported -->
|
||||
<xsl:template name="languageSelection">
|
||||
<xsl:if test="count(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']) > 1">
|
||||
<div id="ds-language-selection">
|
||||
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']">
|
||||
<xsl:variable name="locale" select="."/>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="$current-uri"/>
|
||||
<xsl:text>?locale-attribute=</xsl:text>
|
||||
<xsl:value-of select="$locale"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='supportedLocale'][@qualifier=$locale]"/>
|
||||
</a>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@@ -48,6 +48,19 @@
|
||||
-->
|
||||
<xsl:variable name="theme-path" select="concat($context-path,'/themes/',/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='theme'][@qualifier='path'])"/>
|
||||
|
||||
<!--
|
||||
Full URI of the current page. Composed of scheme, server name and port and request URI.
|
||||
-->
|
||||
<xsl:variable name="current-uri">
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='scheme']"/>
|
||||
<xsl:text>://</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverName']"/>
|
||||
<xsl:text>:</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='serverPort']"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='URI']"/>
|
||||
</xsl:variable>
|
||||
|
||||
<!--
|
||||
Requested Page URI. Some functions may alter behavior of processing depending if URI matches a pattern.
|
||||
Specifically, adding a static page will need to override the DRI, to directly add content.
|
||||
@@ -373,6 +386,9 @@
|
||||
<i18n:text>xmlui.dri2xhtml.structural.logout</i18n:text>
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<xsl:call-template name="languageSelection" />
|
||||
</p>
|
||||
</div>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
@@ -386,6 +402,9 @@
|
||||
<i18n:text>xmlui.dri2xhtml.structural.login</i18n:text>
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<xsl:call-template name="languageSelection" />
|
||||
</p>
|
||||
</div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
@@ -3798,5 +3817,24 @@
|
||||
<xsl:apply-templates select="$metsDoc/mets:METS/mets:fileSec" mode="artifact-preview"/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- Display language selection if more than 1 language is supported -->
|
||||
<xsl:template name="languageSelection">
|
||||
<xsl:if test="count(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']) > 1">
|
||||
<div id="ds-language-selection">
|
||||
<xsl:for-each select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']">
|
||||
<xsl:variable name="locale" select="."/>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="$current-uri"/>
|
||||
<xsl:text>?locale-attribute=</xsl:text>
|
||||
<xsl:value-of select="$locale"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='supportedLocale'][@qualifier=$locale]"/>
|
||||
</a>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
Reference in New Issue
Block a user