From e1dc0d3c99217504de2ac8467156274786efc0bd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 9 Oct 2014 16:01:11 +0200 Subject: Big load of changes - Added callback functionality for taskmanager tasks. You can launch a task and define a callback function to be run when the task finished. This requires activating the cronjob - Added cron functionality: Add cronjob that calls the cron api every 5 minutes to use it. (See cron.inc.php) - Added eventlog - Added missing translations - Merged main-menu-login and main-menu-logout --- modules/eventlog.inc.php | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/eventlog.inc.php (limited to 'modules/eventlog.inc.php') diff --git a/modules/eventlog.inc.php b/modules/eventlog.inc.php new file mode 100644 index 00000000..1a63a0a6 --- /dev/null +++ b/modules/eventlog.inc.php @@ -0,0 +1,55 @@ +exec(); + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $day = date('d.m.Y', $row['dateline']); + if ($day === $today) { + $day = Dictionary::translate('today'); + } elseif ($day === $yesterday) { + $day = Dictionary::translate('yesterday'); + } + $row['date'] = $day . date(' H:i', $row['dateline']); + $row['icon'] = $this->typeToIcon($row['logtypeid']); + $lines[] = $row; + } + + $paginate->render('eventlog/_page', array( + 'list' => $lines + )); + } + + private function typeToIcon($type) + { + switch ($type) { + case 'info': + return 'ok'; + case 'warning': + return 'exclamation-sign'; + case 'error': + return 'remove'; + default: + return 'question-sign'; + } + } + +} -- cgit v1.2.3-55-g7522