diff options
author | Christian Klinger | 2016-06-24 13:49:35 +0200 |
---|---|---|
committer | Christian Klinger | 2016-06-24 13:49:35 +0200 |
commit | c8538dde51b12ec281f2f8275bd250dc3bbee0a0 (patch) | |
tree | 392ae3a89c68976090bdba13ea4fbcc84e319c56 /modules-available/exams/page.inc.php | |
parent | fixed i18n and updated l10n (diff) | |
parent | [exams] Move to content group; fix timepicker; mark old exams (diff) | |
download | slx-admin-c8538dde51b12ec281f2f8275bd250dc3bbee0a0.tar.gz slx-admin-c8538dde51b12ec281f2f8275bd250dc3bbee0a0.tar.xz slx-admin-c8538dde51b12ec281f2f8275bd250dc3bbee0a0.zip |
Merge branch 'modularization' of git.openslx.org:openslx-ng/slx-admin into modularization
Diffstat (limited to 'modules-available/exams/page.inc.php')
-rw-r--r-- | modules-available/exams/page.inc.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index 79276236..56ab50f7 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -108,11 +108,17 @@ class Page_Exams extends Page protected function makeExamsForTemplate() { $out = []; + $now = time(); foreach ($this->exams as $exam) { - $tmp = $exam; - $tmp['starttime'] = date('Y-m-d H:i', $tmp['starttime']); - $tmp['endtime'] = date('Y-m-d H:i', $tmp['endtime']); - $out[] = $tmp; + if ($exam['endtime'] < $now) { + $exam['rowClass'] = 'gray'; + $exam['btnClass'] = 'btn-success'; + } else { + $exam['btnClass'] = 'btn-default'; + } + $exam['starttime'] = date('Y-m-d H:i', $exam['starttime']); + $exam['endtime'] = date('Y-m-d H:i', $exam['endtime']); + $out[] = $exam; } return $out; } |