aboutsummaryrefslogtreecommitdiff
path: root/actions/make_translation_editor.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/make_translation_editor.php')
-rw-r--r--actions/make_translation_editor.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/actions/make_translation_editor.php b/actions/make_translation_editor.php
new file mode 100644
index 000000000..5a5640c66
--- /dev/null
+++ b/actions/make_translation_editor.php
@@ -0,0 +1,23 @@
+<?php
+
+ admin_gatekeeper();
+
+ $result = false;
+
+ $user = get_input("user");
+ $role = "translation_editor";
+
+ $user = get_entity($user);
+ if($user instanceof ElggUser){
+ if(create_metadata($user->guid, $role, true, "integer", $user->guid, ACCESS_PUBLIC)){
+ $result = true;
+ }
+ }
+
+ if(!$result){
+ register_error(elgg_echo("translation_editor:action:make_translation_editor:error"));
+ } else {
+ system_message(elgg_echo("translation_editor:action:make_translation_editor:success"));
+ }
+
+ forward(REFERER); \ No newline at end of file