aboutsummaryrefslogtreecommitdiff
path: root/mod/groups
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups')
-rw-r--r--mod/groups/start.php31
1 files changed, 28 insertions, 3 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 780e06d6f..4b3fb42ac 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -70,7 +70,7 @@
// Language short codes must be of the form "groups:key"
// where key is the array key below
- $CONFIG->group = array(
+ /*$CONFIG->group = array(
'name' => 'text',
'description' => 'longtext',
@@ -78,10 +78,34 @@
'interests' => 'tags',
'website' => 'url',
- );
+ );*/
// Now override icons
register_plugin_hook('entity:icon:url', 'group', 'groups_groupicon_hook');
+ }
+
+ /**
+ * This function loads a set of default fields into the profile, then triggers a hook letting other plugins to edit
+ * add and delete fields.
+ *
+ * Note: This is a secondary system:init call and is run at a super low priority to guarantee that it is called after all
+ * other plugins have initialised.
+ */
+ function groups_fields_setup()
+ {
+ global $CONFIG;
+
+ $profile_defaults = array(
+
+ 'name' => 'text',
+ 'description' => 'longtext',
+ 'briefdescription' => 'text',
+ 'interests' => 'tags',
+ 'website' => 'url',
+
+ );
+
+ $CONFIG->profile = trigger_plugin_hook('profile:fields', 'group', NULL, $profile_defaults);
}
/**
@@ -381,7 +405,8 @@
register_elgg_event_handler('delete', 'group', 'groups_delete_event_listener');
// Make sure the groups initialisation function is called on initialisation
- register_elgg_event_handler('init','system','groups_init');
+ register_elgg_event_handler('init','system','groups_init');
+ register_elgg_event_handler('init','system','groups_fields_setup', 10000); // Ensure this runs after other plugins
register_elgg_event_handler('join','group','groups_user_join_event_listener');
register_elgg_event_handler('leave','group','groups_user_leave_event_listener');
register_elgg_event_handler('pagesetup','system','groups_submenus');