From a8aa9bd611834336eb0209e0d368a540f41f44f0 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sun, 18 Jan 2015 06:36:00 +0000 Subject: [PATCH] Add a new text array that is used in the translations. --- resources/classes/text.php | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 resources/classes/text.php diff --git a/resources/classes/text.php b/resources/classes/text.php new file mode 100644 index 0000000000..a75cd66d25 --- /dev/null +++ b/resources/classes/text.php @@ -0,0 +1,55 @@ + $value) { + unset($this->$key); + } + } + + /** + * Get a specific item from the cache + * @var string $path examples: app/exec or core/domains + */ + public function get($path) { + //get the app_languages.php + if (strlen($path) > 0) { + require_once glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/".$path."/app_{languages}.php",GLOB_BRACE); + } + else { + require_once getcwd().'/app_languages.php'; + } + + //add multi-lingual support + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + + //return the array of translations + return $text; + + } + +} + +?> \ No newline at end of file