aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-02 01:59:56 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-02 01:59:56 +0000
commit4d9b6f2fe63091e72c04ea31eaae61738b668d65 (patch)
tree6933358e89eca635cab8f184ecb618fa1e0ffac5 /mod/groups/start.php
parent45631d83520b36669848e599c5bf8a7fb7c3a3f9 (diff)
downloadelgg-4d9b6f2fe63091e72c04ea31eaae61738b668d65.tar.gz
elgg-4d9b6f2fe63091e72c04ea31eaae61738b668d65.tar.bz2
a little clean up of the groups edit form
git-svn-id: http://code.elgg.org/elgg/trunk@7986 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/start.php')
-rw-r--r--mod/groups/start.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 72ea31480..c0fc90135 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -7,6 +7,9 @@
elgg_register_event_handler('init', 'system', 'groups_init');
+// Ensure this runs after other plugins
+elgg_register_event_handler('init', 'system', 'groups_fields_setup', 10000);
+
/**
* Initialize the groups plugin.
*/
@@ -82,11 +85,6 @@ function groups_init() {
// Register a handler for delete groups
elgg_register_event_handler('delete', 'group', 'groups_delete_event_listener');
-
- // Make sure the groups initialisation function is called on initialisation
-
- // Ensure this runs after other plugins
- elgg_register_event_handler('init', 'system', 'groups_fields_setup', 10000);
elgg_register_event_handler('join', 'group', 'groups_user_join_event_listener');
elgg_register_event_handler('leave', 'group', 'groups_user_leave_event_listener');
@@ -95,14 +93,14 @@ function groups_init() {
}
/**
- * This function loads a set of default fields into the profile, then triggers a hook letting other plugins to edit
- * add and delete fields.
+ * 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.
+ * Note: This is a system:init event triggered function and is run at a super
+ * low priority to guarantee that it is called after all other plugins have
+ * initialized.
*/
function groups_fields_setup() {
- global $CONFIG;
$profile_defaults = array(
'name' => 'text',
@@ -112,14 +110,17 @@ function groups_fields_setup() {
//'website' => 'url',
);
- $CONFIG->group = elgg_trigger_plugin_hook('profile:fields', 'group', NULL, $profile_defaults);
+ $profile_defaults = elgg_trigger_plugin_hook('profile:fields', 'group', NULL, $profile_defaults);
+
+ elgg_set_config('group', $profile_defaults);
// register any tag metadata names
- foreach ($CONFIG->group as $name => $type) {
+ foreach ($profile_defaults as $name => $type) {
if ($type == 'tags') {
elgg_register_tag_metadata_name($name);
- // register a tag name translation
+ // only shows up in search but why not just set this in en.php as doing it here
+ // means you cannot override it in a plugin
add_translation(get_current_language(), array("tag_names:$name" => elgg_echo("groups:$name")));
}
}