content.php 877 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Content stats widget
  4. */
  5. $num_display = sanitize_int($vars['entity']->num_display, false);
  6. // set default value for display number
  7. if (!$num_display) {
  8. $num_display = 8;
  9. }
  10. $entity_stats = get_entity_statistics();
  11. $object_stats = elgg_extract('object', $entity_stats);
  12. arsort($object_stats);
  13. $object_stats = array_slice($object_stats, 0, $num_display);
  14. echo '<table class="elgg-table-alt">';
  15. echo '<tr><th>' . elgg_echo('widget:content_stats:type') . '</th>';
  16. echo '<th>' . elgg_echo('widget:content_stats:number') . '</th></tr>';
  17. foreach ($object_stats as $subtype => $num) {
  18. $name = elgg_echo("item:object:$subtype");
  19. echo "<tr><td>$name</td><td>$num</td></tr>";
  20. }
  21. echo '</table>';
  22. echo '<div class="mtm">';
  23. echo elgg_view('output/url', array(
  24. 'href' => 'admin/statistics/overview',
  25. 'text' => elgg_echo('more'),
  26. 'is_trusted' => true,
  27. ));
  28. echo '</div>';