diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-13 10:27:20 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-13 10:27:20 +0000 |
commit | 4cb4257d59975a3a8d31513f283589f145fefb19 (patch) | |
tree | ee1b01bbf356c2180edb4755e541faf2949e399a | |
parent | ee2606c7ae30b53d29f28154a4b7937297272d10 (diff) | |
download | elgg-4cb4257d59975a3a8d31513f283589f145fefb19.tar.gz elgg-4cb4257d59975a3a8d31513f283589f145fefb19.tar.bz2 |
Refs #235: Added hooks for future admin interface
git-svn-id: https://code.elgg.org/elgg/trunk@2235 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | mod/profile/start.php | 19 |
1 files changed, 18 insertions, 1 deletions
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); } |