events.php 875 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. $data = elgg_extract("data", $vars);
  3. $header = elgg_extract("header", $vars);
  4. if (!$header) {
  5. $header = elgg_echo('developers:inspect:events');
  6. }
  7. if (empty($data)) {
  8. return;
  9. }
  10. $make_id = function ($name) {
  11. return "z" . md5($name);
  12. };
  13. echo "<table class='elgg-table-alt'>";
  14. echo "<tr>";
  15. echo "<th>$header</th>";
  16. echo "<th width='1%'>" . elgg_echo('developers:inspect:priority') . "</th>";
  17. echo "<th>" . elgg_echo('developers:inspect:functions') . "</th>";
  18. echo "</tr>";
  19. $last_key = '';
  20. foreach ($data as $key => $arr) {
  21. foreach ($arr as $subkey => $value) {
  22. list($priority, $desc) = explode(': ', $value, 2);
  23. echo "<tr>";
  24. if ($key !== $last_key) {
  25. $id = $make_id($key);
  26. echo "<td id='$id' rowspan='" . count($arr) . "'>$key</td>";
  27. $last_key = $key;
  28. }
  29. echo "<td>$priority</td>";
  30. echo "<td>$desc</td>";
  31. echo "</tr>";
  32. }
  33. }
  34. echo "</table>";