From 4cb4257d59975a3a8d31513f283589f145fefb19 Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 13 Oct 2008 10:27:20 +0000 Subject: Refs #235: Added hooks for future admin interface git-svn-id: https://code.elgg.org/elgg/trunk@2235 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/profile/start.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/profile/start.php b/mod/profile/start.php index 7f5ca3301..def519c94 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -99,7 +99,24 @@ 'website' => 'url', ); - // TODO: Have an admin interface which replaces the above with defaults from a database if present. + // TODO: Have an admin interface for this + + $n = 0; + $loaded_defaults = array(); + while ($translation = get_plugin_setting("admin_defined_profile_$n", 'profile')) + { + // Add a translation + add_translation(get_current_language(), array("profile:admin_defined_profile_$n" => $translation)); + + // Detect type + $type = get_plugin_setting("admin_defined_profile_type_$n", 'profile'); + if (!$type) $type = 'text'; + + // Set array + $loaded_defaults["profile:admin_defined_profile_$n"] = $type; + } + if (count($loaded_defaults)) + $profile_defaults = $loaded_defaults; $CONFIG->profile = trigger_plugin_hook('profile:fields', 'profile', NULL, $profile_defaults); } -- cgit v1.2.3