Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
= Version history: =

4.7 ():
- added: group default widget support
(thanks to Connecting Conservation)

4.6 (2013-06-27):

- added: content_by_tag widget also support bookmarks
Expand Down
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Provides a few new widgets (see below for the widget list)
- Forcing of widget (incl positioning) on profile/dashboard (also later!)
- Option to globally hide a specific widgettype (will even hide widget already placed on profile/dashboard)
- Create group default widgets

Version 4.0 is only for 1.8 and higher
Version 3.9.x will be used for 1.7 patches
Expand Down
27 changes: 27 additions & 0 deletions lib/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,31 @@ function widget_manager_widgets_url($hook_name, $entity_type, $return_value, $pa
}
}
return $result;
}


/**
* Allow for group default widgets
*
* @param unknown_type $hook_name
* @param unknown_type $entity_type
* @param unknown_type $return_value
* @param unknown_type $params
* @return Ambigous <string, unknown>
*/
function widget_manager_group_widgets_default_list($hook_name, $entity_type, $return_value, $params) {
if (!is_array($return_value)) {
$return_value = array();
}

$return_value[] = array(
'name' => elgg_echo('groups'),
'widget_context' => 'groups',
'widget_columns' => 2,
'event' => 'create',
'entity_type' => 'group',
'entity_subtype' => NULL
);

return $return_value;
}
1 change: 1 addition & 0 deletions start.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function widget_manager_init(){
} elseif($group_option_enabled) {
// register event to make sure newly created groups have the group option enabled
elgg_register_event_handler("create", "group", "widget_manager_create_group_event_handler");
elgg_register_plugin_hook_handler('get_list', 'default_widgets', 'widget_manager_group_widgets_default_list');
}
}

Expand Down