aboutsummaryrefslogtreecommitdiff
path: root/actions/add_language.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/add_language.php')
-rw-r--r--actions/add_language.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/actions/add_language.php b/actions/add_language.php
new file mode 100644
index 000000000..4b324bee6
--- /dev/null
+++ b/actions/add_language.php
@@ -0,0 +1,19 @@
+<?php
+
+ admin_gatekeeper();
+
+ $code = get_input("code");
+ if(!empty($code)){
+ if($custom_languages = elgg_get_plugin_setting("custom_languages", "translation_editor")){
+ $custom_languages = explode(",", $custom_languages);
+ $custom_languages[] = $code;
+
+ $code = implode(",", array_unique($custom_languages));
+
+ }
+
+ elgg_set_plugin_setting("custom_languages", $code, "translation_editor");
+ system_message(elgg_echo("translation_editor:action:add_language:success"));
+ }
+
+ forward(REFERER); \ No newline at end of file