aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/content_stats/content.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/widgets/content_stats/content.php')
-rw-r--r--views/default/widgets/content_stats/content.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/views/default/widgets/content_stats/content.php b/views/default/widgets/content_stats/content.php
new file mode 100644
index 000000000..b5ea00e18
--- /dev/null
+++ b/views/default/widgets/content_stats/content.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Content stats widget
+ */
+
+$max = 5;
+
+$entity_stats = get_entity_statistics();
+$object_stats = $entity_stats['object'];
+arsort($object_stats);
+$object_stats = array_slice($object_stats, 0, $max);
+
+echo '<table class="elgg-table">';
+foreach ($object_stats as $subtype => $num) {
+ $name = elgg_echo("item:object:$subtype");
+ echo "<tr><td>$name</td><td>$num</td></tr>";
+}
+echo '</table>';