aboutsummaryrefslogtreecommitdiff
path: root/views/json/timeline
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:42:50 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:42:50 -0300
commit36102a094de700ee339f6eaeffb8ab16ba4f2f3b (patch)
tree57676a64905ae0e112cc5d698a5f61b36a88c5b3 /views/json/timeline
downloadelgg-36102a094de700ee339f6eaeffb8ab16ba4f2f3b.tar.gz
elgg-36102a094de700ee339f6eaeffb8ab16ba4f2f3b.tar.bz2
Squashed 'mod/graphstats/' content from commit b5d0461
git-subtree-dir: mod/graphstats git-subtree-split: b5d046138c5841d55b4497618d5678cb8027c245
Diffstat (limited to 'views/json/timeline')
-rw-r--r--views/json/timeline/group.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/views/json/timeline/group.php b/views/json/timeline/group.php
new file mode 100644
index 000000000..77655938b
--- /dev/null
+++ b/views/json/timeline/group.php
@@ -0,0 +1,35 @@
+<?php
+
+$group_guid = sanitize_int(get_input('group_guid'));
+
+$entities = elgg_get_entities(array('container_guid'=>$group_guid, 'limit'=>0, 'type'=>'object'));
+$events = array();
+
+$db_prefix = elgg_get_config('dbprefix');
+$river = elgg_get_river(array(
+ 'limit' => 0,
+ 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"),
+ 'wheres' => array("(e1.container_guid = $group_guid)"),
+));
+
+foreach($river as $item){
+ $subject = $item->getSubjectEntity();
+ $object = $item->getObjectEntity();
+
+ array_push($events, array(
+ 'start' => date('c', $item->posted),
+ 'icon'=> $icon,
+ 'title' => $object->title,
+ 'classname' => 'hot_event',
+ 'description' => elgg_get_excerpt($object->description),
+ 'durationEvent' => false,
+ ));
+
+}
+
+$data = array(
+ 'dateTimeFormat'=>'iso8601',
+ 'events'=>$events,
+);
+
+echo json_encode($data);