From bfb0cacd541cc20129a3c0ac77130370741dca18 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Wed, 18 Sep 2013 01:38:36 +0200 Subject: mysql to mysqli and a lot of cleanup and mvc --- includes/view/Sprache_view.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 includes/view/Sprache_view.php (limited to 'includes/view/Sprache_view.php') 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 @@ + "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 -- cgit v1.2.3-70-g09d2