From 000bf6aebc2a5f55b490d0940cf7685e25712185 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 22 Nov 2013 15:56:25 +0100 Subject: [PATCH] restored missing function and migrated it to new PDO database class, fixes #1306 Signed-off-by: Michael Kaufmann (d00p) --- .../froxlor/function.getLanguages.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/functions/froxlor/function.getLanguages.php diff --git a/lib/functions/froxlor/function.getLanguages.php b/lib/functions/froxlor/function.getLanguages.php new file mode 100644 index 00000000..413e4049 --- /dev/null +++ b/lib/functions/froxlor/function.getLanguages.php @@ -0,0 +1,34 @@ + (2003-2009) + * @author Froxlor team (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Functions + * + */ + +function getLanguages() { + + $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_LANGUAGE . "` "; + $languages_array = array(); + + while ($row = $result_stmt->fetch(PDO::FETCH_ARRAY)) { + if (!isset($languages_array[$row['language']]) + && !in_array($row['language'], $languages_array) + ) { + $languages_array[$row['language']] = html_entity_decode($row['language']); + } + } + + return $languages_array; +}