diff --git a/block_timetable.php b/block_timetable.php index eef4c65..a81762f 100644 --- a/block_timetable.php +++ b/block_timetable.php @@ -47,7 +47,7 @@ class block_timetable extends block_base { $this->content = new stdClass(); $this->content->items = array(); $this->content->icons = array(); - $this->content->footer = 'Fächer
Lehrer
Räume'; + $this->content->footer = 'Fächer
Lehrer
Räume'; $this->content->text = ""; /* @@ -66,6 +66,7 @@ class block_timetable extends block_base { $this->content->text .= "site context"; } */ +// echo var_dump($USER); $view = 'subject'; if ($this->page->course->idnumber && $this->page->course->shortname) { $class = $this->page->course->shortname; @@ -75,8 +76,7 @@ class block_timetable extends block_base { $teacher = $USER->username; $teacher = str_replace("l_", "", $teacher); $teacher = str_replace("-fvs", "", $teacher); - //echo var_dump($USER); - $this->content->text .= "Stundenplan von Lehrer*in $teacher
"; + $this->content->text .= "Stundenplan von ".(substr($USER->firstname,0,1)).". {$USER->lastname}
"; $ttable = new timetable('teacher',$teacher); $view = 'class'; } elseif ($USER->department) { @@ -97,9 +97,11 @@ class block_timetable extends block_base { $date = new DateTime(); $monday = new DateTime(); - $dayofweek = $date->format('w')-1; + $dayofweek = $date->format('w'); if ($dayofweek >= $numdayweek) { - $monday->add(new DateInterval("P".(7-$dayofweek)."D")); + $monday->add(new DateInterval("P".(8-$dayofweek)."D")); + } elseif ($dayofweek < 1) { + $monday->add(new DateInterval("P1D")); } else { $monday->sub(new DateInterval("P{$dayofweek}D")); }