diff options
author | Philip Häusler <msquare@notrademark.de> | 2013-09-18 01:38:36 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2013-09-18 01:38:36 +0200 |
commit | bfb0cacd541cc20129a3c0ac77130370741dca18 (patch) | |
tree | 0a0e86e1a53d712065664c12d06603bc044df9ec /includes/view/Sprache_view.php | |
parent | d50cc21f50cb3ec3afdabb74a20d81bd1a53dfbd (diff) |
mysql to mysqli and a lot of cleanup and mvc
Diffstat (limited to 'includes/view/Sprache_view.php')
-rw-r--r-- | includes/view/Sprache_view.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/includes/view/Sprache_view.php b/includes/view/Sprache_view.php new file mode 100644 index 00000000..88c7435c --- /dev/null +++ b/includes/view/Sprache_view.php @@ -0,0 +1,36 @@ +<?php +/** + * Names of available languages. + */ +$languages = array ( + 'DE' => "Deutsch", + 'EN' => "English" +); + +/** + * Display acutual translation of given text id. + * @param string $TextID + * @param bool $NoError + * @return string + */ +function Get_Text($TextID, $NoError = false) { + global $debug; + + if (!isset ($_SESSION['Sprache'])) + $_SESSION['Sprache'] = "EN"; + if ($_SESSION['Sprache'] == "") + $_SESSION['Sprache'] = "EN"; + if (isset ($_GET["SetLanguage"])) + $_SESSION['Sprache'] = $_GET["SetLanguage"]; + + $sprache_source = Sprache($TextID, $_SESSION['Sprache']); + if($sprache_source === false) + engelsystem_error("Unable to load text key."); + if($sprache_source == null) { + if($NoError && !$debug) + return ""; + return $TextID; + } + return $sprache_source['Text']; +} +?>
\ No newline at end of file |