aboutsummaryrefslogtreecommitdiff
path: root/mod/translation_editor/actions/add_language.php
blob: 4b324bee627025a46754f81ed053a844b6444fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);