numentities.php 931 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Elgg statistics screen
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. */
  8. // Get entity statistics
  9. $entity_stats = get_entity_statistics(elgg_get_page_owner_guid());
  10. if ($entity_stats) {
  11. $rows = '';
  12. $even_odd = null;
  13. foreach ($entity_stats as $k => $entry) {
  14. foreach ($entry as $a => $b) {
  15. // This function controls the alternating class
  16. $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
  17. if ($a == "__base__") {
  18. $a = elgg_echo("item:{$k}");
  19. if (empty($a)) {
  20. $a = $k;
  21. }
  22. } else {
  23. $a = elgg_echo("item:{$k}:{$a}");
  24. if (empty($a)) {
  25. $a = "$k $a";
  26. }
  27. }
  28. $rows .= <<< END
  29. <tr class="{$even_odd}">
  30. <td class="column-one"><b>{$a}:</b></td>
  31. <td>{$b}</td>
  32. </tr>
  33. END;
  34. }
  35. }
  36. $title = elgg_echo('usersettings:statistics:label:numentities');
  37. $content = "<table class=\"elgg-table-alt\">$rows</table>";
  38. echo elgg_view_module('info', $title, $content);
  39. }