From 36102a094de700ee339f6eaeffb8ab16ba4f2f3b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 15 Mar 2014 14:42:50 -0300 Subject: Squashed 'mod/graphstats/' content from commit b5d0461 git-subtree-dir: mod/graphstats git-subtree-split: b5d046138c5841d55b4497618d5678cb8027c245 --- views/default/graphs/data/timestats.php | 33 +++++++++++++++ views/default/graphs/timeline.php | 44 +++++++++++++++++++ views/default/graphs/timestats.php | 8 ++++ views/default/graphstats/timestats_filter_menu.php | 31 ++++++++++++++ views/default/groups/profile/activity_module.php | 49 ++++++++++++++++++++++ views/default/js/raphael/analytics.php | 5 +++ views/default/js/raphael/raphael.php | 3 ++ views/default/js/timeline.php | 8 ++++ 8 files changed, 181 insertions(+) create mode 100644 views/default/graphs/data/timestats.php create mode 100644 views/default/graphs/timeline.php create mode 100644 views/default/graphs/timestats.php create mode 100644 views/default/graphstats/timestats_filter_menu.php create mode 100644 views/default/groups/profile/activity_module.php create mode 100644 views/default/js/raphael/analytics.php create mode 100644 views/default/js/raphael/raphael.php create mode 100644 views/default/js/timeline.php (limited to 'views/default') diff --git a/views/default/graphs/data/timestats.php b/views/default/graphs/data/timestats.php new file mode 100644 index 000000000..6179301a9 --- /dev/null +++ b/views/default/graphs/data/timestats.php @@ -0,0 +1,33 @@ + + + + + + $stat) { + $date = date(elgg_echo('friendlytime:date_format'), $time); + echo "\n"; + } + ?> + + + + + $stat) { + echo "\n"; + } + ?> + + +
$date
$stat
diff --git a/views/default/graphs/timeline.php b/views/default/graphs/timeline.php new file mode 100644 index 000000000..08d47581f --- /dev/null +++ b/views/default/graphs/timeline.php @@ -0,0 +1,44 @@ + +
+ diff --git a/views/default/graphs/timestats.php b/views/default/graphs/timestats.php new file mode 100644 index 000000000..d200c9b94 --- /dev/null +++ b/views/default/graphs/timestats.php @@ -0,0 +1,8 @@ + +
diff --git a/views/default/graphstats/timestats_filter_menu.php b/views/default/graphstats/timestats_filter_menu.php new file mode 100644 index 000000000..9f4ab55d1 --- /dev/null +++ b/views/default/graphstats/timestats_filter_menu.php @@ -0,0 +1,31 @@ + array( + 'text' => elgg_echo('absolute'), + 'href' => 'graphs/timestats?filter=absolute', + 'priority' => 200, + ), + 'relative' => array( + 'text' => elgg_echo('relative'), + 'href' => 'graphs/timestats?filter=relative', + 'priority' => 300, + ), +); + +// sets default selected item +if (strpos(full_url(), 'filter') === false) { + $tabs['absolute']['selected'] = true; +} + +foreach ($tabs as $name => $tab) { + $tab['name'] = $name; + + elgg_register_menu_item('filter', $tab); +} + +echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); diff --git a/views/default/groups/profile/activity_module.php b/views/default/groups/profile/activity_module.php new file mode 100644 index 000000000..7829f8c70 --- /dev/null +++ b/views/default/groups/profile/activity_module.php @@ -0,0 +1,49 @@ +activity_enable == 'no') { + return true; +} + +$group = $vars['entity']; +if (!$group) { + return true; +} + +$all_link = elgg_view('output/url', array( + 'href' => "groups/activity/$group->guid", + 'text' => elgg_echo('link:view:all'), +)); + +$add_link = ' '.elgg_view('output/url', array( + 'href' => "graphs/group/$group->guid", + 'text' => elgg_echo('timeline'), +)); + + +elgg_push_context('widgets'); +$db_prefix = elgg_get_config('dbprefix'); +$content = elgg_list_river(array( + 'limit' => 4, + 'pagination' => false, + 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"), + 'wheres' => array("(e1.container_guid = $group->guid)"), +)); +elgg_pop_context(); + +if (!$content) { + $content = '

' . elgg_echo('groups:activity:none') . '

'; +} + +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('groups:activity'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $add_link, +)); diff --git a/views/default/js/raphael/analytics.php b/views/default/js/raphael/analytics.php new file mode 100644 index 000000000..e8703b100 --- /dev/null +++ b/views/default/js/raphael/analytics.php @@ -0,0 +1,5 @@ +