|
From: <var...@us...> - 2021-12-15 14:00:57
|
Revision: 10784
http://sourceforge.net/p/phpwiki/code/10784
Author: vargenau
Date: 2021-12-15 14:00:55 +0000 (Wed, 15 Dec 2021)
Log Message:
-----------
Set $LANG in templates
Modified Paths:
--------------
trunk/themes/Crao/templates/htmldump.tmpl
trunk/themes/Sidebar/templates/htmldump.tmpl
trunk/themes/default/templates/dialog.tmpl
trunk/themes/default/templates/html.tmpl
trunk/themes/default/templates/htmldump.tmpl
trunk/themes/default/templates/redirect.tmpl
Modified: trunk/themes/Crao/templates/htmldump.tmpl
===================================================================
--- trunk/themes/Crao/templates/htmldump.tmpl 2021-12-15 12:06:39 UTC (rev 10783)
+++ trunk/themes/Crao/templates/htmldump.tmpl 2021-12-15 14:00:55 UTC (rev 10784)
@@ -1,11 +1,20 @@
<?php
/*
* This template is used only for html file dumps, and is responsible
- * mainly for the outer level <html> stuff and the and <head>.
+ * mainly for the outer level <html> stuff and the <head>.
*/
+global $LANG;
+if (empty($LANG)) {
+ $pref = &$request->_prefs;
+ if ($pref) {
+ $LANG = $pref->get('lang');
+ } else {
+ $LANG = DEFAULT_LANGUAGE;
+ }
+}
?>
<!DOCTYPE html>
-<html xml:lang="<?php echo $GLOBALS['LANG']?>" lang="<?php echo $GLOBALS['LANG']?>">
+<html xml:lang="<?php echo $LANG ?>" lang="<?php echo $LANG ?>">
<head>
<meta charset="UTF-8" />
<link rel="home" title="<?php echo HOME_PAGE?>" href="<?php echo WikiURL(HOME_PAGE)?>" />
Modified: trunk/themes/Sidebar/templates/htmldump.tmpl
===================================================================
--- trunk/themes/Sidebar/templates/htmldump.tmpl 2021-12-15 12:06:39 UTC (rev 10783)
+++ trunk/themes/Sidebar/templates/htmldump.tmpl 2021-12-15 14:00:55 UTC (rev 10784)
@@ -1,11 +1,20 @@
<?php
/*
* This template is used only for html file dumps, and is responsible
- * mainly for the outer level <html> stuff and the and <head>.
+ * mainly for the outer level <html> stuff and the <head>.
*/
+global $LANG;
+if (empty($LANG)) {
+ $pref = &$request->_prefs;
+ if ($pref) {
+ $LANG = $pref->get('lang');
+ } else {
+ $LANG = DEFAULT_LANGUAGE;
+ }
+}
?>
<!DOCTYPE html>
-<html xml:lang="<?php echo $GLOBALS['LANG']?>" lang="<?php echo $GLOBALS['LANG']?>">
+<html xml:lang="<?php echo $LANG ?>" lang="<?php echo $LANG ?>">
<head>
<meta charset="UTF-8" />
<link rel="home" title="<?php echo HOME_PAGE?>" href="<?php echo WikiURL(HOME_PAGE)?>" />
Modified: trunk/themes/default/templates/dialog.tmpl
===================================================================
--- trunk/themes/default/templates/dialog.tmpl 2021-12-15 12:06:39 UTC (rev 10783)
+++ trunk/themes/default/templates/dialog.tmpl 2021-12-15 14:00:55 UTC (rev 10784)
@@ -2,9 +2,18 @@
/*
* A "popup" dialog. (Though it does not pop up yet.)
*/
+global $LANG;
+if (empty($LANG)) {
+ $pref = &$request->_prefs;
+ if ($pref) {
+ $LANG = $pref->get('lang');
+ } else {
+ $LANG = DEFAULT_LANGUAGE;
+ }
+}
?>
<!DOCTYPE html>
-<html xml:lang="<?php echo $GLOBALS['LANG']?>" lang="<?php echo $GLOBALS['LANG']?>">
+<html xml:lang="<?php echo $LANG ?>" lang="<?php echo $LANG ?>">
<head>
<meta charset="UTF-8" />
<meta name="robots" content="noindex, nofollow" />
Modified: trunk/themes/default/templates/html.tmpl
===================================================================
--- trunk/themes/default/templates/html.tmpl 2021-12-15 12:06:39 UTC (rev 10783)
+++ trunk/themes/default/templates/html.tmpl 2021-12-15 14:00:55 UTC (rev 10784)
@@ -2,9 +2,18 @@
/*
* This template is responsible mainly for the outer level <html> stuff.
*/
+global $LANG;
+if (empty($LANG)) {
+ $pref = &$request->_prefs;
+ if ($pref) {
+ $LANG = $pref->get('lang');
+ } else {
+ $LANG = DEFAULT_LANGUAGE;
+ }
+}
?>
<!DOCTYPE html>
-<html xml:lang="<?php echo $GLOBALS['LANG']?>" lang="<?php echo $GLOBALS['LANG']?>">
+<html xml:lang="<?php echo $LANG ?>" lang="<?php echo $LANG ?>">
<?php echo Template('head') ?>
<?php echo Template('body') ?>
</html>
Modified: trunk/themes/default/templates/htmldump.tmpl
===================================================================
--- trunk/themes/default/templates/htmldump.tmpl 2021-12-15 12:06:39 UTC (rev 10783)
+++ trunk/themes/default/templates/htmldump.tmpl 2021-12-15 14:00:55 UTC (rev 10784)
@@ -1,11 +1,20 @@
<?php
/*
* This template is used only for html file dumps, and is responsible
- * mainly for the outer level <html> stuff and the and <head>.
+ * mainly for the outer level <html> stuff and the <head>.
*/
+global $LANG;
+if (empty($LANG)) {
+ $pref = &$request->_prefs;
+ if ($pref) {
+ $LANG = $pref->get('lang');
+ } else {
+ $LANG = DEFAULT_LANGUAGE;
+ }
+}
?>
<!DOCTYPE html>
-<html xml:lang="<?php echo $GLOBALS['LANG']?>" lang="<?php echo $GLOBALS['LANG']?>">
+<html xml:lang="<?php echo $LANG ?>" lang="<?php echo $LANG ?>">
<head>
<meta charset="UTF-8" />
<link rel="home" title="<?php echo HOME_PAGE?>" href="<?php echo WikiURL(HOME_PAGE)?>" />
Modified: trunk/themes/default/templates/redirect.tmpl
===================================================================
--- trunk/themes/default/templates/redirect.tmpl 2021-12-15 12:06:39 UTC (rev 10783)
+++ trunk/themes/default/templates/redirect.tmpl 2021-12-15 14:00:55 UTC (rev 10784)
@@ -2,9 +2,18 @@
/*
* Redirect output.
*/
+global $LANG;
+if (empty($LANG)) {
+ $pref = &$request->_prefs;
+ if ($pref) {
+ $LANG = $pref->get('lang');
+ } else {
+ $LANG = DEFAULT_LANGUAGE;
+ }
+}
?>
<!DOCTYPE html>
-<html xml:lang="<?php echo $GLOBALS['LANG']?>" lang="<?php echo $GLOBALS['LANG']?>">
+<html xml:lang="<?php echo $LANG ?>" lang="<?php echo $LANG ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex, nofollow" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|