aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/graphstats/group.php42
-rw-r--r--pages/graphstats/timestats.php37
2 files changed, 79 insertions, 0 deletions
diff --git a/pages/graphstats/group.php b/pages/graphstats/group.php
new file mode 100644
index 000000000..5bb2f2567
--- /dev/null
+++ b/pages/graphstats/group.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Group timeline
+ *
+ * @package ElggGraphStats
+ */
+
+$view = get_input('view', 'default');
+$group_guid = (int) get_input('group_guid');
+
+$group = new ElggGroup($group_guid);
+if (!$group->guid) {
+ forward();
+}
+
+$title = elgg_echo('graphstats:group');
+
+elgg_push_breadcrumb(elgg_echo('graphstats'), "graphs/timestats");
+elgg_push_breadcrumb($group->name, $group->getURL());
+elgg_push_breadcrumb($title);
+
+elgg_set_page_owner_guid($group_guid);
+
+if($view != 'json'){
+
+ $json_url = elgg_get_site_url() . "graphs/group/$group_guid/?view=json";
+
+ $content = elgg_view('graphs/timeline', array('json_url' => $json_url));
+
+ $body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+ ));
+
+ echo elgg_view_page($title, $body);
+
+} else {
+
+ echo elgg_view('timeline/group', array('group_guid' => $group_guid));
+
+}
diff --git a/pages/graphstats/timestats.php b/pages/graphstats/timestats.php
new file mode 100644
index 000000000..6516e145d
--- /dev/null
+++ b/pages/graphstats/timestats.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Site time stats.
+ *
+ * @package ElggGraphStats
+ */
+
+elgg_load_library('elgg:graphs:timestats');
+
+$title = elgg_echo('graphstats:timestats');
+
+elgg_push_breadcrumb($title);
+
+$type = get_input('type', 'user');
+$subtype = get_input('subtype', '');
+$filter = get_input('filter', 'absolute');
+$type_subtype = $type . ($subtype?":$subtype":"");
+
+$table = elgg_view('graphs/data/timestats', array(
+ 'type' => $type,
+ 'subtype' => $subtype,
+ 'relative' => ($filter == 'relative'),
+));
+
+$content = elgg_view('graphs/timestats', array('table' => $table));
+
+$filter = elgg_view('graphstats/timestats_filter_menu', array('selected' => $relative));
+
+timestats_setup_sidebar_menu();
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => $filter,
+));
+
+echo elgg_view_page($title, $body);