Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 03, 2012
@mrclay mrclay Add group_activity widget f170700
View
1  README.txt
@@ -43,6 +43,7 @@ Since 4.0:
== Group widgets ==
+ - activity
- forum topics
- files
- izap_videos
View
8 languages/en.php
@@ -257,7 +257,13 @@
'widgets:tagcloud:no_data' => "No data available to display a tagcloud",
);
add_translation("en", $tagcloud);
-
+
+ $group_activity = array(
+ // group_activity widget
+ "widgets:group_activity:description" => "Shows latest activity in group",
+ );
+ add_translation("en", $group_activity);
+
$group_news = array(
// group_news widget
"widgets:group_news:title" => "Group News",
View
26 views/default/widgets/group_activity/content.php
@@ -0,0 +1,26 @@
+<?php
+
+$widget = $vars["entity"];
+/* @var ElggWidget $widget */
+
+$group_guid = $widget->owner_guid;
+
+$count = (int) $widget->activity_count;
+if (! $count) {
+ $count = 10;
+}
+
+$db_prefix = elgg_get_config('dbprefix');
+$river_options = array(
+ "pagination" => false,
+ "limit" => $count,
+ 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"),
+ 'wheres' => array("(e1.container_guid = $group_guid)"),
+);
+$activity = elgg_list_river($river_options);
+
+if (empty($activity)) {
+ $activity = elgg_echo("river:none");
+}
+
+echo $activity;
View
15 views/default/widgets/group_activity/edit.php
@@ -0,0 +1,15 @@
+<?php
+
+$widget = elgg_extract('entity', $vars);
+/* @var ElggWidget $widget */
+
+$count = (int) $widget->activity_count;
+if (! $count) {
+ $count = 10;
+}
+
+?>
+<div>
+ <?php echo elgg_echo("widget:numbertodisplay"); ?><br />
+ <?php echo elgg_view("input/text", array("name" => "params[activity_count]", "value" => $count, "size" => "4", "maxlength" => "4"));?>
+</div>
View
18 widgets/group_activity/start.php
@@ -0,0 +1,18 @@
+<?php
+/* init file for group_activity widget */
+
+function widget_group_activity_pagesetup(){
+
+}
+
+function widget_group_activity_init(){
+ elgg_register_widget_type(
+ "group_activity",
+ elgg_echo("groups:activity"),
+ elgg_echo("widgets:group_activity:description"),
+ "groups",
+ false);
+}
+
+elgg_register_event_handler("widgets_init", "widget_manager", "widget_group_activity_init");
+elgg_register_event_handler("widgets_pagesetup", "widget_manager", "widget_group_activity_pagesetup");

No commit comments for this range

Something went wrong with that request. Please try again.