Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug #62705 Page title and heading would not change when language was …

…switched with the language select.
  • Loading branch information...
commit 72326212820ca2bfa1f5fb431d61583cbf0f36d1 1 parent de1d46b
@tumba25 tumba25 authored
Showing with 74 additions and 1 deletion.
  1. +1 −0  CHANGELOG
  2. +73 −1 modx.prosilver.en.xsl
View
1  CHANGELOG
@@ -2,6 +2,7 @@ Changes since MODX 1.2.5
[Feature] Ticket #62896 Added github tag to "About this MOD". To link to the MOD repo at github.
[Fix] Ticket #62844 "Find and Delete" and "In-line Find and Delete was not translated.
[Fix] nodeValue is deprecated, replaced with value.
+[Fix] Bug #62705 Page title and heading would not change when language was switched with the language select.
Changes since MODX 1.2.4
[Fix] Removed php-installer as link attribute and added it as a tag in the actions group.
View
74 modx.prosilver.en.xsl
@@ -781,6 +781,8 @@ function changeLanguage(langCode)
applyLanguage(enStrings.split("\n"));
}
xslLanguage(langCode);
+
+ show_title(langCode);
}
function load_languages()
@@ -809,6 +811,68 @@ function load_language()
send('', host + currentLanguage + '.txt?rnd=' + cachernd);
}
+if (typeof document.getElementsByClassName != 'function')
+{
+ document.getElementsByClassName = function()
+ {
+ var elms = document.getElementsByTagName('*');
+ var ei = new Array();
+ for (i = 0; i < elms.length; i++)
+ {
+ if (elms[i].getAttribute('class'))
+ {
+ ecl = elms[i].getAttribute('class').split(' ');
+ for (j = 0; j < ecl.length; j++)
+ {
+ if (ecl[j].toLowerCase() == arguments[0].toLowerCase())
+ {
+ ei.push(elms[i]);
+ }
+ }
+ }
+ else if (elms[i].className)
+ {
+ ecl = elms[i].className.split(' ');
+ for (j = 0; j < ecl.length; j++)
+ {
+ if (ecl[j].toLowerCase() == arguments[0].toLowerCase())
+ {
+ ei.push(elms[i]);
+ }
+ }
+ }
+ }
+ return ei;
+ }
+}
+
+function show_title(langCode)
+{
+ var sel_title = document.getElementById('title-' + langCode);
+
+ if (sel_title == null)
+ {
+ // A title in English is required.
+ sel_title = document.getElementById('title-en')
+
+ if (sel_title == null)
+ {
+ // No title in English or the selected language.
+ return;
+ }
+ }
+
+ var hide_title = document.getElementsByClassName('hide-title');
+
+ for (var i = 0; i < hide_title.length; i++)
+ {
+ hide_title[i].style.display='none';
+ }
+
+ sel_title.style.display='inline';
+ document.title = "phpBB MOD » " + sel_title.innerHTML;
+}
+
/*****************
* AJAX Functions *
*****************/
@@ -1629,7 +1693,14 @@ function toggle_edit(o)
<div id="debug"></div>
<div id="wrap">
<div id="page-header">
- <h1><span id="lang-h1">Installation instructions for</span> '<xsl:value-of select="$title" />' <span id="lang-V">version</span>&nbsp;<xsl:value-of select="$version" /></h1>
+ <h1>
+ <span id="lang-h1">Installation instructions for</span>
+ <span class="hide-title" lang="{@lang}"> '<xsl:value-of select="$title" />' </span>
+ <xsl:for-each select="mod:header/mod:title">
+ <span class="hide-title" lang="{@lang}" id="title-{@lang}" style="display: none;"> '<xsl:value-of select="current()" />' </span>
+ </xsl:for-each>
+ <span id="lang-V">version</span>&nbsp;<xsl:value-of select="$version" />
+ </h1>
<form method="post" action="" id="lang-selector" style="display: none;">
<fieldset class="nobg">
<label for="language"><span id="lang-slg">Select language:</span></label>&nbsp;<select id="language" name="language" onclick="load_languages()"><option value="en" selected="selected">English</option></select>
@@ -1668,6 +1739,7 @@ function toggle_edit(o)
</html>
</xsl:template>
+
<xsl:template name="give-header">
<fieldset>
<legend id="lang-atm">About this MOD</legend>
Please sign in to comment.
Something went wrong with that request. Please try again.