cron.php 897 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Cron statistics
  4. */
  5. //$cronhooks = $CONFIG->hooks["cron"];
  6. $periods = elgg_get_config('elgg_cron_periods');
  7. $table_content = '';
  8. foreach ($periods as $period) {
  9. $name = elgg_echo("interval:$period");
  10. $key = "cron_latest:$period:ts";
  11. $ts = elgg_get_site_entity()->getPrivateSetting($key);
  12. if ($ts) {
  13. $friendly_time = elgg_view_friendly_time($ts);
  14. $date = date('r', $ts);
  15. } else {
  16. $friendly_time = elgg_echo('never');
  17. $date = '';
  18. }
  19. $table_content .= "<tr><td>$name</td><td>$friendly_time</td><td>$date</td><tr>";
  20. }
  21. $period_hd = elgg_echo('admin:cron:period');
  22. $friendly_hd = elgg_echo('admin:cron:friendly');
  23. $date_hd = elgg_echo('admin:cron:date');
  24. $table = <<<HTML
  25. <table class="elgg-table">
  26. <tr><th>$period_hd</th><th>$friendly_hd</th><th>$date_hd</th></tr>
  27. $table_content
  28. </table>
  29. HTML;
  30. echo elgg_view_module('inline', elgg_echo('admin:cron:record'), $table);