summaryrefslogtreecommitdiffstats
path: root/modules-available/baseconfig/hooks/translation.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-04 18:27:28 +0200
committerSimon Rettberg2016-05-04 18:27:28 +0200
commit80424b29e00609bf837119fa810b5afdadf2b4e9 (patch)
treee59c49265aeb219c4137bdf21e71262201345b99 /modules-available/baseconfig/hooks/translation.inc.php
parentWIP (diff)
downloadslx-admin-80424b29e00609bf837119fa810b5afdadf2b4e9.tar.gz
slx-admin-80424b29e00609bf837119fa810b5afdadf2b4e9.tar.xz
slx-admin-80424b29e00609bf837119fa810b5afdadf2b4e9.zip
Work on translations: templates and messages work
Diffstat (limited to 'modules-available/baseconfig/hooks/translation.inc.php')
-rw-r--r--modules-available/baseconfig/hooks/translation.inc.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/modules-available/baseconfig/hooks/translation.inc.php b/modules-available/baseconfig/hooks/translation.inc.php
new file mode 100644
index 00000000..84a6d33a
--- /dev/null
+++ b/modules-available/baseconfig/hooks/translation.inc.php
@@ -0,0 +1,39 @@
+<?php
+
+$HANDLER = array();
+
+/**
+ * List of valid subsections
+ */
+$HANDLER['subsections'] = array(
+ 'categories', 'settings'
+);
+
+/*
+ * Handlers for the subsections that will return an array of expected tags.
+ * This is optional, if you don't want to define expected tags, don't create a function.
+ */
+
+/**
+ * Configuration categories
+ */
+$HANDLER['grep']['categories'] = function($module) {
+ $want = array();
+ $res = Database::simpleQuery("SELECT catid FROM cat_setting ORDER BY catid ASC");
+ while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ $want[] = 'cat_' . $row['catid'];
+ }
+ return $want;
+};
+
+/**
+ * Configuration variables
+ */
+$HANDLER['grep']['settings'] = function($module) {
+ $want = array();
+ $res = Database::simpleQuery("SELECT setting FROM setting ORDER BY setting ASC");
+ while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ $want[] = $row['setting'];
+ }
+ return $want;
+};