aboutsummaryrefslogtreecommitdiff
path: root/mod/profile
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 02:12:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 02:12:32 +0000
commit373ff03a2b6315eea13a97065774972ad3713ab6 (patch)
treedf051d2a4c1d150fd75b2f3db2d4647a5e1ebda9 /mod/profile
parent06f0e7b1aa5f6fd393d9a0b580f94709e29e10df (diff)
downloadelgg-373ff03a2b6315eea13a97065774972ad3713ab6.tar.gz
elgg-373ff03a2b6315eea13a97065774972ad3713ab6.tar.bz2
Fixes #2753: Default widgets merged into core as extensible admin section and updated to work with new widgets. Will need an upgrade for users running the old default widgets in 1.7.
git-svn-id: http://code.elgg.org/elgg/trunk@8302 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile')
-rw-r--r--mod/profile/start.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 67be35e7e..e17f955c5 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -31,9 +31,12 @@ function profile_init() {
elgg_extend_view('html_head/extend', 'profile/metatags');
elgg_extend_view('css/screen', 'profile/css');
-
+
// allow ECML in parts of the profile
elgg_register_plugin_hook_handler('get_views', 'ecml', 'profile_ecml_views_hook');
+
+ // allow admins to set default widgets for users on profiles
+ elgg_register_plugin_hook_handler('get_list', 'default_widgets', 'profile_default_widgets_hook');
}
/**
@@ -101,3 +104,26 @@ function profile_ecml_views_hook($hook, $entity_type, $return_value, $params) {
return $return_value;
}
+
+/**
+ * Register profile widgets with default widgets
+ *
+ * @param unknown_type $hook
+ * @param unknown_type $type
+ * @param unknown_type $return
+ * @param unknown_type $params
+ * @return array
+ */
+function profile_default_widgets_hook($hook, $type, $return, $params) {
+ $return[] = array(
+ 'name' => elgg_echo('profile'),
+ 'widget_context' => 'profile',
+ 'widget_columns' => 3,
+
+ 'event' => 'create',
+ 'entity_type' => 'user',
+ 'entity_subtype' => ELGG_ENTITIES_ANY_VALUE,
+ );
+
+ return $return;
+} \ No newline at end of file