diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:58:52 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:58:52 -0300 |
commit | 2d9b20157957a55bd83875775085ed31c9062577 (patch) | |
tree | f051d6d805a3448ea243379a2457be8d67dcfa5f /actions/delete_language.php | |
download | elgg-2d9b20157957a55bd83875775085ed31c9062577.tar.gz elgg-2d9b20157957a55bd83875775085ed31c9062577.tar.bz2 |
Squashed 'mod/translation_editor/' content from commit 9d86955
git-subtree-dir: mod/translation_editor
git-subtree-split: 9d86955e6d8b6807578f5a9da0346ac1a146881c
Diffstat (limited to 'actions/delete_language.php')
-rw-r--r-- | actions/delete_language.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/actions/delete_language.php b/actions/delete_language.php new file mode 100644 index 000000000..77b8441f5 --- /dev/null +++ b/actions/delete_language.php @@ -0,0 +1,26 @@ +<?php
+
+ admin_gatekeeper();
+
+ $language = get_input("language");
+ if(!empty($language) && ($language != "en")){
+
+ $completeness = translation_editor_get_language_completeness($language);
+ if($completeness == 0){
+ if($custom_languages = elgg_get_plugin_setting("custom_languages", "translation_editor")){
+ $custom_languages = explode(",", $custom_languages);
+
+ $index = array_search($language, $custom_languages);
+ if($index !== false ){
+ unset($custom_languages[$index]);
+
+ $code = implode(",", array_unique($custom_languages));
+
+ elgg_set_plugin_setting("custom_languages", $code, "translation_editor");
+ system_message(elgg_echo("translation_editor:action:delete_language:success"));
+ }
+ }
+ }
+ }
+
+ forward(REFERER);
\ No newline at end of file |