aboutsummaryrefslogtreecommitdiff
path: root/mod/graphstats/pages
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
commit971b54fe719ed70704fb3bcac4ef1d5f093cb454 (patch)
tree26e090c444b1e34881bc088a9cd6f3223e26047a /mod/graphstats/pages
parent711dab09b5146e74dbeda56679c65e3b6bec71f3 (diff)
parent36102a094de700ee339f6eaeffb8ab16ba4f2f3b (diff)
downloadelgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.gz
elgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.bz2
Merge commit '36102a094de700ee339f6eaeffb8ab16ba4f2f3b' as 'mod/graphstats'
Diffstat (limited to 'mod/graphstats/pages')
-rw-r--r--mod/graphstats/pages/graphstats/group.php42
-rw-r--r--mod/graphstats/pages/graphstats/timestats.php37
2 files changed, 79 insertions, 0 deletions
diff --git a/mod/graphstats/pages/graphstats/group.php b/mod/graphstats/pages/graphstats/group.php
new file mode 100644
index 000000000..5bb2f2567
--- /dev/null
+++ b/mod/graphstats/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/mod/graphstats/pages/graphstats/timestats.php b/mod/graphstats/pages/graphstats/timestats.php
new file mode 100644
index 000000000..6516e145d
--- /dev/null
+++ b/mod/graphstats/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);