Permalink
Browse files

For long courses reduce the text printed on x axis

  • Loading branch information...
1 parent d751ddc commit c351cf27995ba6221e318d8ed977f428dfb3091a moodler committed Nov 21, 2002
Showing with 15 additions and 1 deletion.
  1. +15 −1 course/loggraph.php
View
16 course/loggraph.php
@@ -40,10 +40,24 @@
}
$timestart = $coursestart = usergetmidnight($course->startdate);
+ if ((($timenow - $timestart)/86400.0) > 40) {
+ $reducedays = 7;
+ } else {
+ $reducedays = 0;
+ }
+
$i = 0;
while ($timestart < $timenow) {
$timefinish = $timestart + 86400;
- $days[$i] = userdate($timestart, "%a %d %b");
+ if ($reducedays) {
+ if ($i % $reducedays) {
+ $days[$i] = "";
+ } else {
+ $days[$i] = userdate($timestart, "%a %d %b");
+ }
+ } else {
+ $days[$i] = userdate($timestart, "%a %d %b");
+ }
$logs[$i] = 0;
$i++;
$timestart = $timefinish;

0 comments on commit c351cf2

Please sign in to comment.