aboutsummaryrefslogtreecommitdiff
path: root/actions/profile
diff options
context:
space:
mode:
Diffstat (limited to 'actions/profile')
-rw-r--r--actions/profile/fields/add.php2
-rw-r--r--actions/profile/fields/edit.php20
2 files changed, 21 insertions, 1 deletions
diff --git a/actions/profile/fields/add.php b/actions/profile/fields/add.php
index 15bd7024a..b35df1549 100644
--- a/actions/profile/fields/add.php
+++ b/actions/profile/fields/add.php
@@ -20,7 +20,7 @@ if (!$fieldlist) {
$id = max($fieldlistarray) + 1;
}
-if (($label) && ($type)){
+if (($label) && ($type)) {
if (!empty($fieldlist)) {
$fieldlist .= ',';
}
diff --git a/actions/profile/fields/edit.php b/actions/profile/fields/edit.php
new file mode 100644
index 000000000..5fc84ff11
--- /dev/null
+++ b/actions/profile/fields/edit.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Edit a custom profile field
+ */
+
+$id = get_input('id');
+$label = get_input('label');
+
+if (!elgg_get_config("admin_defined_profile_$id")) {
+ register_error(elgg_echo('profile:editdefault:fail'));
+ forward(REFERER);
+}
+
+if (elgg_save_config("admin_defined_profile_$id", $label)) {
+ system_message(elgg_echo('profile:editdefault:success'));
+} else {
+ register_error(elgg_echo('profile:editdefault:fail'));
+}
+
+forward(REFERER); \ No newline at end of file