encoding (rd)

This commit is contained in:
L_DA 2020-06-28 18:34:19 +00:00
parent 60c4b8e1f8
commit 85f5a13f9f

View file

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